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
3 votes
5 answers
661 views

Calculating length of curve based on data points?

I had around $1000$ data points $(x,y,z)$ and when I plot them they seem to lie on a closed curve. I carefully checked the data points and the points do not repeat rather they are somewhat close to ...
user avatar
  • 171
3 votes
1 answer
87 views

Why isn't the vector field being plotted over the entire torus?

I am trying to plot a vector field over a torus. Here is my code and the image it produces: ...
user avatar
2 votes
1 answer
53 views

Solving a vector diferential equation lead to ComplexInfinity Encountered non-numerical value for a derivative at t == 0

I'm trying to solve the following Vector PDE: I implemented the following code: ...
user avatar
0 votes
0 answers
66 views

Implementing the 3D Radon transform

I am wondering how to implement the Radon transform, the 3D Radon transform, that is, given a 'density' function $f: \mathbb{R}^3\to \mathbb{R}$ The Radon transform of $f$ is $$Rf(s,w)= \int_{x\cdot w=...
user avatar
1 vote
0 answers
36 views

Using `GradientFilter[]` and `GradientOrientationFilter[]` to reproduce Matlab's `gradient()` function

In 'gradient' function in MMA, two methods are given to reproduce Matlab's gradient() function. I thought that ...
user avatar
  • 1,168
0 votes
0 answers
50 views

How to express elemental operations in matrix form?

I ran the following code: X = Array[x, {5, 4}]; W = Array[w, {4, 3}]; Y = Array[y, {5, 3}]; D[Norm[X.W-Y, "Frobenius"]^2, {W}]//MatrixForm However, mma ...
user avatar
  • 1
0 votes
0 answers
49 views

How to input a specific three-variable function into this definition?

I have the following expression: ...
user avatar
  • 101
0 votes
0 answers
47 views

Looking to compute $e^{\phi}\Delta^2 f e^{-\phi}$ in a coordinate-free way

Let $f, \phi:\mathbb{R}^n\to\mathbb{R}$ with $\phi(x)$ looking like $\phi(x)=(x+a)^2$ for some $a\in\mathbb{R}^n$. I am interested in computing $$L_\phi(f)=e^{\phi}\Delta^2 \left(e^{-\phi}\,f\right)$$ ...
user avatar
  • 101
0 votes
0 answers
43 views

Calculation of SolidAngle not recognizing region?

Basically I'm trying to calculate the solid angle of a square seen from the origin. I defined the region (in two different ways) and tried running the function but it does not give any output. Why is ...
user avatar
3 votes
2 answers
114 views

Solving an integral vectorial equation by iterations

I'm triying to solve a problem like the following: $$ \binom{f(t)}{g(t)}=\binom{f_0(t)}{g_0(t)}+\lambda\int_0^t ds\hat{A}(s)\binom{f(s)}{g(s)}, $$ where $f_0(t),g_0(t)$ and $\hat{A}(t)$ (a $2\times2$ ...
user avatar
0 votes
0 answers
41 views

Output of expressions unable to have operations be performed on the expression

I am currently trying to use the code linked in the catalog of spacetimes pdf to calculate chirstoffel symbols for a metric which follows as n := 4 ...
user avatar
  • 119
0 votes
0 answers
49 views

Algorithm: Permutations & Signature

Theoretical side Simple example: If I have two sets $A_1=\{1,3\} ,A_2=\{2,3\}$ and Permutations[{1, 2, 3}]= $\left( \begin{array}{ccc} 1 & 2 & 3 \\ 1 &...
user avatar
1 vote
1 answer
59 views

Derivative of quadratic form in NCAlgebra

I installed the NCAlgebra package in the hope that it contains enough rules for symbolic work with most branch-matrix expressions. ...
user avatar
  • 1,847
2 votes
1 answer
70 views

Inactive form for PDE and symmetry

I would like to solve the following non-linear Poisson equation (as a toy problem for a more complicated problem) ...
user avatar
3 votes
2 answers
108 views

Set of quadratic forms and linear algebra

I have a set of quadratic forms. $L_{1}=u_1^TJ_{1}u_1$ $L_{2}=u_2^TJ_{2}u_2$ $L_{3}=u_3^TJ_{3}u_3$ where $u_{i=1,2,3}$ - 3$\times$1 vector; where $J_{i=1,2,3}$ - 3$\times$3 matrix; I need to pack ...
user avatar
  • 1,847
0 votes
1 answer
91 views

How do I find the unit vector in the direction of the minimal rate of change?

A ball falls on the surface $x^4 z+x^9 y^2+y^2 z^3=65$ at the point (-1,-3,2). How do I find a three-dimensional unit vector in the direction that the ball will begin to roll. I know that the ball ...
user avatar
  • 115
1 vote
1 answer
87 views

How to compute the divergence of a four-vector?

I have a quadri-vector which is given by u = {(E^(-φ0[r]))*(1 - ε δφ[t, r]), (E^(-φ0[r])) D[ε ξ[t, r], t], 0, 0} and a quantity n which is given by <...
user avatar
0 votes
0 answers
50 views

Difference in covariant derivative and divergence?

defining polar Minkowski metric (with indecies down in polar coordinates) as gdd = {{-1, 0, 0, 0},{0, 1, 0, 0},{0, 0, r^2, 0},{0, 0, 0, r^2 Sin[\[Theta]]^2}} ...
user avatar
  • 305
0 votes
1 answer
65 views

Finding the Curvature of the path of a particle

How do I find the curvature of the vector when t=5? The function is: v[t_] := {2 t^4 + 2, 6 t^3 + 1, 3 t^2 + 4}
user avatar
  • 115
1 vote
1 answer
133 views

The square of Abs of a complex number

We all know that 4^2 + 22^2 = 500 Is there a natural way to generates 500 from the complex number ...
user avatar
  • 3,063
3 votes
1 answer
213 views

Pattern matching with two variables - derivatives on 4-vectors

I am interested in pattern matching with two variables and not just one, and more specifically implementing derivatives on 4-vectors. In the case of interest the 4-vectors have two indices; one is in ...
user avatar
  • 4,143
2 votes
2 answers
84 views

How to deduce cosine theorem with vector?

I want to prove the cosine theorem of triangles with vectors under the following assumptions: ...
user avatar
  • 1,407
0 votes
0 answers
43 views

How would you write a electric field in cylindrical coordinates?

I am new to Mathematica and I am trying to automate the process of finding electric and magnetic fields for TE and TM modes in a cylindrical superconducting cavity. I could not find documentation ...
user avatar
1 vote
1 answer
50 views

find a scalar potential function f for F so that f(0,0)=1

I need to find a scalar potential function f for F so that f(0,0)=1. a force field F(x,y) = <-Sinx,-2Cosy> First prove F is conservative Curl[F[x, y], {x, y}] ...
user avatar
0 votes
0 answers
62 views

Is it possible to generate a random vector space in Mathematica?

The idea is that I’d like to try to use Mathematica to work through proofs. So if a proof says, “Let there be a vector space V…”, I would like to see a concrete representation of that vector space in ...
user avatar
1 vote
3 answers
73 views

Drawing circles on top of a vector field drawn using VectorPlot

I am using the command VectorPlot[{{y, -x}}, {x, -4, 4}, {y, -4, 4}] to plot the vector field $\vec{V}=y\hat{i}-x\hat{j}$. On top of this, I need to draw circles of radii $1,2,3...$, etc. I am no ...
user avatar
1 vote
1 answer
93 views

Symbolic Vector calculus

Can mathematica perform symbolic vector calculus? Say I want to find $$\mathbf{v} = \mathbf{a} \exp(\mathbf{b}\cdot\mathbf{x})$$ $$\nabla \cdot \mathbf{v} = \mathbf{b}\cdot \mathbf{v}$$ If I try ...
user avatar
2 votes
1 answer
128 views

Using Curl and Grad in cylindrical coordinates gives different result than in Cartesian

I am doing a quite elementary calculation to verify $$ \vec \nabla\cdot V = \vec\nabla \times \vec A $$ Where $V$ is just some scalar function in $\rho$, $\phi$ and $z$ and $A$ is defined as $$ ...
user avatar
0 votes
1 answer
93 views

How to stack several vector plots using StreamPlot?

I would like to plot several stream plots as is in ref/StreamPlot (Mathematica 12). As is reported in the section: Generate a list of stream plots of varying [Lambda]: I did not change but it does not ...
user avatar
  • 495
0 votes
0 answers
47 views

High-dimensional second-order differential matrix equations

I am working on Lagrangian derived high-dimensional motion equations for a robot in matrix form. The structure of such an equation is known: $M(q)\ddot{q}+C(q,\dot{q})\dot{q}+G(q)=0$ where $q=[\dot{\...
user avatar
  • 1,847
0 votes
1 answer
159 views

Derivative matrix by vector in Mathematica

This is an excerpt from the article https://www.sciencedirect.com/science/article/abs/pii/S0094114X10000418. How do I write this using vector-matrix operations (...
user avatar
  • 1,847
0 votes
1 answer
73 views

Derivative of Kronecker product by vector in Mathematica

I'm struggling with the following problem. It is necessary to find the derivative expression with respect to the vector $u$: $r(u,v)=[(u-v)(u-v)^T]\begin{pmatrix} 1\\ 1\\ 1 \end{pmatrix}=[(u-v)\otimes ...
user avatar
  • 1,847
1 vote
1 answer
113 views

Quadratic form derivative in Mathematica

How to correctly differentiate quadratic form by vector in Mathematica, i.e.: $Q=\omega^T I_{p} \omega$ $\frac{dQ}{d\omega}= ??? $ ...
user avatar
  • 1,847
4 votes
2 answers
404 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 ...
user avatar
  • 1,756
1 vote
0 answers
66 views

StreamPlot works slow with analitical functions

I'm day to day user in Mathematica, that's I will be happy to any kind of help in code optimisation. So, I try to plot gradient for beatings between two laser modes and plot intensity, phase and phase ...
user avatar
  • 11
3 votes
0 answers
67 views

Excess lines in the solution plot of vector ODE [closed]

I've got an ODE system, which I attempt to solve by two ways: solving the system itself, and using vector ODE. Here is code of first way: ...
user avatar
1 vote
1 answer
229 views

how to define unit vectors in mathematica

I'm struggling a little bit trying to understand how to address this problem, I would like to do this in mathematica: is just that I don't know how to do the dot product between $\mathbf{J}$ and $\...
user avatar
0 votes
1 answer
58 views

Vector function projection raises an error

Working on ODE systems solution with NDSolve[] I decided to try to replace system of equations like: ...
user avatar
3 votes
0 answers
113 views

Summation variables aren't recognised as dummy variables

I'm trying to write this expression in Mathematica, and calculate the following quantity However, when I tried the following ...
user avatar
  • 229
0 votes
0 answers
42 views

Scaling vectors by their norm in VectorPlot3D

I'm trying to generate a 3D vector plot in which the length of the vector is really it's norm. This is my code: ...
user avatar
  • 1
3 votes
1 answer
213 views

Derivative of a norm

I learned not use the Norm[] function when computing vector derivative, so I use the dot product instead: In: D[x.x, x] Out: 1.x + x.1 What does the result mean? ...
user avatar
  • 133
5 votes
1 answer
198 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 ...
user avatar
  • 7,769
1 vote
1 answer
140 views

Problems With StreamPlot

I have the following vector functions: $$E=\left\langle \cos\left[\frac{\pi x}{5}\right]\sin\left[\frac{\pi y}{4}\right], \sin\left[\frac{\pi x}{5}\right]\cos\left[\frac{\pi y}{4}\right], \sin\left[\...
user avatar
  • 113
2 votes
0 answers
65 views

12.1 VectorPlot - How to show differing magnitudes in the new implementation

I'm graphing vector fields for a class. Magnitude is important at least initially. In 12.0 and earlier VectorPlot plotted the different magnitudes as length. In 12.1 VectorPlot represents magnitude by ...
user avatar
0 votes
0 answers
40 views

Picking elements from separate lists and multiplying them

So I'm doing some instruction items about surface integrals. I've written the following code. it calculates curl and partial derivatives of the surface. I now want to create the following function, ...
user avatar
  • 105
1 vote
1 answer
63 views

Help with code on integration

I'm trying to do a surface integral through a vector field of a disc. The problem says there is a vector field $\langle 0, y, -z\rangle$ and the disc is $x^2 + z^2 \le 1, y = 1$. The answer is $\pi$ ...
user avatar
  • 105
3 votes
1 answer
145 views

Parametric Surface Integral Boundary Code?

I am having trouble using MMA to calculate 2 parametrized surface integrals. I'd be grateful for any fixes people can offer. I usually calculate surface integrals with the following code, which works, ...
user avatar
  • 129
2 votes
3 answers
223 views

Parametric equations and eq. of tangent plane

I have written the following code to determine the equation of a plane tangent to a surface at a given point: ...
user avatar
  • 129
4 votes
1 answer
133 views

Help on center of mass code

I have reviewed questions on MMMA Stack Exchange and found no help. Here's my problem and my code, which only partially works. I can't figure out my mistake. Help? Find the mass and COM of a wire in ...
user avatar
  • 129
1 vote
1 answer
117 views

Exploring curl of a gradient of a scalar function

Suppose I want to explore $\nabla \times \nabla V$ where $V$ is some scalar function. It basically results in a zero. But I would only know why if I solve it on paper. I wanted to use Mathematica for ...
user avatar
  • 556

1
2 3 4 5 6