Questions tagged [vector]

Mathematical vectors, operations on vectors and vectorized programming.

Filter by
Sorted by
Tagged with
2
votes
2answers
71 views

How to generate vectors with programming

I want to generate all possible vectors programicaly with entrys in $\Bbb Z_4$: $$A_j:=\begin{bmatrix}x_1\\ x_2\end{bmatrix}, \qquad x_i\in \{0,1,2,3\}, j=1,2,\cdots 16.$$
2
votes
1answer
60 views

Vector field Stream?

The following graph shows the vector plot. How can I plot the solid lines which represents how the vectors are spatially varying and both on the same graph (vector plot and stream field)? ...
2
votes
1answer
65 views

Inconsistent Vector Plot over Contour Plot

I am trying to plot the gradient vector field over the contour plot of a function. While the demo function seems to work very well with the demo taken from How to use vector plot and gradient vectors?...
0
votes
1answer
34 views

Functions with Variable Numbers of Arguments: Outer Vector Product

I am trying to write a function that takes a column vector of variable dimension as an input and returns the outer product matrix as an output. What I have tried: ...
0
votes
0answers
34 views

Matrix Vector multiplication [duplicate]

I have a rather simple question which surprisingly i could find the answer theres a matrix $U $ whith is $4*4$ and a vector $A$ which is $4*1$ and when I wand to multiply them by $U.A$ operator i get ...
1
vote
0answers
49 views

How to get results in terms of vector operations?

Is there a simple way to simplify an expression in terms of vector operations? For example, when I evaluate this; ...
2
votes
1answer
36 views

Functional Opacity in VectorPlot3D

I am trying to plot a vector graph such that that vectors closest to the origin are opaque, and those furthest from the origin are transparent. I have tried using opacity with a function inside of it: ...
2
votes
2answers
100 views

Flow over the circle

I'm trying to plot a vector field over a circle, Particularly the vector field in this plot: ...
0
votes
0answers
19 views

Parametrized vector function in PDE with DSolve/NDSolve

I'm trying to solve a PDE for a parameterized function $\vec x(s, t)$ where $t \in [0, T]$ and $s \in [0, T/h]$. This PDE reads as: $\frac{\partial \vec x}{\partial t} = \vec u (s, t)$, $ \vec x (s,...
3
votes
2answers
108 views

Plot vectors as sums of vectors along the axes

in a phase diagram appear vectors that go in different directions. When graphing with the "streamplot" or "vectorplot" command, only the arrows appear showing how they move away from or closer to ...
0
votes
0answers
31 views

Generate vector field pointing to minimum intensity (black)

I have a black and white image and want to plot a vector field that points to the highest and nearest minimum intensity value (something like the arrows shown in the image). Similar to Gradient filter ...
2
votes
1answer
62 views

Outer (dyadic) product between vectors of the same index in two lists

I have two lists of vectors and I want to take the outer product between elements in the lists of the same index. Using either Outer or TensorProduct works for e.g. the first two indices: ...
3
votes
1answer
56 views

One-hot vectors encoding with NetEncoder

I have a text and vocabulary (text has two "the" entries): ...
0
votes
0answers
46 views

DSolve help - List encountered within

I'm reading through a physics paper (it's for the displacement of skyrmions in a 2D lattice) and just wanted a little help in visualizing an equation that is shown: $$0=\mu \nabla^2\vec{u}+(\lambda +\...
0
votes
2answers
30 views

Piecewise vector

I need to have a vector with the length of 15000. The first 4000 elements have value 12, the next 3000 elements, that is 4001 to 7000 be 0 and the rest of it to the last be 5. I have written it with ...
3
votes
1answer
45 views

RecurrenceTable involving inputs from a vector

Directly going to the issue, my problem is how to use a RecurrenceTable when it have inputs from a vector defined previously. For instance I have: ...
0
votes
1answer
50 views

How to plot a scalar function with a vector argument? [closed]

I'm trying to take a simple dot product of two vectors and plotting it as a 3D density plot. However, I don't know how I should define the limits of the plot if the argument of the function is a ...
2
votes
1answer
115 views

Finding the tangents of the function in each mesh

I have a 2D graphic which contains a table of curves within a circular region. ...
1
vote
0answers
55 views

Mathematica Vector Integration [closed]

I am trying to symbolically integrate this function: $$ \int\mathrm dY\exp\left[\dfrac{-(Y-Y_0)\cdot\Sigma_l^{-1}\cdot(Y-Y_0)^\top-(Y-Z\cdot A^{-1})\cdot A\cdot\Sigma_d^{-1}\cdot A^\top\cdot(Y-Z\cdot ...
0
votes
1answer
42 views

Performing a simple operation with operators [closed]

I have a map defined as $\qquad \Phi(X) = a^2\, Tr[X] |0\rangle \langle 0| + b^2\, Tr[X] |1\rangle \langle 1| + a\,b\, Tr[\sigma_z X] |0\rangle \langle 1| + a\,b\, Tr[\sigma_z X] |1\rangle \langle ...
1
vote
1answer
129 views

Solving Laplace equation in spherical coordinates

I was trying to solve Laplace's equation for a spherical capacitor, which is not difficult by hand, just to figure out the commands so I can eventually try something more complicated. Then, I ran into ...
0
votes
0answers
71 views

Curl in Polar Coordinates

I was trying to figure out Curl in other coordinates. The Curl documentation (https://reference.wolfram.com/language/ref/Curl.html ) didn't really say how Mathematica interpreted the input. Anyway, I ...
1
vote
2answers
119 views

How to add a vector variable to a vector value?

If we have a three dimensional vector variable: $Assumptions = a ∈ Vectors[3]; and a three dimensional vector value for example: ...
1
vote
0answers
23 views

Text misalignment in vector graphic format export

In converting a number of old notebooks into a format for e-readers, Mathematica has some issues with vector formats. SVG export would have been ideal to use, but the exporter fails to recognize, for ...
1
vote
2answers
50 views

How to define multivariable vector funtion? [closed]

I would like to define a function of variables having two components as $u(x,y) = (f(x,y),g(x,y))$. I defined such a function as u[x_, y_] := {f[x, y], g[x, y]} ...
1
vote
2answers
80 views

How to make a 1D VectorPlot

I am trying to use VectorPlot to produce a 1 dimensional vector plot. I Have tried using VectorPoints->{10,1} but it produces ...
4
votes
2answers
76 views

ProbabilityDistribution with variable number of dimensions

I would like to construct a ProbabilityDistribution with a variable number of dimensions. I tried to use $Assumptions = x ∈ Vectors[d, Reals] so that the variable <...
1
vote
2answers
132 views

Multivariate series for approximating implicit system

I'm trying to approximate the solution of an implicit set of equations by means of a Taylor series. I have managed to do so for a solution expressed in terms of a single independent variable, by using ...
2
votes
2answers
60 views

Normalize a vector: error [duplicate]

I have this simple example in which I am trying to write a column vector (ket vector) and then I want to normalize it. It seems that ther is something wrong, leading to an error message "The first ...
0
votes
0answers
18 views

Multiplication of Two Vectors Not working correctly [duplicate]

I am trying to simply multiply a 1x2 vector by its transpose however Mathematica is not performing this action correctly. When I change to 2x2 matrices the multiplication works correctly however. My ...
-1
votes
1answer
75 views

How can I calculate the time-series of a vector?

I need to calculate a time-series of the vector $\|\theta(t)\|=2.2^{-t}\|v(t)\|$ where $t$ for 10 time-steps. I was thinking of expressing the vector as a list of functions, and then the functions ...
0
votes
0answers
116 views

Why can't Nsolve find the solutions for my equations?

I have a problem using NSolve in my Mathematica code. In my Code NSolve should find a value for qw, but it won't. The strange ...
1
vote
2answers
68 views

Find n-roots of unity and put them in vector [closed]

Assume you want to find all roots of n-unity and then you want to put them in a vector. I tried to find all the roots of unity this way: Solve(z^n==1,z) But now ...
7
votes
1answer
638 views

Can we turn this for loop into a more elegant Mathematica code?

I am coding stuff manipulating indirection arrays and I have some code like: ...
0
votes
0answers
55 views

Why am I getting results containing Re and Conjugate?

Using the matrix Ham4LVLReg1, I am trying to get four vectors. Initially, I got the eigenvectors, and then, I computed the eigenvectors ...
1
vote
2answers
83 views

Joining $4 \times 1$ vectors defined through functions to form a $4 \times n$ matrix

I define a $4x1 $column vector through a variable as: Z[i_]:=List[{a[i]},{b[i]},{c[i]},{d[i]}] I then want to make a $4\times n$ matrix by joining a specified ...
0
votes
2answers
139 views

What's wrong with this cross product of two vectors? [closed]

x = {{a},{b},{c}}; y = {{d},{e},{f}}; Cross[x,y] Whe trying to evaluate this expression, I get the error ...
0
votes
2answers
92 views

Verifying equality $ (\vec a \times \vec b)^2 = \left| \vec a \times \vec b \right| ^2 $

I'm trying to verify the equality $ (\vec a \times \vec b)^2 = \left| \vec a \times \vec b \right| ^2 $ in Mathematica. How can I do it? Thank you for your time.
2
votes
1answer
233 views

Plotting Vectors in Mathematica

I'm trying to plot 2D vectors in Mathematica. Built in functions don't really work for me because I want to plot vectors of matrices from the origin to the their coordinates with an arrow on their ...
3
votes
3answers
145 views

using DeleteCases to delete vectors with particular index as 0

Assume I have a set of vectors set = {{0,1,1,0,1}, {1,0,1,1,1}, {1,1,1,1,0},{1,0,0,1,0}}. I want to delete the vectors which have the last entry as 0. In the ...
4
votes
2answers
172 views

Animating a Vector Field

I am trying to create animations of a time dependent vector field $\vec v(t,x,y)$. The problem is that VectorPlot scales the vectors for each time $ t $ separately ...
1
vote
2answers
431 views

Orthogonal Projection of vector onto plane

I'm currently trying to learn Mathematica, and I've got some linear algebra tasks to solve with it. I've gotten quite far but now I'm stuck on this one exercise. The instructions are: With the help ...
-1
votes
1answer
55 views

Plotting Base-vectors not working properly [closed]

I'm stuck on a issue that I can't seem to solve. After defining values for V, W and x, I'm supposed to Plot two base-vectors in the base V and with the vector x in the same picture. I'm supposed to ...
0
votes
1answer
35 views

VectorPlot not showing up after switching computers

So typed the below code into my personal computer and it worked just fine. I then moved the file to my work computer so I could look at it there, and now VectorPlot comes up blank. I am not sure if ...
1
vote
1answer
62 views

What is the best way to compute the set of vectors normal to a given one?

For 2D vectors, computing the vector orthogonal to a given $v$ is straightforwardly done using Cross, as for example shown here. However, ...
1
vote
1answer
65 views

Calculate angle between skew vectors

I want to use Mathematica to calculate the angle between two vectors (say a and b) that don't lie in the same plane. The vectors ...
2
votes
1answer
110 views

3 dimensional vector representation with Hue color data

I am trying to represent 3-dimensional vectors in a 3-dimensional space. In my field, there is a common color coding (color wheel) as in the picture. For (vx,vy,vz) vectors: (0,0,1) is white, (0,0,-...
1
vote
1answer
49 views

Representing 3D vectors, manipulating them, and identifying symmetry operations [closed]

I am sure this is relatively straightforward, but I feel like I am missing some basic knowledge to let me find the answer. I have a list of 3D vectors not (necessarily) originating at the origin. ...
2
votes
2answers
127 views

Problem verifying expression with 3D vectors

I am unable to verify that my vector expressions are equivalent. I want it to say true or false. ...
4
votes
2answers
124 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,\...