Mathematical vectors, operations on vectors and vectorized programming.

learn more… | top users | synonyms

0
votes
0answers
24 views

Restricting the number of zeros in a vector [migrated]

I have a M dimensional vector and the value of the vector elements can be from 0 to less than 1. However in any M dimensional vector, I can only have a R number of zero elements. Can any one please ...
0
votes
0answers
37 views

Using indexed variables to make a vector — Iteration limits exceeded [on hold]

I am trying to do an implicit numerical integration scheme for the 1D heat equation. This basically amounts to diagonalizing a matrix equation at every time-step of the simulation. So in order to do ...
2
votes
1answer
50 views

Changing the length of the vectors in vectorplot [duplicate]

I have the following code, and I've tried almost everything I can think of, even VectorColorFunction to describe magnitude. I am trying to make the length of the vectors proportional to r^{-2}, and ...
2
votes
0answers
68 views

Compile issues, scoping and order of evaluation

I have a few questions about compiling functions, which I think are all related to scoping and order of evaluation. I will illustrate them by a minimal example of the problem I have. I'm sorry for ...
1
vote
1answer
73 views

how to find the vector intersection in a collection of triangulated 3D points?

I'm trying to calculate the 3D point coordinates for the intersection of a vector with a plane. I have been using the following code to do this: ...
2
votes
2answers
104 views

How can I visualize an array of very small vectors spaced on very large grid? [duplicate]

I have data in the form points = {{1, 1, 1}, {1, 1, 2}, ...} vectors = {{2, 2, 5}, {2, 1, 7}, ...} Can somebody help to edit this data so I can ListVectorPlot a ...
1
vote
1answer
48 views

Make 2D vector norm graph

I have: List of points on 2D plane: pointsz0 = ToExpression@Import@"http://pastebin.com/raw.php?i=VQfP0HgB"; And I have some values in those numbers: ...
8
votes
3answers
536 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: ...
2
votes
2answers
109 views

How to initialize several elements per iteration with Table?

I would like to initialize this kind of vector : {0,0,1,1,0,1,0,1,1,1,1,1} with Table. I tried ...
-1
votes
1answer
55 views

Problem with cross product of two columns [closed]

I am trying to perform a cross product of two "Columns" which I expect to give me a column too: Cross[{{a}, {b}, {c}}, {{x}, {y}, {z}}] but it gave me an error: Cross::nonn1: The arguments ...
6
votes
2answers
77 views

Complex result for Real vectors in VectorAngle

I was expecting a real angle using VectorAngle when passing real valued vectors, however I obtained a complex angle. ...
1
vote
1answer
65 views

How can I transform a matrix to a vector (vectorization)? [closed]

How can I transform a matrix to a vector in mathematica? $A=\bigg{(}\begin{matrix} a_1 &a_2\\a_3&a_4 \end{matrix}\bigg{)} \longrightarrow |a>>=(\begin{matrix} a_1 ...
6
votes
3answers
198 views

A Case of DeleteCases for WeatherData

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

Multiply value if it includes a period

I download data from an online source, now I have a problem: the source code doesn't allow to differ between values of 10 (which actually stands for 10) and 10.000 (which is 10'000, but Mathematica ...
5
votes
6answers
679 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)$. ...
-1
votes
1answer
114 views

Finding the maximum of a gradient vector

Im trying to find the maximum of my gradient vector G[x,y], I've tried several options including FindMaximumValue, FindMaximum etc. but i couldn't find it. The full function is shown below, any help ...
0
votes
0answers
34 views

Get rid of external library dependency

I am trying to generate C code for some functions, which I do not post in full because they are a few hundred lines long. The functions do nothing too fancy: a bunch of dot products, powers and roots. ...
3
votes
2answers
118 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 ...
1
vote
2answers
119 views

Selecting parts of a matrix via indices given by a vector

I have a column vector of the form $\{1, 1, 2, 3, 2, 3\}^t$ and an associated matrix that has the same number of rows as the column vector, $6$, and a number of columns that is equal to the maximum of ...
2
votes
1answer
117 views

How to Normalise / Normalize eigenvectors? [closed]

I have a matrix and am trying to find the normalised eigenvectors of it. I am using the Eigensystem command and am getting a result. There is a normalize command, but as far as I can see this ...
1
vote
1answer
113 views

Placing many arrowheads on curves

I can't find anything anywhere on the web to help me with this. My plot: ...
6
votes
2answers
460 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 ...
3
votes
3answers
126 views

how can I make a control for my vector equation in my simulation?

I'm trying to build a control selector or menu for equations to put into my curvature simulations. However all the code I've tried hasn't worked.Does anyone know how I could make a control selector or ...
0
votes
1answer
58 views

Visualizing vectors [closed]

How to visualize a set of vectors with 3 coordinates $(x,y,z)$, e.g.,$(1,1,1), (1,-1,-1),(-1,1,-1),(-1,-1,1)$? In fact there are many of them. I try the function "Graphic3D" with the following code ...
1
vote
0answers
52 views

Plotting Phase Space [duplicate]

I have these two Equ' $$x'[t]=Sin[y]$$ $$y'[t]=Cos[x]$$ and im trying to plot the phase space(plane) for this system... ive tryed Equationtrekker but cant seem to find the way to use it this way... ...
1
vote
1answer
53 views

Simplification of linear algebra [duplicate]

I have a few vectors defined as V1 = Array[v1,3] V2 = Array[v2,3] V3 = Array[v3,3] And I am trying to solve a very simple equation along the lines of ...
1
vote
1answer
85 views

Show that three given vectors lie on a line, a plane, or span 3-space

Given three vectors, {2, 0, 0}, {0, 2, 2}, {2, 2, 3}, how could I see if they are all on the ...
0
votes
1answer
91 views

Select positive value from a vector

I am wondering how to pick out the positive Omega value from soln, and make these positive values into a row vector. I know how ...
0
votes
1answer
62 views

Curvature Manipulation: Vector Evaluation Error [closed]

I am building a mathematical simulation of curvature that will show the Osculation circle at each point on a curve. However my code keeps coming up with errors and ...
0
votes
1answer
62 views

Plotting multiple vector fields with different domains in a single graph

I have attached a scheme of the problem. Essentially what I need is to plot 2 different vector fields in a single graph with different domains. The underlying physical problem is to model electric ...
1
vote
0answers
58 views

vector/list containing matrices as elements dot product [closed]

mA = {{a11, a12}, {a21, a22}}; mB = {{b11, b12}, {b21, b22}}; mC = {{c11, c12}, {c21, c22}}; mD = {{d11, d12}, {d21, d22}}; v={{mA},{mB}}; w={{mC},{mD}}; What I ...
2
votes
1answer
82 views

Taylor expansion of function of vectors—simplifying the output

I've got a real-valued function of several vectors $f(u,v,w)$ formed by taking scalar products of linear combinations of the vectors, I want to Taylor expand around small $v$ by writing $$f(u,\delta ...
1
vote
0answers
40 views

ListVectorPlot3D invalid dataset [duplicate]

I have generated a dataset which seems to fine according to the help page of Mathematica for a ListVectorPlot3D but, it says it is not a valid set. I have given the data set below, could someone ...
1
vote
0answers
30 views

X-axis obscuring a vector that lies along it [duplicate]

I am having the following problem. I am playing with Manipulate and I would like to draw a vector overlapping an axis (x-component of a vector), and I would like ...
2
votes
2answers
455 views

Circular Orbit Velocity in Vector Components

I'm trying to find out how to calculate the initial velocity needed to keep a spacecraft in a circular orbit around the Earth given its initial position and an initial angle theta in a Cartesian ...
0
votes
1answer
147 views

Simplify function with normalized vector

I made a very simple case: testF[x_, y_, z_] = x^2 + y^2 + z^2 Simplify[testF[x, y, z]] If {x, y, z} is normalized, the simplified result should just be 1. How ...
1
vote
1answer
62 views

Partitioning a list and gathering statistics on the distribution of values across partitions

I have a one-dimensional array of 200 elements consisting of the numbers 0, 1, 2. This array needs to be divided into 10 groups (20 items each). Then, for each group, I want to count how many of the ...
0
votes
1answer
87 views

Vector-calculus [duplicate]

I have a table of 200 elements, elements are '0', '1', '2'. I have participate them into groups for 20 elements each one. Then I have calculate how many '0', '1', '2' are in each part. And then in ...
1
vote
1answer
77 views

Operator operation

There are two basic operators r={x,y,z} and p=-I*h*{D[#,x] , D[#,y], D[#,z]} &. The angular momentum operator is defined as ...
5
votes
0answers
218 views

Estimation of vector autoregressive (VAR) process

To estimate 1-dimensional VAR process (which is AR process) you can easily use functions EstimatedProcess or ...
0
votes
0answers
30 views

Is it possible to obtain vector differentiation results in terms of vectors rather than components? [duplicate]

When doing certain operations on vectors in Mathematica it is quite desirable to convert the results back into coordinate-free notation. Unfortunately, after going through the Documentation Center and ...
1
vote
2answers
68 views

Computing symbolic norm of a vector

Consider the code: n1 := Cos[α] Sin[β] n2 := Sin[α] Sin[β] n3 := Cos[β] n := {n1, n2, n3} Norm[n] Why the result is ...
0
votes
0answers
87 views

Visualizing 3D vector field on surface of sphere [duplicate]

I want to vizualize (quite complicated) 3D vector field which has both real and imaginary part and is expressed in spherical coordinates. I was thinking about expressing the field for certain r and ...
0
votes
1answer
79 views

Factor a Vector

Does there exist a function in Mathematica that simply takes out a common factor from a vector/list of expressions? This seems like such a simple operation that I am surprised that I could not find it ...
1
vote
2answers
271 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 ...
12
votes
1answer
1k 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 ...
18
votes
7answers
814 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 ...
0
votes
0answers
37 views

Using Manipulate, how do you display the points on the curve and the tangent vector? [duplicate]

I'm new to Mathematica and my assignment is very vague... I'm hoping someone can explain to me a bit more of that this quesion means: Given the curve C, display the point on the curve and the ...
0
votes
1answer
52 views

Function output of two lists are only diagonal elements

I'm having a little crysis over here. What I basically want to do is some sort of 3D-Plot, but I'm only interested in the resulting values. I have two vectors x and p: ...