# Questions tagged [vector]

Mathematical vectors, operations on vectors and vectorized programming.

561 questions
Filter by
Sorted by
Tagged with
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). ...
54 views

### piecewise vector field and composition of piecewise functions

I have the following vector field ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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? ...
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 ...
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 ...
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 ...
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 ...
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 ...
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: ...
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$...
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 ...
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. ...
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. ...
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....
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 ...
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  ...
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 ...
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 ...
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: ...
52 views

### Grouping vectors into groups of 3 by attribute

Three groups are given, each with eight $3 \times3$-vectors: ...
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 ...
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: ...
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 (...
46 views

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 ...
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 ...
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)$ ...
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. ...