Questions tagged [vector-calculus]

Questions on dealing with vector calculus functions of Mathematica such as Grad, Div, Curl, Laplacian and their representations in various coordinate systems.

Filter by
Sorted by
Tagged with
1
vote
0answers
317 views

numerical gradient of an array

I have 2D arrays of numeric data and I would like to calculate the vector gradient of these arrays. I would like to achieve something like the 'gradient' function of MatLab: https://www.mathworks....
3
votes
2answers
122 views

Symbolic representation of vector function

I want to symbolically represent a function $p: \mathbb R^n \to \mathbb R^n$, where the eventual goal is to compute an exact partial derivative. The function in question is given by $$ p_i(z) = \...
1
vote
3answers
63 views

Unexpected behavior when using Cross

I'm trying to calculate the equation of the plane that is formed from the position of the Earth, Moon and Sun using precise coordinates from NASA's SPICE toolkit. I found this extremely clear ...
5
votes
3answers
342 views

Finding surface normal for 3D region at a specific point

I would like to find the surface normal for a point on a 3D filled shape in Mathematica. I know how to calculate the normal of a parametric surface using the cross product but this method will not ...
9
votes
3answers
684 views

Creating random configurations of spherocylinders or cylinders

About the setting: We have a 3D simulation box with side $l$ and our catesian coordinate system is set with its origin at the centre of the box. We have a number $N$ of spherocylinders of aspect ...
2
votes
2answers
209 views

How can I do integration with the Green theorem?

I have an integral $$\int_C xy^2dx-4x\sin y\,dy$$ where $C$ bounded with some constrains, for instance inside $x^2+y^2=1$ and below $y=x^2$. I can integrate of one variable and also with some ...
7
votes
0answers
185 views

How to locate a stream line starting from a saddle point?

I read in a table of gradient vectors and plot using the ListStreamPlot. I want to locate and color the line that represents the "boundary" of the flux. A flux line that 1)starts from a saddle point 2)...
2
votes
2answers
253 views

Trying to define the Lie bracket of two vector fields

I am trying to define in the simplest possible way (only one coordinate system, no checking that variables are vectors, etc.) the Lie bracket of two vector fields in 3-space. What is wrong with the ...
6
votes
1answer
234 views

Why $u\cdot \operatorname{grad}(u)$ is not equal to $\operatorname{div}(u u)$?

The Navier-Stokes equation contains term $\vec{u} \cdot \nabla \vec{u}$ which should be equal to $\nabla \cdot \left(\vec{u}\vec{u} \right)$ provided $\nabla \cdot \vec{u}=0$. However this ...
1
vote
1answer
230 views

Vector analysis in curvilinear coordinates

It is known that vector calculus in 3D takes quite a simple form when one uses orthonormal curvilinear coordinates (check out, for example, here, in section "Differentiation"). Is there any ...
2
votes
1answer
649 views

How to plot a vector field on a circle?

I have two vector fields (electric fields) for inside and outside an sphere of radius $R$ (lets suppose $R=1$), expressed as: ...
0
votes
1answer
181 views

Visualizing combined Vectors

I'm trying to visualize a cross-section of a finite continuous solenoid's B-Field (cylindrical coordinate equations from Wikipedia). I believe I have calculated the radial and z-axis fields, but I'm ...
1
vote
1answer
398 views

Plotting vector field in cylindrical co-ordinates

I am trying to plot the following. Let $\Gamma^\top \Gamma=1$, and $e_3=\{0,0,1\}$ (unit vector along Z-axis). I am trying to plot $\dot \Gamma=e_3\times \Gamma$. Tried the following: $\Gamma =\{\...
0
votes
0answers
176 views

Integrating over a sphere

We are trying to integrate a vector function over a sphere. To do this we changed it to spherical coordinates and then tried to integrate it. Unfortunately we get the error message shown on the image ...
0
votes
1answer
176 views

NIntegrate integrand evaluating to non-numerical values [closed]

I am having trouble with the NIntegrate at the bottom. I've tried using NumericQ in different ways but keep getting an error ...
0
votes
2answers
87 views

How should I interpret the results I'm getting from Grad? [closed]

When I type the following in Mathematica: $Assumptions = (a | b | c | d) ∈ Vectors[3, Reals]; Grad[(b - a)\[Cross](d - c), {a}] I obtain: ...
0
votes
1answer
89 views

How to compute the derivative of the magnitude of a vector? [duplicate]

Mathematically we can say the following $$ \frac{d}{d\vec{x}}\frac{1}{|\vec{x}|} = -\frac{\vec{x}}{|\vec{x}|^3}.$$ However, in Mathematica, I perform the following ...
3
votes
1answer
258 views

SphericalPlot3D of an OblateSpheroid via coordinate transformation

This is an effort to reproduce an ellipse and a hyperbola of revolution from OblateSpheroidal coordinates with constant $\eta$ and $\theta$ . My approach consisted in getting a Coordinate ...
3
votes
0answers
138 views

Finding possible lattice planes of a crystal structure

After generating a crystal structure from a crystallographic data and duplicating it to a larger crystal system I would like to find possible lattice planes of this crystal. It is well-known that the ...
2
votes
0answers
130 views

Extracting the curl-free component of a vector field

I am trying to extract the curl-free component of a discrete vector field. My plan is to take the Fourier transform of the vector field and then extract the radial component in Fourier space. The ...
0
votes
1answer
99 views

Issues with Orthogonalize and AngleBracket

I can't quite put a finger as to why using 'AngleBracket' is so uncomfortable. For one part, one can't really assigned some arbitrary variable to any definition of an expression associated with '...
2
votes
2answers
68 views

How to invoke JacobianDeterminant in MMA >9.0?

According to the JacobianDeterminant help for my MMA 11.0 (W7, 64-bit) As of Version 9.0, vector analysis functionality is built into the Wolfram Language but the only Jacobian headwords are for ...
2
votes
2answers
283 views

Cross product of two vector functions [closed]

I have two vector functions f[x_, y_, z_] := {x, y, z} g[x_, y_, z_] := {y, 10, x} I want to take the cross product of these two vectors at every point. This ...
1
vote
2answers
841 views

How to calculate the surface integral of a vector field

Suppose the oriented surface is described as, the outside of an upper hemisphere $S:x^2+y^2+z^2=1$ inside the cylinder $x^2-x+y^2=0$ The vector field is : ${\vec F}=<x^2,y^2,z^2>$ How to ...
1
vote
1answer
671 views

Get the vector Norm without absolute values? [duplicate]

I want to get the Norm of a vector which involves sines and cosines (So I really need to replace it by the Pythagorean theorem). Since I know that all my results are going to be real and positive I ...
9
votes
0answers
118 views

Symbolically evaluating gradients/Hessians

I'm taking a machine learning course, which involves taking a lot of analytical gradients and Hessians. It would be ideal if I could perform these calculations in Mathematica. However, I am only aware ...
1
vote
1answer
95 views

How to move vector onto a curve at a specified point

I have the following code: ...
1
vote
0answers
107 views

How does this `Tagset` /: defined function work?

This came up in an assignment problem. I am tasked to use 1) ▽ /: ▽[f_] := {D[f, x], D[f, y], D[f, z]} 2) ...
0
votes
0answers
232 views

Defining a del operator [duplicate]

I understand the Grad function is a mean to taking the gradient of an arbitrary function. However, I'd like to define the Del ...
4
votes
1answer
119 views

Defining a vector function in terms of the unit vectors $\bf{i}$, $\bf{j}$, $\bf{k}$

I am given the following equation for the position of a particle: ${\bf r}(t) = \sin(11t)\ {\bf i} + t^4\ {\bf j} + \cos (11 t)\ {\bf k}$ I seek to: Find the equation of the tangent line at $t=0.2$....
0
votes
2answers
622 views

Computing Jacobian matrix

I am trying to compute the Jacobian matrix J. In my case, f and x are 3-vectors (my vectors are named g and a instead), so J should be a 3X3 matrix. Here's the code I'm using: ...
1
vote
2answers
79 views

Augmented function of function

I have two generic functions : ucdu[x : {__}] := Times @@ (x) and cb[x : {__}, p : {__}] := Plus @@ (x p) For instance, ...
3
votes
0answers
654 views

How to visualize the vorticity of a 3D velocity field? [closed]

I sample a snapshot from a system with 50 particles including their position and instant velocities. The snapshot is a list of 3 position and 3 velocities values per particle. i.e. 50 lines each of ...
4
votes
0answers
101 views

How to extend a root finding method from 1D to multi dimensions

The number (0.25 Pi) is a third order root of f[x] below. Clear[f]; f[x_] := Sin[x] - Cos[x] - Sqrt[2] (x - 0.25 Pi); Chop@Normal@Series[f[x], {x, 0.25 Pi, 4}] -...
1
vote
0answers
256 views

Symbolic derivatives with vectors and matrices

I'm currently trying to solve some problems using symbolic vectors and matrices of arbitrary size. However, I have some problems with understanding and verifying the results: I defined the vectors as ...
0
votes
1answer
412 views

How to reparametrize a curve by arclength using Mathematica? [duplicate]

There are some formulas in Differential Geometry that require a curve to be parametrized by arc length. Suppose we have a curve $\alpha(t)$, given by ...
3
votes
1answer
260 views

Solving vector differential equation

Disclaimer: Please excuse me if this question seems trivial; I'm new to Mathematica. As a simple example, consider the stationary Boltzmann equation $$\frac{\vec{p}}{m} \cdot \vec{\nabla}_x \, f(\vec{...
1
vote
1answer
234 views

Trouble with ListVectorPlot3D

I am trying to visualize a complex vector field. However, I seem to have difficulty with the usage of ListVectorPlot3D. The following example works in two dimension,...
0
votes
0answers
66 views

ParametricRegion3D is not working well

I am trying to define a region along a space curve where I will display the vector field. My space curve is obtained by numerical integration and defined by Interpolating functions. It is hard to post ...
0
votes
1answer
78 views

ListVectorPlot on a section of a circle

Can anyone help, why ListVectorPlot and ListStreamPlot show vectors and streamlines lying outside the allowed domain? Here is my Mathematica code: ...
1
vote
1answer
242 views

Finding unit tangent for a given r(t)

For my Calc III class, I need to find $T(t)$, $N(t)$, and $k(t)$ using Mathematica, given $r(t) = {sqrt(t), (1/2)t^2, t^3 - (5/2)t^2 - 17}$. While the former and latter have been found, attempting to ...
4
votes
0answers
135 views

How to verify the convexity of a function?

I have an optimization problem with the following objective function in $(x,y)$ $$ A\log \left(\sum_{i=1}^n x_i\right)+\log\left(1-\frac{f}{n}\left(\sum_{i=1}^n\frac{x_i}{y_i}\right)\right) $$ where $...
1
vote
0answers
77 views

Laplacian along line [closed]

I am looking for a command that will calculate the Laplacian of a function defined on a line. I have a definition of the line, $r(\theta)$ I want to calculate $$\frac{1}{r}\frac{d}{dr}(r\frac{df}{...
0
votes
1answer
128 views

Curl and other functions of functions

Where can one find the source code of the Mathematica function Curl? Alternatively, how can one define a function the argument of which is restricted to be a 3D vector function of three variables ...
-1
votes
1answer
1k views

Integration with a matrix as the the integrand [closed]

How can I calculate the following integral (wisely) in Mathematica? $\qquad \int^{2\pi}_0 \int^{\pi}_0 \int^{2\pi}_0 \mathbf{A}\,d\alpha\,d\beta\,d\gamma$, where $\mathbf{A}$ is a vector defined as: ...
-2
votes
0answers
32 views

How to manipulate this? [duplicate]

I tried to code this, but everytime I code I failed. Im not sure what I did wrong and Im fairly new to Mathematica. Can you guys check it out? ...
0
votes
1answer
200 views

How do you manipulate this in 2D

Use Manipulate to create an interactive plot that shows the parametrically-defined curve described by {x[t], y[t]} = {t Sin[t], t^2/15} for ...
1
vote
1answer
306 views

Partial Differentiation with interpolation function

I'm trying to take the partial differential of each component of an interpolation summed together. It works fine when I do it with an algebraic expression, but I can't understand why it doesn't work ...
0
votes
0answers
286 views

Solve equations involving summation expressions in Mathematica

I am trying to solve the simple linear regression equation analytically in Mathematica (not using builtin functions). I managed to calculate the gradient as follows f is loss function using RSS and ...
4
votes
1answer
188 views

Using Vector Operations In Mathematica

I would like to calculate $$ \mathbf T = (\mathbf B \bullet \nabla) \mathbf B$$ Where nabla (the upside down triangle) is the grad operator $(\partial/\partial x,\partial/\partial y,\partial/\...