The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [vector]

Mathematical vectors, operations on vectors and vectorized programming.

Filter by
Sorted by
Tagged with
0
votes
0answers
23 views

How to select multi vectors with particular condition

I have a matrix as: a01={{225., 1, 2, 3, 4}, {225.5, 2, 3, 4, 5}, {226., 3, 4, 5, 6}, {226.5, 4,5,6,7}} And I want to choose head: ...
0
votes
1answer
27 views

Independent scaling of arrowheads and vectors in vector plot

I'd like to scale with independent parameters the vectors and the corresponding arrowheads in a vector plot. The basic code is as follows: ...
0
votes
0answers
56 views

How I can plot Vector3DPlot?

I want to reproduce the vector 3D plots as shown in the figure. It's in spherical polar coordinates (i.e. vector 3D plot on plane). The angle [Theta] is spherical coordinate is determined by the ...
0
votes
0answers
39 views

Vector field of point charges [duplicate]

I need help in plotting vector field or stream field. Can you please help me to plot electric field of these 13points standing on a circle which are all positive with same magnitude. The code for this ...
1
vote
2answers
143 views

Vector field of charges

I wanted to plot vector field of 12 positive charges Standing in a circular way with a positive charge at the center all same magnitude. I do not know how to start. Can you please help me Thanks.
0
votes
1answer
38 views

Convert input word into vector matrix

I wold like some help of converting an input (word or number or mix) into a single row vector, such as the following: If input is ">DAVID123<" I want it to be as {>,D,A,V,I,D,1,2,3,<} where ...
1
vote
0answers
39 views

VectorPlot interval as a union of intervals

What would you suggest me to do if I want to use VectorPlot in a certain region of a plane? e.g.: ...
2
votes
1answer
67 views

Including legend with reference magnitude in a VectorPlot

I'd like to plot a vector field with a legend for the magnitude of a reference vector. I have read all the document of VectorPlot and found only ...
7
votes
0answers
41 views

VectorPlot not localizing variables

Is this a bug or not? u = {{}}; VectorPlot[{1, u^2}, {u, 0, 1}, {z, 0, 0.4}] The VectorPlot works fine if ...
2
votes
2answers
79 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
85 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
71 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
51 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
40 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
107 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
112 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
32 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
83 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
60 views

One-hot vectors encoding with NetEncoder

I have a text and vocabulary (text has two "the" entries): ...
0
votes
0answers
55 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
48 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
67 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
117 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
58 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
43 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
177 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
77 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
148 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
26 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
51 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
99 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
77 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
134 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
68 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
77 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
84 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
640 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
56 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
84 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
253 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
350 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
157 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
197 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 ...