Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [vector]

Mathematical vectors, operations on vectors and vectorized programming.

0
votes
0answers
57 views

Trying to plot a magnetic field of a straigth wire [closed]

I want to plot a simple vector field of a simple magnetic field of the current through a straight wire, which is given by $\qquad \overrightarrow{B}(\overrightarrow{r}) = \frac{\mu_{0}}{2\pi}\frac{I}{...
0
votes
0answers
37 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
28 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 ...
2
votes
1answer
30 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
0answers
38 views

Drawing vector fields using Mathematica

I am new to Mathematica. Please put up with my silly question. Can I draw a vector field $\vec{V}_1=\frac{\hat{r}}{r}$ and $\vec{V}_2=2\hat{\theta}$ using Mathematica? Here, $(r,\theta)$ is the plane ...
0
votes
1answer
45 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
112 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
53 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
37 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
99 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
56 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
91 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
21 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
49 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
70 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
72 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
117 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
53 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
73 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
112 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
53 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
633 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
54 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
73 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
98 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
90 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
184 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
122 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 ...
3
votes
2answers
140 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
373 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
53 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
33 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
59 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
87 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
46 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
123 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
99 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,\...
4
votes
1answer
152 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 ...
2
votes
2answers
59 views

How to write a matrix of $n\times 2$ where the first column is made of only 1's?

How to write a matrix of $n\times 2$ where the first column is made of only 1's? Suppose I have a vector x={.24,...,10}. How can I get this $\left( \begin{matrix} 1 & .24 \\ 1 & ...
1
vote
2answers
74 views

Evaluating a formula that uses summations and products of vectors

Could someone tell me how to find beta1? I have the following data: I don't know how to write beta1, and I don't find ...
0
votes
1answer
56 views

Recombining vectors after taking derivatives

I want to map two expansions order by order and to solve to get unknowns coefficient. We define $X_{\mu}= \frac{(x-y)_{\mu}}{(x-y)^2}$. The quantity I need to expand in the end is $t_{\mu\nu}= \frac{...
0
votes
1answer
82 views

Drawing several 2D vectors in one plot with labeled axes [duplicate]

I want to draw vectors just with one plot. Also, I want to label the axes. Can anybody show me how can I do it?
1
vote
2answers
249 views

Change the colors of vectors?

I'm using ListVectorPlot to draw vector fields. Is it possible to change the colors and also the types of the vectors?
4
votes
1answer
228 views

Multiplying list of matrices with vector of scalars

there are many similar threads on this forum, but none of them fixes my problem. I am trying to multiply List of Pauli Matrices with a vector of symbols (which are scalars). ...
3
votes
2answers
279 views

Plot a level curve and its gradient

Suppose that I have the following ellipse function, $f(x,y)=4x^2+y^2-5$. The gradient of this ellipse is calculated as $\nabla f(x,y)=[8x,2y]$. I know how to plot and join them. It is easy. I do ...
10
votes
3answers
491 views

Remove Abs from Norms of Vectors

I have the following norm Norm[{a, b*c}] (* Sqrt[Abs[a]^2 + Abs[b c]^2] *) How do I remove the Abs from it? ...
1
vote
1answer
88 views

Sum of vectors to follow a path [closed]

I'm working with a mathematica program where I have a matrix with the xyz coordinates of the begin and the end of a group of vectors (randomly), here is the image: How can I sum two vectors where ...
5
votes
1answer
116 views

Finding the orthogonal diagonalizing similarity of a symmetric matrix

I'm aware that there are some questions similar to this here, but none that could solve my problem. So, I have to diagonalize a symmetric symbolic matrix $m$ (to be seen below) and obtain the ...