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
42 votes
3 answers
45k views

How to make Jacobian automatically in Mathematica

If we have two vectors, $a$ and $b$, how can I make Jacobian matrix automatically in Mathematica? $$ a=\left( \begin{array}{c} x_1^3+2x_2^2 \\ 3x_1^4+7x_2 \end{array} \right);b=\left( \begin{array}{...
George Mills's user avatar
32 votes
4 answers
26k views

Finding unit tangent, normal, and binormal vectors for a given r(t)

For my Calc III class, I need to find $T(t), N(t)$, and $B(t)$ for $t=1, 2$, and $-1$, given $r(t)=\{t,t^2,t^3\}$. I've got Mathematica, but I've never used it before and I'm not sure how to coerce ...
a98's user avatar
  • 423
25 votes
4 answers
1k views

What is the definition of Curl in Mathematica?

I have a usual mathematical background in vector and tensor calculus. I was trying to use the differential operators of Mathematica, namely Grad, ...
Hosein Rahnama's user avatar
19 votes
4 answers
7k views

How do I plot the unit normal field for a surface?

The question is pretty much in the title; I'm about to teach my multivariable calculus students about orientations on surfaces, and I would like to be able to show them pictures. Any ideas?
Paul Siegel's user avatar
19 votes
2 answers
6k views

Is it possible to do vector calculus in Mathematica?

I am trying to rearrange and manipulate some vector differential equations in Mathematica. As far as I understand you have to tell Mathematica that a variable is a vector by specifying the components ...
Holger Schmitz's user avatar
17 votes
1 answer
2k views

How can I define or use a new coordinate system?

I want to use the dipole coordinate system as defined in this paper: http://arxiv.org/abs/physics/0606044 I see that Mathematica can do all kinds of vector analysis using different kinds of ...
jvriesem's user avatar
  • 417
15 votes
2 answers
6k views

How to declare a 3D vector variable?

How can I do vector calculations without telling Mathematica the vector entries? I have very many arbitrary linear combinations in $\mathbb{R}^3$ which I want to perform some general calculations on (...
Foo Bar's user avatar
  • 335
15 votes
2 answers
7k views

How do I plot a proper streamline plot, including spacings and line endings?

Mathematica includes two nice built-in tools to visualize vector fields, VectorPlot and StreamPlot. The latter is a useful tool, ...
Emilio Pisanty's user avatar
12 votes
2 answers
1k views

Creating randomly oriented planes

I would like to create randomly oriented planes. This is how I'm attempting to do that: I create a 2 random unit vectors, $\mathbf{v}_1$, and $\mathbf{v}_2$, in the $x$-$y$ plane I assume that if I ...
BeauGeste's user avatar
  • 2,785
11 votes
1 answer
55k views

Why I get the "Set::write: "Tag Times in is Protected." error?

Why I get the error below with this code: ...
Aurelius's user avatar
  • 361
11 votes
3 answers
3k views

How to expand dot product by applying properties

I would like to expand a dot product which includes vectors $ \vec{v_1}, \vec{v_2}, \dots $ and constants $ c_1, c_2, \dots $ So that: $$ c_1 \vec{v_1} \cdot \left(c_2 \vec{v_2}+ c_3 \vec{v_3}+\dots ...
atom44's user avatar
  • 277
10 votes
3 answers
988 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 ...
user avatar
10 votes
2 answers
4k views

Singularities using VectorPlot

I am trying to plot a vector function of a fluid flow given by $\vec{V} = (\frac{-\cos(\theta)}{r^2},-\frac{\sin(\theta)}{r^2})$ I am trying to plot it in Mathematica using the command below, I ...
l3win's user avatar
  • 715
10 votes
1 answer
2k views

Dipolar magnetic field lines inside a cylinder

I'm drawing the magnetic field lines of a rotating dipole (magnetic field distorded by emission of radiation). Currently, my Mathematica 7.0 code is fully working, but I'm having a constraint which I ...
Cham's user avatar
  • 3,949
10 votes
0 answers
405 views

matrix calculus with types (similar to matrixcalculus.org) [duplicate]

Is it possible to do matrix calculus in Mathematica, like in http://www.matrixcalculus.org/ ? One of the main limitations I've found in Mathematica is that symbols are assumed to be scalars by ...
yewang's user avatar
  • 317
9 votes
1 answer
931 views

Einstein summation convention for symbolic vector calculus

I am trying to do some vector calculus in Mathematica in index notation form because it gives a clear result that can be compared to pen and paper calculations. Since there is no built in Einstein ...
Takoda's user avatar
  • 765
9 votes
0 answers
178 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 ...
user48151's user avatar
8 votes
2 answers
299 views

Confused about the solution obtained from vector linearization

I am trying to linearize a vector expression $$\frac{(\mathbf{u}+d\mathbf{u})\times(\mathbf{v}+d\mathbf{v})}{\vert(\mathbf{u}+d\mathbf{u})\times(\mathbf{v}+d\mathbf{v})\vert}$$ Here is my code ...
Di Miao's user avatar
  • 193
8 votes
2 answers
684 views

Line Integral Difficulty

I am having difficulty with the following question: Compute the line integral of $$f(x,y)=\frac{xy}{1+x+2y},$$ along the unit quarter-circle in the first quadrant from (1,0) to (0,1). My problem ...
David's user avatar
  • 14.8k
8 votes
3 answers
492 views

How is Grad defined for array particularly in non-Cartesian coordinates?

This question can be viewed as a follow-up of What is the definition of Curl in Mathematica? First argument of Grad can be an array, but what definition does ...
xzczd's user avatar
  • 62.8k
8 votes
4 answers
1k 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 ...
Tomi's user avatar
  • 4,090
8 votes
1 answer
4k views

Smoothing/Averaging 2D Vector Fields

I have a list of 2D vectors defined by {{x,y},{u,v}} and would like to smooth or average the vectors. For example here are 2 vector fields, the second has noise ...
Steve's user avatar
  • 103
8 votes
0 answers
1k views

Visualizing the Lagrange Multiplier Solution

This question is based on work in Susan Colley's Vector Calculus, 4th ed. The question is to find and classify critical points of $f(x,y,z)=3xy-4yz+5xz$ subject to the constraint $g(x,y,z)=3x+y+2z=13$...
David's user avatar
  • 14.8k
7 votes
2 answers
3k views

How to change coordinates of a differential operator?

I'm doing a basic quantum mechanics problem and am trying to learn how to do it in Mathematica. Any help would be much appreciated. $\vec{L} = \vec{x} \times \vec{p}$ where $\vec{x}$ has components:...
TaylorR137's user avatar
7 votes
1 answer
1k 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 ...
Vladimir F Героям слава's user avatar
7 votes
1 answer
2k views

Plotting a parametrically defined vector field

Let's say that you have a three dimensional surface defined by two parameters. E.g. $$ S(\theta,\phi) = \{\cos{\theta}\sin{\phi},\sin{\theta}\sin{\phi},\cos{\phi}\} $$ Additionally, you have some ...
Gavin Ridley's user avatar
6 votes
3 answers
3k 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 ...
LCFactorization's user avatar
6 votes
2 answers
467 views

How do I verify a vector identity using Mathematica?

I am trying to verify well known Frenet–Serret formulas in general setting using Mathematica. I need to consider a general space curve $r(s)=(x(s),y(s),z(s))$ in $\mathbb{R}^3$ and define its unit ...
Bumblebee's user avatar
  • 359
6 votes
1 answer
3k views

Lie-Bracket of two vector fields

I'm new to Mathematica (installed couple of hours ago) and I need to compute a few Lie brackets between two vector fields $f$ and $g$. $$ f\left(\mathbf{x}\right) = \left( \begin{array}{c} ...
Tabjones's user avatar
6 votes
3 answers
1k views

Working with abstract vectors

I often need to compute derivatives or integrals involving N-dimensional vectors (where the dimension could be equal to 2 or 3 but is not particularly relevant for the sake of the derivation). The ...
Wenzel Jakob's user avatar
6 votes
1 answer
206 views

Comparing unit normal definition in calculus with FrenetSerretSystem

I'm trying to compare the unit normal definition in calculus texts (i.e., $\vec N=\vec T'/\|\vec T'\|$) where $\vec T$ is the unit tangent vector, with the unit normal vector returned by ...
David's user avatar
  • 14.8k
6 votes
1 answer
320 views

Is there a way to add my own coordinate chart?

You all may have seen something like this: U = Laplacian[Phi, {r, theta, phi}, "Spherical"] What I want is to add my own Chart with its own coordinates, metric ...
tajimura's user avatar
5 votes
2 answers
724 views

'gradient' function in MMA

How to calculate Numerical gradient of 2D arrays using the "gradient function" ("Matlab-like")? "[___] = gradient(F,hx,hy,...,hN) specifies N spacing parameters for the ...
ABCDEMMM's user avatar
  • 1,816
5 votes
3 answers
4k views

Extrema of a function of three variables

To identify and classify the critical points of the function $f(x,y,z)=x^3+xz^2-3x^2+y^2+2z^2$, I used the Hessian matrix method. ...
David's user avatar
  • 14.8k
5 votes
1 answer
2k views

Plotting a complicated vector field

If we consider the vector $\left ( A \cdot \nabla \right) \: B$, we have in Cartesian coordinates $$\left ( A \cdot \nabla \right) \: B = \left ( A \cdot \nabla B_x \right ) e_x + \left ( A \cdot \...
yCalleecharan's user avatar
5 votes
1 answer
268 views

Finding unit tangent, normal, and binormal vectors for interpolated function

As an extension of this question, is it possible to find the unit tangent, normal, and binormal vectors for an interpolated function? eg ...
martin's user avatar
  • 8,102
5 votes
1 answer
2k 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 ...
Joshua Salazar's user avatar
5 votes
2 answers
351 views

Finding vector of same direction with smallest integer coordinates

To determine Miller Indices of crystal lattice planes I would need a stable algorithm which determines the smallest set of integer coordinates of a vector which has same direction as a given vector (e....
Rainer's user avatar
  • 2,841
5 votes
2 answers
363 views

How do I get actual values from a Jacobian matrix?

I have a Jacobian function: D[{Sqrt[x^2 + y^2], ArcTan[x, y]}, {{x, y}}] It gives me a matrix with the formulas I need for my transposition matrix: ...
Quark Soup's user avatar
  • 1,550
5 votes
1 answer
1k views

Checking if an expression is equal to zero

I have 6 points in $\mathbb R^3$ as follows: ...
Helium's user avatar
  • 4,049
5 votes
1 answer
2k views

Vector calculus integration identity problem

This is a follow up from another post. I was using the integration symbols available in the Basic Math Assistant palette. I am new to vector calculus operations. There is a known identity found in my ...
Jose Enrique Calderon's user avatar
5 votes
1 answer
309 views

Extending D for four-derivatives

I'm currently trying to consistently define rules for extending D[] to four-derivatives. As 'backend' I'm using the package TRACER (http://library.wolfram.com/infocenter/MathSource/2987/), which can ...
skalarproduktraum's user avatar
5 votes
3 answers
794 views

Explicitly construct tensor quantities with given symmetries

I am trying to use mathematica to generate explicitely a tensor. I know multiple thing about it. Let's call it $C_{\mu\nu\lambda\sigma}$. This guy has to be symmetric in the two first indices ${\mu,\...
Ezareth's user avatar
  • 349
5 votes
1 answer
581 views

Finding the attractors of the vector field constructed as the gradient of an interpolated 3D scalar field

I have a list of data existing as {{{x, y, z}, f},...} from which I construct a 3D interpolation function using Interpolation[ ]. I am able to construct a vector field from the gradient of this scalar ...
JamesFurness's user avatar
5 votes
1 answer
157 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}] -...
Ted Ersek's user avatar
  • 6,954
5 votes
1 answer
308 views

Integration over a convex combination of a region: $\int_{\Omega} (w_1 z_1 + w_2 z_2)^{1-\sigma} d (z_1, z_2)$ where $\Omega = \{ z_1 + z_2 = 1\}$

Take $w,z\in R^{n}$. I am interested in integrating (as generically if possible) $$\int_{\Omega}(w \cdot z)^{1-\sigma} d z$$ Where the domain of $\Omega$ is $1$ dimension, and includes the convex ...
jlperla's user avatar
  • 957
5 votes
0 answers
351 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 $...
user_lambda's user avatar
4 votes
3 answers
1k views

How do you show a cone inside of a sphere?

I have a sphere of radius 5 and a cone (i.e. z=√(x^2+y^2)) inside of it. I can show them separately, but I'd like to show them together. I've tried a few tricks with opacity, implicit specifications, ...
BlBl's user avatar
  • 41
4 votes
2 answers
2k views

Finding a vector field from a set of points

I have a data set of the type $\{x,y,z\}$ where $(x,y)$ is a point and $z$ is the "value" or magnitude at that point. This gives me a triangular sort of shape since $(x,y,z)$ is not defined along the ...
Eiyrioü von Kauyf's user avatar
4 votes
1 answer
248 views

Summation of Kronecker deltas should give the dimension

I have a really simple problem but I don't know how to solve it. Basically, I am doing vecor manipulation and I am summing a lot of Kronecker delta here and there. How can I teach Mathematica that for ...
Ezareth's user avatar
  • 349

1
2 3 4 5 6