Mathematical vectors, operations on vectors and vectorized programming.

learn more… | top users | synonyms

1
vote
0answers
54 views

Mirror image of a point about a line [migrated]

How can I calculate the mirrored position for a point in 2D space? I know the xy-coordinates of the two points which define the vector. I also know the coordinates for the yellow point which I want to ...
0
votes
0answers
29 views

Pass List / Vector argument through NDSolve to a function

I am trying to pass vector or list as argument to the function from NDsolve.And I am getting these error. Also I am pretty new to stack overflow. Apology if this a possible duplicate. Here is my code. ...
0
votes
0answers
62 views

Is there a good way to schematically show that 3 vectors are perpendicular? [on hold]

I have 3 vector plots, I want to show that overlapping arrows from each plot are perpendicular to each other, when I show all plots in one plot it looks like this: It is hard to see that the ...
1
vote
1answer
49 views

Plot mysteriously not working [closed]

I'm running this code to plot an equation but it simply won't work ...
0
votes
0answers
46 views

NDSolve mixing many scalar and vector equations

I have a system of coupled PDEs, representing the behaviour of 2-dimensional inextensible rods, which I am discretizing using Method of Lines. This gives me a set of ODEs for the inner spatial points, ...
2
votes
1answer
121 views

Controlling scaling of multiple vector fields in VectorPlot3D

I'm trying to plot the electric and magnetic fields of a relativistically moving electric charge using VectorPlot3D, and apply "Manipulate" to change the velocity. The code I'm using is as follows: ...
0
votes
1answer
49 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
votes
1answer
53 views

NDSolve and vectors [closed]

I think I can't find solution of equation below because I need use scalars, not vectors as I have tried. But I don't know how I can do express the problem with scalars. I have read Wolfram Language ...
-1
votes
0answers
10 views

Prove over matrix norm and eigenvalues [migrated]

I am trying to prove following inequality but I fail to do it. I think I know how to prove the right hand side inequality |lambda| <= ||A||, but I still don't know how to prove the left hand side ...
1
vote
0answers
23 views

How do I add a finite value to one component of a set of vectors [closed]

I have a set of (x,y) values in some *.csv file, when I open them with Mathematica to plot it some of the plots are shifted so I need to add some finite value to one of the components of every vector. ...
0
votes
1answer
89 views

Plotting a function of vectors and sample points [closed]

I need to plot a function of vectors. \begin{equation} 2y\vec{r}\cdot\vec{x}+2y^2+\vec{x}\cdot\vec{x}=1. \end{equation} This is actually an equation of constraint. Given $\vec{r}$, with ...
3
votes
1answer
46 views

Plotting a vector function composed of piecewise scalar functions

I am relatively new to Mathematica, and am having difficulty doing something that is conceptually very simple. I am trying to plot a vector field in which the vector function is composed of piecewise ...
4
votes
2answers
199 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) : ...
0
votes
1answer
58 views

NDSolve and a vector function [duplicate]

I'm trying to solve a set of differential equations which include a numerical function that takes a vector and returns a vector. ...
3
votes
5answers
177 views

How to define a set of two random orthogonal unit vectors?

I need to define a random set of two orthogonal unit vectors. The code below doesn't give proper unit and orthogonal vectors : ...
0
votes
3answers
111 views

Plotting a 3D vector field on 2D plane

I want to visualize vector field that is of the form $(v_1(x,y), v_2(x,y), v_3(x,y))$, i.e. there is a three component vector that depends on only two coordinates $x$ and $y$ in the real plane. There ...
1
vote
0answers
41 views

How to pack arguments of a function into a vector for brevity? [closed]

I have a function like the following one: F[a_, b_, c_, d_] := Product[f[x, y, z, j, i], {j, a, b}, {i, c, d}] where ...
3
votes
1answer
52 views

Integrating a gradient and matching terms automatically

I am trying to integrate a function $\nabla w(x,y)$ indefinitely knowing both components of $\nabla w(x,y)$. I have a function dw[x_,y_] that I have defined. I then ...
0
votes
0answers
29 views

Simplify expression?

Suppose I have expressions that involve terms like: p1.p1+p2.p2+p3.p3+p4.p4 p1, p2, p3, and p4 are all elements of an array: ...
3
votes
1answer
149 views

Errors Solving Elliptic PDES with FEM

I am trying to solve the equation below governing transversely isotropic plane strain in cartesian coordinates with the given boundary conditions based on code found here using Mathematica 10.1 on OSX ...
2
votes
1answer
72 views

How to a convert a 2D vector into an angle [closed]

How do you calculate the angle between the line from the origin to a point $(x,y)$ and the horizontal axis?
1
vote
1answer
80 views

Color vectors according to a user-defined function

V[x_,z_]:=x/Sqrt[x^2+z^2]; Ex[x_,z_]=-D[V[x,z],x]; Ez[x_,z_]=-D[V[x,z],z]; The electric field components (Ex,Ez) are to be plotted as a vector field in the x-z ...
1
vote
1answer
65 views

Cross product of three vectors

I am following the answer of Jens from following post: How do I simplify a vector expression? vec /: Cross[vec[x_], HoldPattern[Cross[y__]]] := I want to create ...
1
vote
1answer
114 views

Draw Vectors in Spherical Shell and then Animate

I want to draw three vectors inside a spherical shell. One of the vectors will be moving, the others will be stationary. However, the animation is the next step. For now, I would like to get the ...
1
vote
1answer
389 views

Factor vector out of a matrix

I am wondering how to factor a[1],a[2],...,a[4] out of sim so that I can write sim as the ...
9
votes
2answers
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 ...
0
votes
0answers
187 views

Plotting Phase Space [duplicate]

I have these two Equations \begin{align} x'(t)&=\sin(y)\\ y'(t)&=\cos(x) \end{align} and I'm trying to plot the phase space(plane) for this system... I've tryed Equationtrekker but can't ...
3
votes
3answers
221 views

Plot a vector field over a line

This seemingly simple problem is giving me some trouble. I need to plot a vector field on a line, and for that I'm following what I found here. I try to create a mesh that contains two points and just ...
1
vote
0answers
64 views

Given vector of function plot each of them separately? [closed]

At the moment, I am trying to plot a vector of functions which consists of the change along $x$, $y$, and $z$. Is it possible in Mathematica to give a vector of functions and plot them separately ...
3
votes
2answers
53 views

How to avoid 0 OverVector[F] to be evaluated as 0?

I am fairly new in Mathematica and I am trying to work with scalars and vectors. I decided to denote vectors using OverVector (as example, ...
1
vote
1answer
68 views

How to adjust vector scaling with a specific aspect ratio

I'm trying to create a vector plot with uniform vector scaling. I need the x and y ranges to be very different, because I need to highlight the angle between the vectors and the y=0 axis. This means ...
2
votes
4answers
132 views

How to obtain the gradient of a function as a function?

The Grad function allows me to get the gradient of a function like this: ...
3
votes
2answers
188 views

ListPlot vector 3D circle line

I got a 2D vector with the following code. ...
0
votes
2answers
44 views

Unevaluated derivatives of known functions after replacement

I want to make the following replacement work correctly: Array[(2 D[xM[[#1]][t], t] * D[xM[[#2]][t], t]) &, {3, 3}] /. {xM -> {Sin[ω t], Cos[ω t], 0}} ...
6
votes
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 ...
0
votes
0answers
43 views

Order of evaluation for numeric functions

I'm trying to plot a 3D vector field to illustrate an electric field of a uniformly charged disk, and I used Manipulate to change the radius R of the disk to see ...
1
vote
1answer
39 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 ...
8
votes
3answers
192 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: ...
3
votes
4answers
190 views

Pack Solve results into a vector

I am currently using a really easy function to get the eigenvectors of a corresponding eigenspace: ...
1
vote
1answer
88 views

Calculation of tensor structure

I would like to calculate following type of contraction: $$ P_{ij}^{p-k} P_{lm}^{k} ((p_l - k_l) \delta_{ij} + k_j \delta_{il}) (k_n \delta_{im} - p_m\delta_{in}) = ? $$ where p,k are ...
0
votes
1answer
69 views

Minimization of linear combination of vectors

Suppose I have a vectors in $\mathbb{R}^{6}$. For example, take the vector $v = k(-2,2,4,6,2,2)$. I would like to find some $k$ with the constraint that the last two components are necessarily ...
5
votes
3answers
408 views

How to calculate a list without loop?

I have pairs of numbers {a1, b1}, {a2, b2}, {a3, b3}, ..., ...
0
votes
2answers
85 views

How to evaluate function in the grid?

I have a function f[a_, b_]: = b^a + a b. a takes values {1,2,3,4}, and ...
2
votes
1answer
40 views

N-Dimensional vector from scalar

Is there a way in Mathematica to create an n-dimensional vector, where each element is a given scalar? I have tried the Array function, as the documentation center ...
2
votes
1answer
46 views

Sum of operations involving an arbitrary number of 2D vectors

I need to define an equation stating that the sum of n operations involving n 2D vectors and ...
1
vote
0answers
43 views

Piecewise in 2D with quadrants as conditions

I am trying to define a piecewise vector field. Can the condition be of the form I am using (i.e. a quadrant)? I can't also make Piecewise work with more than two ...
1
vote
1answer
91 views

Is it possible to use vectorized Plot Legend?

I upload data using the following code data = Import["L" <> # <> ".dat"] &/@{"10", "102", "103", "104"}; My function is ...
3
votes
2answers
139 views

Color vector according to angle

One can use the function VectorColorFunction in VectorPlot3d to color vectors according to their norms. How to color vectors ...
7
votes
2answers
153 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 ...
1
vote
1answer
89 views

Using the Norm Function

I am trying to take the norm of a general vector and show that for vectors, v,w, that Norm[v cross w]^2==Norm[v]^2*Norm[w]^2-(v dot w)^2 In Mathematica, here are my steps: ...