Questions tagged [vector]

Mathematical vectors, operations on vectors and vectorized programming.

Filter by
Sorted by
Tagged with
1
vote
1answer
98 views

Plot a sum of vectors using inline free format or wolframalpha. What is the hidden code?

Using Wolframalpha or inline free format you can obtain a nice representation of a sum of vectors. An example is shown below. Whish is the hidden code? (or a code that make the same representation). ...
0
votes
0answers
54 views

piecewise vector field and composition of piecewise functions

I have the following vector field ...
0
votes
2answers
39 views

FindRoot with vector function

I have trouble with FindRoot for vector variables, I have search MMA SE find a solution. in Szabolcs‘s code, Vector FindRoot ...
1
vote
1answer
53 views

Why doesn't my code evaluate element of a vector at a given t?

I have written a code to solve the Shrodinger equation for a particular three level siystem in two ways: the first way I defined three functions C1[t], C2[t], C3[t] and I solved three ODEs; the ...
1
vote
1answer
44 views

Interpolate function against time

I have two vectors called lammdaWind11 and timeWind11. They are of size 51*1. I have interpolted each one independently as ...
0
votes
0answers
33 views

velocity four-vector definition by xAct

I want to define the velocity vector by the following relation and evaluate the norm of the vector by using the Minkowski metric. I have defined the tensor x (position tensor) in xAct, but I don't ...
0
votes
0answers
55 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 ...
1
vote
1answer
99 views

VectorScaling on VectorPlot produces vectors of wrong length

I'm trying to plot the following VectorField: VectorPlot[{x/Sqrt[x^2 + y^2], y/Sqrt[x^2 + y^2]}, {x, -5, 5}, {y, -5, 5}] I want to use a VectorScaling-option such ...
0
votes
1answer
44 views

Plotting two vector fields $\vec V_1=-y\hat i+x \hat j$ and $\vec V_1=2\vec V_1$ on the same plot

I want to compare how two vector fields $\vec V_1=-y\hat i+x \hat j$ and $\vec V_1=2\vec V_1=2(-y\hat i+x \hat j)$ various concentric circles $x^2+y^2=a^2$ with $a^2=1,2,3$ etc. I can plot them ...
26
votes
7answers
2k views

Add a vector to a list of vectors

What is the syntax to add a vector v1 to each vector in a list of vectors v2? I know it has to be simple, but I really have ...
1
vote
3answers
60 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 ...
0
votes
2answers
81 views

How to find a matrix satisfying following equation

I have a $N \times 1$ vector $F(t)$ for $0\leq t \leq 1$. I want to find a $N\times N$ Matrix $C$ (a real-valued matrix) satisfying the following equation: $$\int_0^t F(t_0)dt_0= C.F(t)$$ If it ...
3
votes
0answers
52 views

Using ColorFunction Rasterizes the plot

When I make a simple plot using ColorFunction, the Mathematica rasterize the plot. Is anyone else having this issue? Does anyone know a way to avoid this? ...
2
votes
1answer
225 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 ...
1
vote
1answer
99 views

how to rotate a 3D vector around arbitrary axis

I have three vectors red, blue, and green and their origins are at (x,y,z) where red and blue are perpendicular and can be rotated together in the x-y plane by ...
1
vote
1answer
38 views

Generate a normalized Haar-random vector

What is the procedure to generate a random qutrit quantum state? That is, I want to generate a $3 \times 1$ vector $u$ such that $u$ is generated by a Haar random $3 \times 3$ unitary $U$ multiplied ...
1
vote
4answers
86 views

multi-dimensional interpolating function evaluation and extract dimension

I have an interpolating function which output dimension is greater than 1, so it's a vector. I get it as the result of a NDSolveValue. The problem is that I'm not able to Evaluate it. I would obtain ...
2
votes
1answer
77 views

Plotting list data of cross product of field vectors

I have some experimental data points of electric Ey(t, value) and magnetic field Hz(t, value). I am trying to calculate the ...
1
vote
1answer
44 views

How to make a vector of elements the pattern of a function?

if I have an expression that contains a lot of symbolic elements and I would want to make it a function of the vector containing all the elements I've found a solution based on rule delayed: ...
3
votes
1answer
48 views

Plotting translated vector fields from user-defined functions

I have two time- and space-dependent vector fields, one which is: $\mathbf A(x,y,t) = -y \, t \, \hat{\mathbf x} + x \, t \, \hat{\mathbf y}, \tag 1$ and another $\mathbf B(x,y,t)$ which is $\mathbf A$...
1
vote
1answer
145 views

Import OVF 2.0 Vector field files

I'm using a simulation software (mumax3) which outputs OVF_2.0 files. It can either export binary or text files. The binary files are usually much smaller than the text files. I would like to use the ...
0
votes
2answers
97 views

How can I create and plot (in the same diagram) 1000 different vectors in Mathematica?

I'm new to Mathematica and I got stuck. Also, I'm not a programmer, so I would like to ask the following question. I want to make 1000 different vectors, of which everyone contains 55 random elements. ...
0
votes
0answers
31 views

How To Define Indexed Vectors

I have to define two 2-D vectors to be multiplied by a matrix and multiplied by several Clebsch-Gordan coefficients. Below are my definitions and my attempt at computing the sum. ...
0
votes
0answers
30 views

Looking for a starting point to solve a PDE with vector-coefficients

I am looking for a good source for Mathematica in order to solve a PDE with vector coefficients. I have found this: https://reference.wolfram.com/language/FEMDocumentation/tutorial/SolvingPDEwithFEM....
0
votes
1answer
45 views

How do I set an element of an already-defined vector function to some expression?

I'm defining a vector whose elements depend on time, i.e. I'm defining a real vector function of real elements that depend on the real scalar time variable. The vector function is named ...
2
votes
0answers
64 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 $$ ...
7
votes
2answers
189 views

Imposing breaks in contours in a ContourPlot without rasterization

In this question, we are asked to compute breaks in the contours of a ContourPlot so as to place contour labels (values) atop the colored boundaries rather than the ...
2
votes
3answers
172 views

add columns of list {a0,b0} to columns of list {{a0,b0} ,{a1,b1} ,{a2,b2} ...{ax,bx} } [closed]

If I want to add the columns of {1,2} to each of the columns of say {{1,2},{3,2},{4,2}} resulting in {{2, 4}, {4, 4}, {5, 4}} How would I do this? and for any ...
0
votes
0answers
41 views

Steam plotting of vector field showing empty output

I am trying to plot the stream lines for a vector field function, whose definition is exported to the wdx file uploaded here. The following simple code returns an empty plot: ...
1
vote
0answers
52 views

Grouping vectors into groups of 3 by attribute

Three groups are given, each with eight $3 \times3$-vectors: ...
6
votes
2answers
455 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 ...
4
votes
4answers
212 views

Is there an easy way to copy a TableForm column and convert it into a vector?

Is there an easy way to take a column output from a TableForm command, like this: ...
0
votes
1answer
77 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 (...
0
votes
1answer
46 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 ...
4
votes
2answers
235 views

Generate 3 dimensional random vectors

How can one generate a random vector $v=[v_1, v_2, v_3]^T$ satisfying $\sqrt{v_1v_1^* + v_2 v_2^* + v_3 v_3^*} = 1$, where $T$ and $*$ denote the transpose and complex-conjugate, respectively?
2
votes
1answer
97 views

how to solve matrix differential equation using Mathematica

I have to solve $[m]x''+[c]x'+[k]x=[p]$ where x is function of $t$ after defining $[m],[c],[k]$ and $[p]$ in mathematica and x[t_]={x1[t],x2[t],x3[t]} I am using ...
2
votes
2answers
61 views

How can I store vectors in a matrix

I am triying to generate realizations of a Gaussian random process using the KL expansion. For that, I need to multiply an eigenvector for an eigenvalue and a random variable. I have tried ...
3
votes
0answers
66 views

How to digitize a vector field?

Is there some way that I can digitize both the direction and the magnitude of a vector field accessible in JPEG format? To clarify what I mean, I want to have the numerical value of: 1)magnitude and 2)...
1
vote
0answers
49 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 ...
3
votes
2answers
115 views

Normal to surface spanned by 2 vectors [closed]

I am trying to get the normal to a surface spanned by 2 vectors, but am getting an incorrect result. ...
1
vote
0answers
27 views

How to output divergence or gradient of a symbol in the form of partial derivatives? [closed]

As being new to divergence and gradient operators, I am trying to make them more readable, so could anyone tell me how can I output the divergence of u={{ux},{uy},{uz}} in the form of partial ...
0
votes
1answer
21 views

How can I make the vectors (vector heads) larger in a StreamPlot?

In my StreamPlots, the vectors can hardly be seen, in particular, since the heads of the vectors are so small. Can I change this? Example: ...
0
votes
1answer
68 views

How to generate vector field of $y'+2y=x^2 e^{-2x}$

I'm trying to generate the vector field of $y'+2y=x^2 e^{-2x}$ using VectorPlot. How should I do this? Thanks
2
votes
0answers
37 views

Basic simplifications in vector algebra [closed]

Newish Mathematica user here! I just learned about the built-in vector type. To experiment with it I tried to specify that $a,b\in\mathbb{R}^3$ and I hoped that Mathematica would simplify $(2a+3b)\...
0
votes
0answers
53 views

How do I flip one of my loops of current to be in the other direction?

I'm new to Mathematica and I have two loops of current that are both going in the same direction, but I want to flip them so that they go in opposite directions... I can't figure out where I'm going ...
3
votes
1answer
79 views

Command to make all items on the list functions dependent on a given set of variables

The title basically. A typical example is the co-ordinates of a particle, and I want to introduce time dependence to define it's trajectory. For example, if I have ...
1
vote
2answers
57 views

Converting a vector of expressions into functions with the index being an input

I am trying to generate a list of functions from a vector of expressions. I have the list $H=[1,x,x^2+1,3x^3+2x,4x^2+2x]$ and I want to define a function $f$ using two inputs such that $f(n,x)$ ...
1
vote
2answers
105 views

How do I display magnetic field lines in 2D/3D with a stick of current?

I'm new to Mathematica (trying it out for an electromagnetism course) and struggling with plotting magnetic field lines using a line of current. Not a torturous, not a cylinder, not a circle. A line. ...
3
votes
0answers
65 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: ...
0
votes
1answer
54 views

Vector function projection raises an error

Working on ODE systems solution with NDSolve[] I decided to try to replace system of equations like: ...

1
2 3 4 5
12