Questions tagged [vector]

Mathematical vectors, operations on vectors and vectorized programming.

Filter by
Sorted by
Tagged with
15
votes
6answers
4k 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?
19
votes
2answers
6k 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 ...
11
votes
4answers
11k 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 ...
9
votes
3answers
993 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: ...
27
votes
3answers
6k views

Visualizing a Complex Vector Field near Poles

I've been playing around with a visualization technique for complex functions where one views the function $f: \mathbb{C} \rightarrow \mathbb{C}$ as the vector field $f: \mathbb{R^2} \rightarrow \...
3
votes
2answers
3k views

Using the epsilon tensor in Mathematica

I'm having a great deal of trouble getting started on a weekly homework assignment in Mathematica. The assignment requires we use the epsilon tensor which is apparently built into Mathematica as ...
7
votes
2answers
1k views

NDSolve with vector function

(Possible duplicate yet I still can't understand.) Basic 2D revolving around origin: ...
9
votes
1answer
1k views

How to define an orthogonal basis in the right way?

I am trying to work with the vector notation without defining vector components explicitly. $Assumptions = (x | y | z) \[Element] Vectors[3] The vectors ...
17
votes
5answers
1k 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 ...
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 ...
14
votes
2answers
2k views

VectorScale Explanation

I'm having great difficulty understanding VectorScale. Here are the definitions from the documentation. With the explicit specification ...
32
votes
2answers
4k 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 ...
13
votes
2answers
5k 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 (...
16
votes
2answers
5k views

How to represent and manipulate abstract indexed vector (or tensor) expressions?

I have a couple abstract indexed quantities, both differential elements $dx = dx^\mu e_\mu + x^\mu de_\mu$ $du = du^\mu e_\mu + u^\mu de_\mu$ I can compute the expression $(dx + du) \cdot (dx + du) ...
10
votes
2answers
9k 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 ...
5
votes
1answer
2k views

Making a ListVectorPlot3D from data in an external file

I have a .dat file with six columns: {x y z vx vy vz}, where x, y, z are space coordinates and vx, vy, vz are the vector components. How can I use this file to get ...
6
votes
2answers
311 views

How to add a list of vectors (lists) to a directed graph as an edge weight?

Why does following command not work in Mathematica 11.2? ...
43
votes
2answers
4k 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 ...
21
votes
7answers
959 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 ...
3
votes
2answers
1k views

Simplify vector expression - is there something like "Factor" for vectors, dot products etc.?

I am looking for a way to simplify dot products etc. Here is a minimal example: Lets say I have two vectors a and b: Array[a,2] Array[b,2] Now I evaluate their ...
1
vote
1answer
5k views

Append[] is not working for empty list [duplicate]

I am trying to create an empty list and add an element but the list is not being populated. My code ...
1
vote
1answer
1k views

2D vector treatment and visualisation

I'm just trying to define a set of vectors, in the Cartesian plane, draw the vectors originating from the origin $O,$ and be able to add vectors and draw the resulting vector. I've started doing ...
1
vote
0answers
570 views

Symbolic derivatives with vectors and matrices

I'm currently trying to solve some problems using symbolic vectors and matrices of arbitrary size. However, I have some problems with understanding and verifying the results: I defined the vectors as ...
5
votes
2answers
937 views

What are current approaches for supporting Dirac notation for quantum mechanics?

I'd like to be able to use Mathematica to preform some basic quantum mechanics and quantum computation operations using Dirac's Bra-Ket notation. I've seen several solutions to defining basic ...
16
votes
6answers
4k 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 ...
10
votes
1answer
1k views

VectorPlot3D - vectors starting at points

Normally the vectors in VectorPlot3D are attached the middle. How to get them attached at the beginning (what is typical conventions in most textbooks) by use of <...
8
votes
1answer
1k views

Exporting 2D projection of 3D graph in SVG form

For 3D, Mathematica does not export SVG as vector graphics, it just puts an encoded png image inside svg file. Same happens if one exports as .eps or .pdf This question does not address the problem ...
6
votes
2answers
3k 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 ...
16
votes
4answers
7k 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: ...
9
votes
1answer
2k views

Introduction to Vectors and NDSolve

I want to use NDSolve for a complicated equation that contains vectors. I am still new to Mathematica, and have really enjoyed what I have learned thus far. Concerning this question, I have already ...
8
votes
3answers
625 views

"NotAvailable" and "NotApplicable" data points returned by WeatherData[]

I am trying to use ListVectorPlot in combination with WeatherData and CountryData to show ...
3
votes
3answers
2k views

How to expand a general expression in cross and dot product in Mathematica

I am looking for a way to simply the general expression in cross product and dot product with general vectors. I got a help in How do I simplify a vector expression? but soon I find that it doesn't ...
8
votes
2answers
989 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 ...
7
votes
2answers
554 views

7-dimensional cross product

How to define a 7-dimensional cross product? $$\begin{aligned}\mathbf {x} \times \mathbf {y} =(x_{2}y_{4}-x_{4}y_{2}+x_{3}y_{7}-x_{7}y_{3}+x_{5}y_{6}-x_{6}y_{5})\,&\mathbf {e} _{1}\\{}+(x_{3}y_{5}...
7
votes
1answer
1k views

SliceStreamPlot3D or StreamPlot3D

I know that neither of the two functions listed in the title exist, but I basically replaced vector for stream to give you an idea of what I want. The most ideal would be ...
3
votes
1answer
491 views

How can I use a unit vector notation found in physic texts?

In physics (I'm thinking of Taylor's Classical Mechanics or Griffith's Classical Electrodynamics) it is common to use "hat" vectors to denote unit vectors like $\hat{x}$ or $\hat{r}$. If I wanted to ...
8
votes
2answers
301 views

ListVectorDensityPlot plots outside the data in a very wrong way

I am plotting a vector field data set mydata where the background color indicates the vector orientation and its opacity for the vector magnitude. I use ...
3
votes
1answer
162 views

Problems evaluating a simple vectorial field with VectorPlot [duplicate]

I'm trying to plot the electrostatic field generated from a single charge on a plane. Without the $\frac{1}{4\pi\varepsilon_0}$ factor and the value of the charge $q$, as a function of $x, y$ the ...
2
votes
1answer
443 views

How can I use parts of lists with Dynamic?

I'm a newbie - what am I doing wrong? I want to use parts of lists (vectors) in calculations but Mathematica will not evaluate anything that involves parts of lists that update dynamically. Is there a ...
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 ...
2
votes
2answers
139 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. ...
2
votes
1answer
924 views

Placing many arrowheads on curves

I can't find anything anywhere on the web to help me with this. My plot: ...
1
vote
2answers
257 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
3answers
206 views

Problem with finding a potential function of a vector field

I have this code where I try to calculate the potential function of the vector field F. ...
12
votes
1answer
772 views

multiplication of vector spaces

Original Question Disclaimer: The question motivated by the product of Hilbert spaces which arises from separate degrees of freedom which a system might contain in quantum technical system. Examples ...
4
votes
1answer
3k 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 : ...
9
votes
1answer
1k views

Animate a circle "rolling" along a complicated 3D curve

I need to know how to plot and animate a circle "rolling" along this pretty complicated 3D parametric curve. ...
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 ...
6
votes
2answers
419 views

3D Vectors wrap on the Sphere

How I can wrap the 3D vectors around the sphere surface like this one. My angles are ...
8
votes
2answers
2k 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 ...