23
votes
Accepted
What is the definition of Curl in Mathematica?
The definition used (motivated by exterior calculus) is as follows:
Given a rectangular array $a$ of depth $n$, with dimensions $\{d, ..., d\}$ (so there are $n$ $d$'s) and a list $x = \{x_1, ..., ...
22
votes
How to make Jacobian automatically in Mathematica
Grad[a,b] also produces the Jacobian.
a = {x1^3 + 2 x2^2, 3 x1^4 + 7 x2};
b = {x1, x2};
Grad[a, b] // MatrixForm
This has the ...
12
votes
Accepted
How to calculate the surface integral of a vector field?
You can try using ImplicitRegion and Integrate:
...
12
votes
Accepted
Why $u\cdot \operatorname{grad}(u)$ is not equal to $\operatorname{div}(u u)$?
I've previously found that Mathematica's arrangement of Grad's output doesn't always agree with fluid mechanics conventions: try transposing it. In general for ...
11
votes
What is the definition of Curl in Mathematica?
I fail to find a reference for the definition used by Curl, but manage to figure out how the Curl is defined.
I'll use Einstein ...
11
votes
Accepted
Einstein summation convention for symbolic vector calculus
First let me remark that you can unprotect symbols by doing Unprotect[symbol], and then you can define whatever you want to it. This is however not always advised.
...
11
votes
Accepted
'gradient' function in MMA
The two options I see are to either build your own gradient function or to use Interpolation.
Using a custom function:
...
10
votes
Accepted
Finding unit tangent, normal, and binormal vectors for interpolated function
First we get you interpolating function:
...
9
votes
Creating random configurations of spherocylinders or cylinders
Any approach to this will depend on efficiently deciding if two capsules overlap. You could do this using the built-in RegionDisjoint
...
9
votes
Summation of Kronecker deltas should give the dimension
You could just do:
Sum[KroneckerDelta[μ, ν] KroneckerDelta[μ, ν], {ν, d}, {μ, d}, Assumptions->d>1]
d
Although it might make sense to use symbolic ...
9
votes
Accepted
Where to find order of arguments for default functions
The "Details" section of that page refers to CoordinateChartData. Now this is a bit dense, but it contains everything you need. First of all, you can try to find ...
9
votes
Accepted
Solve the vector-matrix equation. Minimize the length of the desired n-dimensional vector
Really this should have a concrete example in Mathematica copy-pastable format. Anyway, I'll show a few ways using a made-up example. We'll eventually get it down to straight linear algebra.
To keep ...
8
votes
Accepted
Get the vector Norm without absolute values?
That expression is the square root of the dot product of the vector by itself:
Sqrt[vec.vec]
where vec is your vector.
8
votes
How to calculate the surface integral of a vector field?
With the new-in-13.3 SurfaceIntegrate:
...
8
votes
Accepted
SphericalPlot3D of an OblateSpheroid via coordinate transformation
I'm afraid your approach is flawed. SphericalPlot3D[r,t,p] plots r[t,p], where t and ...
8
votes
Creating random configurations of spherocylinders or cylinders
Disclaimer
In the meantime, user929304 found out that my collision test is incorrect. I posted a new answer with a rather new approach.
Strategy
I use a Bag to ...
8
votes
Accepted
How does one plot a three-dimensional electric field in spherical coordinates?
Generate the TransformedField and then plot it.
...
8
votes
Calculating length of curve based on data points?
Use FindShortestTour Or ReconstructionMesh.
...
7
votes
Accepted
Does Mathematica 11 have spherical coordinate unit vectors?
Mathematica does all its computations in an orthonormal basis. You simply need to specify what coordinate system you're working in. So for your example, you just multiply by ...
7
votes
Accepted
Confused about the solution obtained from vector linearization
As mikado pointed out, this is a bug and the return value is complete nonsense. Don't invest any time in interpreting it. Better use the time and send a bug report to Wolfram Support. This appears to ...
7
votes
Accepted
Reconstructing a function from its gradients
Problems with code often require the code (or "All unhappy codes are unhappy in their own way"), but here's a somewhat complicated example that works:
...
7
votes
How is Grad defined for array particularly in non-Cartesian coordinates?
Indeed, Grad does compute the covariant derivative. This can be seen from the following example given in the documentation
In a curvilinear coordinate system, a ...
6
votes
Accepted
How do I verify a vector identity using Mathematica?
You can use FrenetSerretSystem:
FrenetSerretSystem[{x[s], y[s], z[s]}, s][[-1, -1]] //TeXForm
$\left\{\frac{y'(s) z''(s)-y''...
6
votes
Accepted
Vector calculus integration identity problem
Here's my guess:
With[{s = {x, y, z},
A = {A1, A2, A3}}, Integrate[s (s.A), s ∈ Sphere[]] ]
(* {(4 A1 π)/3, (4 A2 π)/3, (4 A3 π)/3} *)
--- or this:
...
6
votes
Accepted
How do I get actual values from a Jacobian matrix?
ClearAll[f]
f[x0_, y0_] := D[{Sqrt[x^2 + y^2], ArcTan[x, y]}, {{x, y}}] /. {x -> x0, y -> y0}
f[0.3, 0.5] // MatrixForm
I would caution you against using <...
6
votes
Accepted
Cannot derive `Norm` or `Normalize` when recreating Frenet Serret equations
Consider: T[t]
{1/Sqrt[1 + 0.04 Abs[t]^2 + 0.09 Abs[t]^4], (0.2 t)/Sqrt[
1 + 0.04 Abs[t]^2 + 0.09 Abs[t]^4], (0.3 t^2)/Sqrt[
1 + 0.04 Abs[t]^2 + 0.09 Abs[t]^4]}
...
6
votes
Accepted
6
votes
'gradient' function in MMA
If the target is just to calculate numerical gradient of a matrix rather than reproduce exactly the same behavior of gradient of MATLAB, then we can use ...
6
votes
Quadratic form derivative in Mathematica
You can use VectorSymbol and MatrixSymbol, introduced in version 14.1 as part of the Symbolic Vectors, Matrices and Arrays ...
6
votes
Calculating length of curve based on data points?
The simplest thing would be to add up the straight lines between points. But that gives a somewhat too short a length because the line is not straight but curved. A better approach seems therefore to ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
vector-calculus × 311calculus-and-analysis × 68
vector × 68
plotting × 59
differential-equations × 26
matrix × 23
symbolic × 19
tensors × 19
linear-algebra × 17
list-manipulation × 14
equation-solving × 13
coordinate-transformation × 12
physics × 11
geometry × 10
function-construction × 9
differential-geometry × 9
functions × 8
graphics3d × 8
operators × 8
mathematical-optimization × 7
homework × 7
numerical-integration × 6
simplifying-expressions × 6
numerics × 6
computational-geometry × 6