Mathematical vectors, operations on vectors and vectorized programming.

learn more… | top users | synonyms

1
vote
1answer
54 views

Cross product of three vectors

I am following the answer of Jens from following post: How do I simplify a vector expression? vec /: Cross[vec[x_], HoldPattern[Cross[y__]]] := I want to create ...
1
vote
1answer
83 views

Draw Vectors in Spherical Shell and then Animate

I want to draw three vectors inside a spherical shell. One of the vectors will be moving, the others will be stationary. However, the animation is the next step. For now, I would like to get the ...
0
votes
0answers
30 views

Optimizing over every element in a vector [closed]

So I have a 16 element vector, called LUEigenvector, depending on a series of variables a1,a2,...b1,b2...c1,c2... All the elements depend on all the variables. I want to use NMinimize sequentially, ...
3
votes
3answers
179 views

Plot a vector field over a line

This seemingly simple problem is giving me some trouble. I need to plot a vector field on a line, and for that I'm following what I found here. I try to create a mesh that contains two points and just ...
1
vote
0answers
60 views

Given vector of function plot each of them separately?

At the moment, I am trying to plot a vector of functions which consists of the change along $x$, $y$, and $z$. Is it possible in Mathematica to give a vector of functions and plot them separately ...
3
votes
2answers
50 views

How to avoid 0 OverVector[F] to be evaluated as 0?

I am fairly new in Mathematica and I am trying to work with scalars and vectors. I decided to denote vectors using OverVector (as example, ...
1
vote
1answer
49 views

How to adjust vector scaling with a specific aspect ratio

I'm trying to create a vector plot with uniform vector scaling. I need the x and y ranges to be very different, because I need to highlight the angle between the vectors and the y=0 axis. This means ...
2
votes
4answers
117 views

How to obtain the gradient of a function as a function?

The Grad function allows me to get the gradient of a function like this: ...
4
votes
2answers
154 views

ListPlot vector 3D circle line

I got a 2D vector with the following code. ...
0
votes
2answers
41 views

Unevaluated derivatives of known functions after replacement

I want to make the following replacement work correctly: Array[(2 D[xM[[#1]][t], t] * D[xM[[#2]][t], t]) &, {3, 3}] /. {xM -> {Sin[ω t], Cos[ω t], 0}} ...
6
votes
2answers
67 views

A problem about matrix/vector extension via $\tt ArrayPad$

Given that I have a vector and matrix as follow: vec = Array[Subscript["P", #] &, 6, 0]; mat = Array[Subscript["P", #1, #2] &, {5, 4}, {0, 0}]; And I ...
0
votes
0answers
39 views

Order of evaluation for numeric functions

I'm trying to plot a 3D vector field to illustrate an electric field of a uniformly charged disk, and I used Manipulate to change the radius R of the disk to see ...
1
vote
1answer
36 views

2D vector treatment and visualisation

I'm just trying to define a set of vectors, in the Cartesian plane, draw the vectors originating from the origin $O,$ and be able to add vectors and draw the resulting vector. I've started doing ...
1
vote
1answer
86 views

Calculation of tensor structure

I would like to calculate following type of contraction: $$ P_{ij}^{p-k} P_{lm}^{k} ((p_l - k_l) \delta_{ij} + k_j \delta_{il}) (k_n \delta_{im} - p_m\delta_{in}) = ? $$ where p,k are ...
0
votes
1answer
56 views

Minimization of linear combination of vectors

Suppose I have a vectors in $\mathbb{R}^{6}$. For example, take the vector $v = k(-2,2,4,6,2,2)$. I would like to find some $k$ with the constraint that the last two components are necessarily ...
5
votes
3answers
400 views

How to calculate a list without loop?

I have pairs of numbers {a1, b1}, {a2, b2}, {a3, b3}, ..., ...
0
votes
2answers
62 views

How to evaluate function in the grid?

I have a function f[a_, b_]: = b^a + a b. a takes values {1,2,3,4}, and ...
2
votes
1answer
34 views

N-Dimensional vector from scalar

Is there a way in Mathematica to create an n-dimensional vector, where each element is a given scalar? I have tried the Array function, as the documentation center ...
2
votes
1answer
44 views

Sum of operations involving an arbitrary number of 2D vectors

I need to define an equation stating that the sum of n operations involving n 2D vectors and ...
1
vote
0answers
31 views

Piecewise in 2D with quadrants as conditions

I am trying to define a piecewise vector field. Can the condition be of the form I am using (i.e. a quadrant)? I can't also make Piecewise work with more than two ...
1
vote
1answer
87 views

Is it possible to use vectorized Plot Legend?

I upload data using the following code data = Import["L" <> # <> ".dat"] &/@{"10", "102", "103", "104"}; My function is ...
3
votes
2answers
132 views

Color vector according to angle

One can use the function VectorColorFunction in VectorPlot3d to color vectors according to their norms. How to color vectors ...
7
votes
2answers
133 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 ...
1
vote
1answer
64 views

Using the Norm Function

I am trying to take the norm of a general vector and show that for vectors, v,w, that Norm[v cross w]^2==Norm[v]^2*Norm[w]^2-(v dot w)^2 In Mathematica, here are my steps: ...
0
votes
1answer
47 views

How can I tell mathematica that $a, \space b, \space \omega$ are constants? [closed]

I want to differentiate the following vector: $$=\frac{1}{\sqrt{a^2\omega^2\sin^2(\omega t)+b^2\omega^2\cos^2(\omega t)}}\begin{pmatrix}-a \omega \sin(\omega t)\\b \omega \cos (\omega ...
2
votes
1answer
148 views

Derivatives of vectors

I have an issue with derivatives of vectors ...
0
votes
1answer
261 views

how to do VectorPlot?

I have a problem with VectorPlot for spin current density and I tried it my self but not working. Here is the code according to Jens solution: ...
0
votes
0answers
49 views

Color vectors according to a user-defined function

V[x_,z_]:=x/Sqrt[x^2+z^2]; Ex[x_,z_]=-D[V[x,z],x]; Ez[x_,z_]=-D[V[x,z],z]; The electric field components (Ex,Ez) are to be plotted as a vector field in the x-z ...
0
votes
0answers
51 views

Plotting a parameterized vector in the x-y plane

I am trying to plot the trajectory of a parachutist descending at a constant vertical rate of 8 m/s while a south wind also blows at a rate of 8 m/s. He initially jumps from a height of 300 m. I am ...
0
votes
1answer
78 views

How to I plot a vector and a line on the same graph?

For example I want to plot the vector <7, 20> on the same plot as the line {t, 6t+10}
0
votes
1answer
63 views

How to plot a linear vector tangent to a bezier surface?

I have a bezier surface and its parameters are u and v. The partial differentiation with u as variable gives me a vector in the direction of u. I need to plot this vector. I plugged in a particular ...
15
votes
5answers
573 views

Add a vector to a list of vectors

What is the syntax to add v1 to each vector in v2? I know it has to be simple, but I really have searched and not found it. ...
0
votes
1answer
146 views

Syntax::sntxf: “…” cannot be followed by “…\MatrixForm” [closed]

I'm trying to create a $3\times 1$ matrix named Pauli but I really don't understand what's the problem of the following code? ...
3
votes
1answer
75 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 ...
4
votes
1answer
76 views

random distribution vectors on cube edges

How can I put randomly eight vectors with length b into eight edges of a cube with side of a and specify them with their ...
0
votes
1answer
101 views

How to plot the position vector r(t) = 3 cos(3.3πt)i + (sin(4πt) + 4t)j with t being a min of 0 and max of 1? [closed]

Every time I try using the ParametricPlot, nothing shows up. This is what i've done so far: ParametricPlot[{[3 cos[3.3 πt]], [sin[4 πt] + 4 t]}, {t, 0, 1},
4
votes
3answers
97 views

Find six vectors with rational entries under constraints?

Define six vectors v[i] with i=1,2,3...,6. Each v[i] is six dimensional and all entries in ...
1
vote
1answer
96 views

Linear Fit of multidimensional data

I am trying to find linear decomposition of vector B (of arbitrary dimension $n$) in the form : $B = \alpha_{1} C_{1} + \alpha_{2} C_{2} + ...$ where $C_{i}$ are known vectors (of dimension $n$) ...
14
votes
2answers
618 views

How to detect loops in a vector field?

Given a vector field and I'd like to detect if there are streamlines in closed patterns. For example, if the input is a vector field like this: ...
2
votes
3answers
86 views

Making a list of functions

Suppose I have the following equation system to solve: x(t_):={x1(t),x2(t)}; DSolve[x'(t)==x(t),x(t),t] This code works fine, but now suppose that instead of 2 ...
3
votes
2answers
100 views

Creating a tube with custom caps

I need a tube with only one end capped. I can do this relatively easily with: ...
0
votes
2answers
109 views

How does one define a function that takes vectors as arguments but also derivatives?

Summary: tldr; I just want to implement a version of the following mathematics function: $$ f(a) = c_1 e^{-(a - t_1)^2} + c_2 e^{-(a - t_2)^2} + c_3 e^{-(a - t_3)^2}$$ in mathematica, and be able ...
1
vote
0answers
50 views

Transform a vector DE into a set of scalar DEs [closed]

I have the vector equality: {{a,b},{c,d}}.D[{x1[t],x2[t]},t]=={{e,f},{g,h}}.{u1[t],u2[t]} I want to solve this using DSolve. ...
2
votes
1answer
63 views

Transforming an Optimization Problem into a multi-vector Optimization Problem

I am sitting on an MultiAgent optimization problem trying to solve for a quadruple of variables {e,l,b,c} In a single agent (...
5
votes
2answers
197 views

Is it possible that we can use “+” to add two vectors in polar form?

For example, $a=(2,\pi/4)$, $b=(3,\pi/3)$, if we want to get the result of $a+b$, using + operator will not do, because mathematica will ignore the polar form, and ...
0
votes
0answers
50 views
0
votes
1answer
56 views
0
votes
2answers
92 views

vectors constructed with $0,1$ permutation

Our desire is to construct $2^N$ vectors with indices $i=1,..,2^N$ with elements by permutation of $0$ and $1$. For example ($N=3$): We write below code ...
0
votes
1answer
55 views

Designing a loop that fetches 5 random vectors each with 5 components from a set of 10 until Linear dependence is found

I am currently trying to find a way to make a loop that will select 5 random columns without replacement of a 5x10 matrix until it finds a determinant equal to 0 out of the new matrix formed by the 5 ...