# Tagged Questions

Mathematical vectors, operations on vectors and vectorized programming.

2k views

### Animating a Voronoi Diagram

edit: Excellent answers have been provided and I made an animation which is suitable for my use, however, all the examples rely on bitmap/rasterized data; is there a vector based approach? I would ...
2k views

### Visualizing vector spherical harmonics

I have painstakingly derived the vector-spherical harmonics $\mathbf{V}_{J,\,M}^\ell(\theta, \phi)$, which are the generalization of ordinary spherical harmonics $Y_\ell^m(\theta, \phi)$ to vector ...
878 views

### Make a huge vector in a wise way

I need to construct a vector similar to: v[x_]:={0, 0, x, 0, 0, 2*x, 0, 0, 3*x, ....., 0, 0, n*x}; where n=10^9. How can I ...
3k views

650 views

### Decomposing a matrix with polynomial elements into a polynomial with matrix coefficients

Let's say I have a matrix, $\mathbf{M}$, that is polynomially dependent on a single variable, such as M = {{15 + a^2, a + 5 a^2}, {a - 5 a^2, 2}} and I want to ...
3k views

### Why can't I define vector v as having subscripted elements v_1, v_2, v_3…?

I'm a very beginner in Mathematica 8 programming. While trying to play a little with tensor analysis I encountered a problem. How to define for example vector in such manner: v={$v_1,v_2,v_3$} For ...
694 views

### How to detect loops in a vector field?

Given a vector field and I'd like to detect if there are streamlines in closed patterns. For example, if the input is a vector field like this: ...
2k views

### Persistence length of a polymer chain

I'm trying to calculate the persistence length (Lp) of a polymer chain using Mathematica. The first and simplest method is to compare the EuclideanDistance between ...
4k views

### What is the cleanest way to prevent divide-by-zero warnings?

If I evaluate {1, 2, 3, 4}/{5, 6, 0, 8}, obviously I get one warning: ...
3k views

### Is it possible to do vector calculus in Mathematica?

I am trying to rearrange and manipulate some vector differential equations in Mathematica. As far as I understand you have to tell Mathematica that a variable is a vector by specifying the components ...
3k views

### How to find the magnitude of a vector?

I'm doing this exercise in Wagner's book (p.78) , and this is my attempt: ...
5k views

### How do I simplify a vector expression?

I am doing vector analysis. I have figured out that the following expression won't be simplified in Mathematica: Simplify[Dot[x, y] - Dot[y, x]] I think the ...
402 views

### VectorScale Explanation

I'm having great difficulty understanding VectorScale. Here are the definitions from the documentation. With the explicit specification ...
401 views

### “NotAvailable” and “NotApplicable” data points returned by WeatherData[]

I am trying to use ListVectorPlot in combination with WeatherData and CountryData to show ...
206 views

### Complex result for Real vectors in VectorAngle

I was expecting a real angle using VectorAngle when passing real valued vectors, but I obtained a complex angle: ...
1k views

### How to declare a 3D vector variable?

How can I do vector calculations without telling Mathematica the vector entries? I have very many arbitrary linear combinations in $\mathbb{R}^3$ which I want to perform some general calculations on (...
995 views

### Defining quantum-mechanical Bra and Ket operations

I have the following ket in the Fock basis: $\vert3, 0 ,1\rangle$, where each entry defines the number of photons in a particular mode and can take any one of the following numbers: 0, 1, 2, 3. As a ...
713 views

### How to make a point's position time-dependent given a formula for the next step?

I've made a program that is just some points on a plane. Red points are cops and green points are robbers. Each point has a vector indicating where it is going to be in the next step of $t$. Right now ...
334 views

I am trying to work with the vector notation without defining vector components explicitly. $Assumptions = (x | y | z) \[Element] Vectors[3] The vectors ... 6answers 2k views ### Vectors with a certain magnitude in Mathematica For a user-specified magnitude, is there a way to have Mathematica produce any 3D vector with that magnitude? 2answers 190 views ### How to expand dot product by applying properties I would like to expand a dot product which includes vectors$ \vec{v_1}, \vec{v_2}, \dots $and constants$ c_1, c_2, \dots $So that: $$c_1 \vec{v_1} \cdot \left(c_2 \vec{v_2}+ c_3 \vec{v_3}+\dots ... 2answers 963 views ### Integration with vector coefficients I asked this same question in Mathematics, and it was suggested I might try here. I'm more comfortable with Maple, but if I can get Mathematica to do what I'm after, so much the better. Basically I'... 2answers 737 views ### Estimation of vector autoregressive (VAR) process To estimate 1-dimensional VAR process (which is AR process) you can easily use functions EstimatedProcess or ... 1answer 2k views ### Smoothing/Averaging 2D Vector Fields I have a list of 2D vectors defined by {{x,y},{u,v}} and would like to smooth or average the vectors. For example here are 2 vector fields, the second has noise ... 2answers 1k views ### Plotting: Is anyone familiar with gradientfieldplot command? I am trying to plot this graph showing the electric field lines and lines of equipotential based off the electrode configuration(in black) of two parallel lines. This is what I've been using for other ... 2answers 187 views ### Reduce data by taking averages I am trying to implement the following: I have got two vectors x and y of unequal lengths. The length of ... 2answers 2k views ### Plotting a path in a vector field I am trying to make a visual representation of the curve y=x^{2}, with x\in\left[0,1\right] in the vector field defined by \vec{F}=\left[-y,x\right]. However, as far as I can tell there does ... 6answers 1k views ### A matrix-vector cross product I want to do a cross product involving a vector of Pauli matrices \vec \sigma = \left( {{\sigma _1},{\sigma _2},{\sigma _3}} \right); for example, \vec \sigma \times \left( {1,2,3} \right). <... 2answers 72 views ### A problem about matrix/vector extension via \tt ArrayPad Given that I have a vector and matrix as follow: vec = Array[Subscript["P", #] &, 6, 0]; mat = Array[Subscript["P", #1, #2] &, {5, 4}, {0, 0}]; And I ... 4answers 288 views ### Define Function with Sum over a list I want to define a function that would symbolically look like$$ t(s,\underline{a})=\pi s + \sum_{n=1}^{n_{max}}a_n\sin(n \pi s) $$(something like a finite Fourier series). Here s\in [0,1] and \... 2answers 830 views ### Animated Vector plot I'm trying to make an animation of a time-varying 2D vector field. However, I'm got a difficulty in that Mathematica normalises the length of the vectors with each call to ... 3answers 414 views ### How to calculate a list without loop? I have pairs of numbers {a1, b1}, {a2, b2}, {a3, b3}, ..., ... 2answers 10k views ### How to combine two vectors into a matrix by columns? I know it may sounds idiot, but I've been looking through the document, and couldn't find a way to combine two vectors say {a, b} and ... 2answers 1k views ### Plot 2D Vector function in 3D I want to plot a 2D vector function such as F(x,y) = (a(x,y),\,b(x,y)) in a 3D graph so that the vectors are embedded in the xy plane. I tried to do the following: First I defined a piecewise ... 2answers 204 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 ... 1answer 194 views ### How to use DSolve with vectors without decomposing into vector components? Given a basic, two-dimensional ballistic trajectory problem, I can solve the equations of motion using DSolve (or NDSolve) by ... 0answers 1k views ### computation of gradient vector field in 3D using GradientOrientationFilter I want to compute a 3D gradient vector field of an Image3D object using the built-in GradientOrientationFilter function in Mathematica. From the documentation I ... 5answers 356 views ### How to generalize and speed up this program? There is a vector whose length is n*m, we can part it into n sections in order. I want to define a function to compare the i-th and i+1-th section and find the minimum. The program for n=m=3 ... 2answers 236 views ### Plotting a complicated 3D wave on the surface of a sphere [duplicate] Suppose you have a vectorial wave described by a complicated function of time and cartesian coordinates t, x, y z (very simple example below) : ... 1answer 1k views ### Plotting a complicated vector field If we consider the vector \left ( A \cdot \nabla \right) \: B, we have in Cartesian coordinates$$\left ( A \cdot \nabla \right) \: B = \left ( A \cdot \nabla B_x \right ) e_x + \left ( A \cdot \... 1answer 2k views ### Visualize eigenvectors at specified points? I am very new to Mathematica and I got stuck about visualizing eigenvectors 2D and 3D. I want to visualize my largest eigenvector field of tensor data(15x15). I wrote this code for instance : ... 1answer 324 views ### Orthogonalizing without normalizing Is there a way to make Orthogonalize do the normal Gram-Schmidt procedure without normalizing the result? As far as I've understood this was possible with ... 2answers 216 views ### Is it possible to specify the direction of rotation in VectorAngle function? If I use the function VectorAngle[{1,0},{1,-1}], is it possible to obtain the angle generated by rotating around the axis counter clock wise? In other words, I would move from the first vector to the ... 1answer 712 views ### Plotting a Gravity-Field [duplicate] I try to plot a 2D gravity field or something similar in the form like$r/|r|^3\$ with the standart builtin VectorPlot function: ...
149 views

Having 4 points A (ax, ay), B (bx, by), C (cx, cy) and D ...
89 views

### random distribution vectors on cube edges

How can I put randomly eight vectors with length b into eight edges of a cube with side of a and specify them with their ...