Stack Exchange Network

Stack Exchange network consists of 174 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

Mathematical vectors, operations on vectors and vectorized programming.

1
vote
1answer
52 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
52 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
35 views

Representing 3D vectors, manipulating them, and identifying symmetry operations [on hold]

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
107 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
76 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
133 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
43 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
62 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
38 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
39 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
63 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
166 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
105 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 ...
0
votes
0answers
29 views

Plotting 3D vectors over a line rendered by ParametricPlot3D

I have a set of experimental points in the type {x,y,z}, which denote vectors in the space and their coordinates. I've plotted this data with the ...
10
votes
3answers
433 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
80 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
80 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 ...
4
votes
1answer
140 views

multiply two vectors, component by component [closed]

Would like to take two vectors and multiply components at the same index.For example {a1, a2, a3} x {b1, b2, b3} to produce {a1 b1, a2 b2, a3 b3}. The following works, but are there some alternatives?...
3
votes
2answers
206 views

How to get vector a from known inner product?

Assuming that a.b=z,where b={b1,b2,b3} and z=x b1+y b2+z b3, obviously ...
-1
votes
1answer
31 views

column space having non-linear combinations of basis vectors [closed]

I have a matrix $A_{3x3}$ whose basis for the column space are $a_{1}=(2,2,5)$, $a_{2}=(9,5,3)$ and $a_{3}=(3,6,1)$. If these are the basis for the column space, then column space can always be ...
1
vote
1answer
71 views

Abstract vector algebra with scalars

I am interested in expanding a vector expression in terms of the scalar parameter, but it doesn't give the expected result ...
3
votes
2answers
113 views

Why is TensorExpand so slow for vector operations?

I would like to expand the following tensor expression: ...
7
votes
2answers
136 views

How to simplify tensor expression with symbolic coeficients?

I can use Vectors to simplify the following expression: ...
16
votes
1answer
179 views

How can I reliably plot ellipse-field streamlines?

I am trying to replicate some standard structures in the study of ellipse fields in Mathematica, and I'm having much more trouble than is really reasonable, so I'd like to put this on the floor here ...
0
votes
1answer
30 views

Integrating a vector according to elements of another vector

I have two vectors, $\bar{x},\bar{v}$ and I want to produce a third vector such that:$$ u_i = \int_{x_i}^{x_i+\delta} f(v_i,t)dt \ .$$ I tried (with a simple function for example): ...
1
vote
1answer
51 views

wrong answer on mathematics when adding vectors

can anyone know how to solve this simple problem: {{3}, {0}, {3}, {0}} - Fout /. Fout -> {{0}, {0}, {1}, {1}} {{3}, {0}, {3}, {0}} - {{0}, {0}, {1}, {1}} ...
0
votes
1answer
51 views

Resultant of two force vectors

Vector 1 is 80 degrees counterclockwise from the X axis and 150 Newtons in magnitude Vector 2 is 15 degrees counterclockwise from the X axis and 100 Newtons in magnitude What is the resultant vector? ...
1
vote
0answers
41 views

Vector calculations in unspecified dimension

So I would like to be able to do operations on vectors, while leaving the dimension $N$ of the vector space unspecified. As a simple example, I would like to be able to define the unit vector $e_i = ...
8
votes
2answers
263 views

Confused about the solution obtained from vector linearization

I am trying to linearize a vector expression $$\frac{(\mathbf{u}+d\mathbf{u})\times(\mathbf{v}+d\mathbf{v})}{\vert(\mathbf{u}+d\mathbf{u})\times(\mathbf{v}+d\mathbf{v})\vert}$$ Here is my code ...
1
vote
1answer
58 views

How can I transform a density plot into a stream plot?

I have a table with three columns: x, y and z, where z is a function of x and y. Right now, I have a ListDensityPlot of z (below). Is it possible to plot a stream plot of this data, so that arrows go ...
4
votes
2answers
246 views

Handling arrays

Is there a way to transform a matrix in a vector, where you choose the order of the arrangement? I used ArrayReshape but this command chooses its own arrangement, ...
4
votes
3answers
159 views

How to make vector field plot from NDSolveValue Solution?

I am solving Laplace equation on circular domain from which i get solution for potential. The code I used: ...
1
vote
0answers
39 views

Simplifying results of a vector function to be nested (SECOND UPDATE)

(Oddly enough, the title for another question that ended up dealing with an unrelated problem could have worked better here, but I didn't want to plagiarize.) Given a symbolic vector function ...
1
vote
0answers
60 views

How to query Wolfram Alpha to find projection of point on plane? [closed]

For example, the projection of the point $P=(1,2,3)$ on the plane $x+y+z=3$ is the point $Q=(0,1,2)$. How do I ask Wolfram Alpha to compute this? I've tried "projection of point (1,2,3) on plane x+y+...
1
vote
1answer
29 views

Obtain needed Kronecker products from output of Eigensystem[]

Eigensystem[M] gives a list of the eigenvalues and eigenvectors of the square matrix M, i.e. {{val1,val2,...},{vec1,vec2,...}}. I need a routine that will ...
4
votes
1answer
101 views

Introduction to Vectors and NDSolve with System of Equations

This question is similar to an older question but with a system of equations. I have two equations that I want to solve with NDSolve, and here's a similar minimal ...
0
votes
1answer
32 views

With equation of vector fields which are in cylindrical polar coordinates, how to plot 3-D vector field? [closed]

I have the equation of vector fields which are in cylindrical polar coordinates. How do I plot 3-D vector field? I never used Mathematica. Edit2: ...
3
votes
1answer
174 views

Finding optimal rotation matrix

I have vectors E1 = {22.607, 3.495, -30.795}; and R1 = { 4.74061, 21.7549, 30.6501};. This vectors are conneted by a 3D rotation ...
7
votes
3answers
441 views

Rotating Vectors in space

I have two sets of vectors, ...
0
votes
2answers
51 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. ...
1
vote
1answer
29 views

Seperating output as variable

I have an output like this: out = {{{x1, y1, z1}, {a1, b1, c1}}, {{x2, y2, z2}, {a2, b2, c2}}, {{x3, y3, z3}, {a3, b3, c3}}}; Now want to save this output in two ...
1
vote
2answers
59 views

Rotating two vector randomly keeping the relative orientation between them unchanged

Let's consider we have two vectors $A(x_1, y_1, z_1)$ and $B(x_2, y_2, z_2)$. Now want to rotate these two vectors in $3D$ space (such that the relative orientation between them is always same). How ...
2
votes
1answer
63 views

Pattern for a vector space basis expansion

I'd like a pattern which matches an expansion of a vector in a given basis, so mathematically any expression of the form $\mathbf{v} = \sum_{i = 1}^n v_n \mathbf{a}_n$. The basis is defined by a ...
1
vote
2answers
60 views

flattening only part of a matrix, manipulating and retrieving the unflattened matrix

I start with a square matrix with odd size. I keep the original version of this matrix. Now, I extract the non-zero elements from the matrix, which lie everywhere except the $3\times3$ block in the ...
0
votes
1answer
42 views

mathematica finding unknown vector that satisfies conditions

How do you write each condition as an equation or inequality to find a vector $v$ that satisfies $v$ is a unit vector: $||v||=1$, $v$ forms an angle of π/3 with the vector $(6,4,-2)$, $v$ is ...
0
votes
2answers
56 views

Finding vectors using solver

I have an question using vector: u = {u1, u2}; v = {v1, v2}; $|u|=4$ and $|v|=2$ and $u.v=3$ Find: $(3u-2v).(-u+4v)$ I tried to use some solver, but nothing ...
0
votes
1answer
55 views

Compilable table of Matrix diagonals function

1, I am trying to make Compilable function which takes Matrix of zeroes and ones f.e: ...
0
votes
1answer
48 views

Graphical representation of vector equation

Hi I want to to show graphically: $$\vec{x} = \vec{p} + t(\vec{q}-\vec{p})$$ for vectors $\vec{x},\vec{p},\vec{q}$ and t varying from 0 to 1 in $\mathbb{R}^2$. So basically the vector $\vec{x}$ ...
0
votes
1answer
62 views

Finding sequences of same elements in a vector

I am trying to effectively find a number which tells me the number of sequences of ones in a vector of zeros and ones. For example, consider the vector: ...
0
votes
0answers
31 views

LatticeReduce (2D) more than two vector [duplicate]

I wonder how LatticeReduce works when I use more than two vector arguments each one in 2D. I know the Gauss algorithm to reduce two vectors. However, how ...