# Tag Info

## Hot answers tagged vector-calculus

33

Mathematica wouldn't be much helpful if one applied only formulae calculated by hand. Here we demonstrate how to calculate the desired geometric objects with the system having a definition of the curve r[t] : r[t_] := {t, t^2, t^3} now we call uT the unit tangent vector to r[t]. Since we'd like it only for real parameters we add an assumption to Simplify ...

28

The easiest way to get the Jacobian is D[a,{b}] To get the format of a matrix, you would do MatrixForm[D[f, {x}], or D[f, {x}]//MatrixForm, as the comment by azdahak says. There is no special matrix type in MMA - it's internally always stored as a list of lists. Edit Since this question is partly about the format of the matrix and its elements, I ...

16

The easiest thing to do is differentiate the field and use VectorPlot3D and ContourPlot3D to show orthogonality of these. This is from Documentation Center. I will change this a bit from original to polish graphics for your lecture. These are not unit vectors though - do u really need unit ones? It can be done too if you need. Use a contour plot to ...

15

Here is the Mathematica proof. I'll leave out the prefactor $\hbar/i$ for simplicity. Also, in case this is a homework problem, I decided not to add too many comments to the code. Instead I'll let you figure it out. The basic idea is to do cross products and gradients in spherical coordinates. The calculation shown here actually gives you a way to calculate ...

14

Assuming that we have three-dimensional real vectors : $Assumptions = (u | v | w) ∈ Vectors[3, Reals]; we can use e.g. various tensor functions (new in ver. 9) e.g. TensorReduce to reduce (simplify) a tensor expression, e.g. TensorReduce[ v.v + w.w - (v + w).(v + w) ] TensorReduce[u \[Cross] (v \[Cross] w) ] -2 v.w -w u.v + v u.w We can perform ... 12 See: Jacobian matrix The Jacobian matrix and determinant can be computed using the Mathematica commands: JacobianMatrix[f_List?VectorQ, x_List] := Outer[D, f, x] /; Equal@@(Dimensions/@{f,x}) JacobianDeterminant[f_List?VectorQ, x_List] := Det[JacobianMatrix[f, x]] /; Equal @@ (Dimensions /@ {f, x}) Some additional info. a = {x1^3 + ... 10 Let's start with a parametrized surface. Any one will do, but I guess being orientable helps in this case. Then calculate the unit normal, and then create a Manipulate object that lets you see how the normal behaves: σ[u_, v_] := {(2 + Cos[v]) Cos[u], (2 + Cos[v]) Sin[u], Sin[v]} n[u_, v_] := Evaluate[Normalize[ Cross[D[σ[u, v], u], D[σ[u, v], v]] ]] ... 10 Why don't you pick a random vector on the sphere to be your first vector, instead of$\mathbf{n}$, and then pick a random uniform number between$0$and$2 \pi$to orient the second vector aronud the first? Something like this, assuming you have your function randomVectorOnUnitSphere[] already (haven't tested it) generateRandomPositioning[v1_, v2_] := ... 10 Enjoy it! Graphics3D[{ {Lighter[Brown], Cone[{{0, 0, 0}, {0, 0, -1}}, .25]}, {Yellow, Sphere[{0, 0, .1}, .25]}, {Pink, Sphere[{.15, 0, .2}, .26]}, {Orange, Sphere[{-.1, 0, .25}, .25]} }, Boxed -> False] 10 Observe that even when the tangent vector$r'(t)$is not normalized, it is still a linear combination of$T(t)$and$N(t)$. Thus--operating under the usual assumptions that$r'$and$r''$exist and are linearly independent--all we have to do is make an orthonormal frame out of$r'(t)$and$r''(t)$(which is very much in the spirit of the entire proceeding). ... 10 Thank you for your interest. I would strongly recommend against trying to modify SymbolicTensorsCoordinateChartDataDumpmappingInfo. It is a very low level function and any changes you make are unlikely to work. There are two sets of operations commonly needed with alternate coordinate systems. One is calculus in the coordinate system - Grad, Div, Curl ... 10 The main issue is simply that your constraint should not be imposed after the integration of the field lines, but beforehand. This means that we should choose the starting points from which the differential equations of the field lines are integrated to lie on the desired cylinder right from the beginning. Then, all you have to do is to impose the ... 9 The answer depends a lot on what you mean by "doing" vector calculus. You want results to be displayed without using component notation, and that's in general a difficult thing to achieve. A prerequisite about doing completely symbolic vector calculus is to define the simplification rules. But even in "non-vector" algebra it's often hard to get Simplify to ... 9 Let us first define the vector field A = {10 x, 20 y^3, 30 z}; and load the vector analysis package: << VectorAnalysis SetCoordinates[Cartesian[x, y, z]]; Now let's define$A\cdot \nabla A$field = (A.Grad[#]) & /@ A (* ==> {100 x, 1200 y^5, 900 z} *) and plot both fields: pl1 = VectorPlot3D[A, {x, 0, 1}, {y, 0, 1}, {z, 0, 1}, ... 9 You can make use of option VectorScale - see the "More Information" section, and some singular examples at the end. Setting None will cause all the vectors to have the same length. Or you can improvise with a custom function to make the best view of the arrows (#5 the fifth argument is vector's norm): VectorPlot[{-(x/(x^2 + y^2)^(3/2)), -(y/(x^2 + ... 8 It isn't too hard to roll your own routine, of course: UnitNormalVector[f_, {u_, u0_}, {v_, v0_}] := Block[{f0, g0}, f0 = f /. {u -> u0, v -> v0}; g0 = Transpose[D[f, {{u, v}}] /. {u -> u0, v -> v0}]; Arrow[{f0, f0 + Normalize[Cross @@ g0]}]] (* Möbius strip *) mobius[u_, v_] := {(3 + ... 8 You can plot the surface and the vector fields separately and then combine them together. Here is an example. Consider the spherical radius r can be written as function$r(\theta,\phi)$: mysurface[θ_, ϕ_] = FullSimplify[Re[SphericalHarmonicY[3, 2, θ, ϕ]], Assumptions -> {θ ∈ Reals, ϕ ∈ Reals}] (* 1/4 Sqrt[105/(2 π)] Cos[θ] Cos[2 ϕ] Sin[θ]^2 *) ... 7 There are different ways to do this. The easiest, I think, is to use DerivativeFilter: data = Table[Sin[x]*Cos[y], {x, 0, 2 Pi, 0.2}, {y, 0, 2 Pi, 0.2}]; gradFilter[data_] := Module[{n = ArrayDepth[data]}, MapThread[List, Table[DerivativeFilter[data, UnitVector[n, i]], {i, n}], n]] ListVectorPlot[gradFilter[data]] I made this independent of ... 7 How about this?: Evaluate@Grad[#1 + #2^2, {#1, #2}] & (* {1, 2 #2} & *) Or for pure obfuscatory fun: I'd like to reinstate to my first answer (see edit history), Evaluate@Grad[#1 + #2^2 &[#1, #2], {#1, #2}] & even though #1 + #2^2 &[#1, #2], which equals #1 + #2^2 and seemed redundant, because it has the right general form, ... 7 Here is how I'd do it. First, let's write a function that generates the plane stress PDE: << NDSolveFEM` ClearAll[PlaneStress]; PlaneStress[{Y_, nu_}, {u_, v_}, X : {x_, y_}] := Module[{pStress}, pStress = -Y/(1 - nu^2)*{{{{1, 0}, {0, (1 - nu)/2}}, {{0, nu}, {(1 - nu)/2, 0}}}, {{{0, (1 - nu)/2}, {nu, 0}}, {{(1 - nu)/2, 0}, {0, ... 6 This is mainly an answer to your last question, but I think it will help with your other ones. I assume you know that the$T$function is vector valued, and that is what you want. To substitute in a specific value of$t$, you probably want replacement rules, specifically the ReplaceAll (/.) construct. For example, if you had defined your expression$T(t)\$ ...

6

Any time you try to execute a command of the form a*b=c, you'll generate this error: Of course, that's exactly what you've done in your last line: ρ Dt[v, t] = -Gradient[p] + μ Laplacian[v] + f We can see the issue more clearly if we examine the left side of the equation in FullForm FullForm[a*b] (* Out: Times[a,b] *) Furthermore, Times is ...

6

Well, I had worked out an answer to the question of how to tell if the six points were coplanar: MatrixRank[ Simplify[# - points[[1]] & /@ points, a > 0 && b > 0 && c > 0 && n > 0], ZeroTest -> (Expand@PowerExpand@# == 0 &)] (* 2 *) So they are coplanar. But now the question has changed somewhat, ...

6

Mathematica 10 provides new functionality dealing with curves, (see e.g. the Vector Analysis tutorial) like ArcLength, ArcCurvature and especially FrenetSerretSystem: FrenetSerretSystem[{ x1, ..., xn}, t] gives the generalized curvatures and Frenet-Serret basis for the parametric curve x[t] i.e. it returns {{ k1, ..., k(n-1)}, { e1, ..., en}}, where ki ...

6

Our package VEST (Vector Einstein Summation Tools) is designed to do exactly this. It's described here and can be downloaded from github along with a tutorial. I realize this question is now very old, but thought this answer might be helpful for others looking for similar capability.

6

Being an anti-obfuscatorian by nature, I recommend f[x_, y_] = Grad[Function[{x, y}, x + y^2][x, y], {x, y}]; or g[x_, y_] = Grad[#1 + #2^2 &[x, y], {x, y}]; Then Through[{f, g}[u, v]] {{1, 2 v}, {1, 2 v}}

6

As already mentioned in a comment this limit does not exist without saying more about the way you'd like to approach the point {0,0}. First of all, I shall take the y^2 in the numerator seriously and not as mistyped y^4. The 3D plot already shows the problem: in the vicinity of {0,0} the function is not continuous Plot3D[f, {x, -1, 1}, {y, -1, 1}] In ...

5

You have some extra brackets { } that are causing your answer to have the wrong dimensions. f = {x3, x4, -(2 m2 x2 x3 x4 + g Cos[x1] (m2 x2 + m1 r))/(m2 x2^2 + m1 r^2 + J1 + J2), x2 x3^2 - g Sin[x1]} x = {x1, x2, x3, x4} jf = D[f, {x}] jf // MatrixForm Then you get a matrix jf that's 4 by 4

5

There are many ways to de-noise data. A simple one is to use one of the built-in filters. For example here I've applied the MeanFilter separately to the x and y dimensions of the data points that make up the arrows (i.e., your noisydata). This is sensible because your points lie on a regular grid. args = noisydata[[All, 1]]; datVals1 = ...

Only top voted, non community-wiki answers of a minimum length are eligible