Questions tagged [vector]

Mathematical vectors, operations on vectors and vectorized programming.

Filter by
Sorted by
Tagged with
2 votes
1 answer
83 views

Calculating power series of quantum operators on kets

I am using the "Quantum" add-on package to perform some quantum mechanical calculations using SU(1,1) generators. The code that I've developed reads ...
user avatar
  • 655
0 votes
0 answers
60 views

streamplot for differntial equation

how I can use StreamPlot or VectorPlot to show x[t] and 1-x[t] and show convergence point in my plot with a different colour like a blue point? ...
user avatar
  • 77
1 vote
1 answer
60 views

Find binary vector within fixed distance to reference vector that maximizes the number of distances to a set of vector that are below a threshold

Input: A binary reference vector $r$, a multi-set of binary vectors $S$, and a distance function d between binary vectors of equal length. Assume that $r$ and all vectors in $S$ have the same length. ...
user avatar
  • 33
1 vote
1 answer
76 views

LinearOptimization - how to solve with vector constraints?

I have the following linear program that I am able to solve in MATLAB. However, I want to move to Mathematica. For some fixed constants $n$, $\delta$ and $\varepsilon$ and fixed $(n+1)$-dimensional ...
user avatar
2 votes
1 answer
53 views

Solving a vector diferential equation lead to ComplexInfinity Encountered non-numerical value for a derivative at t == 0

I'm trying to solve the following Vector PDE: I implemented the following code: ...
user avatar
1 vote
1 answer
44 views

Using Through function with vectors

I have the vectors defined as follows: v1={x1,y1,z1}; v2={x2,y2,z2}; v12=v2-v1; v21=v1-v2; I am passing an integer function for iteration purpose as follows: ...
user avatar
  • 755
2 votes
3 answers
230 views

How to do column vector concatenation

Is it a way to do column vector concatenation? u = {{1},{-1},{0}}; v = {{0},{1},{-1}}; w = {{-1},{0},{1}}; I would like a matrix of {u,v,w}
user avatar
0 votes
0 answers
61 views

Spherical Polar Coordinates VectorPlot3D

I understand the VectorPlot3D function allows you to plot a 3D vector ${Vx,Vy,Vz}$ as a function of $x,y,z$. Is there a function that allows you to plot in ...
user avatar
1 vote
1 answer
77 views

VectorAngle[] relative to specific origin?

VectorAngle[] computes the angle between two vectors from the origin (I assume {0.0, 0.0, 0.0}). Can we use a reference point ...
user avatar
  • 1,563
10 votes
1 answer
191 views

VectorColorFunction not working at a few points

I use the following data to ListVectorPlot a vector field with the color indicating the vector direction. However, there seem to be some vectors not colored ...
user avatar
  • 4,226
0 votes
0 answers
50 views

How to express elemental operations in matrix form?

I ran the following code: X = Array[x, {5, 4}]; W = Array[w, {4, 3}]; Y = Array[y, {5, 3}]; D[Norm[X.W-Y, "Frobenius"]^2, {W}]//MatrixForm However, mma ...
user avatar
  • 1
5 votes
1 answer
75 views

Speed up dot and cross products for a list of vectors, in a "brick wall" pattern

Yesterday I asked a question on how to speed of computation of dot and cross products for a list of vectors, for which I received a nice answer from Henrik Schumacher. Now I have a follow up question ...
user avatar
8 votes
1 answer
304 views

Speeding up cross and dot products for a list of vectors

I am working on a code where I perform dot and cross product operations on a large list of vectors multiple times. I am using MapThread to achieve this but I feel the speed of operation is not up to ...
user avatar
-1 votes
1 answer
67 views

Matrix basis using `Orthogonalize`

I have four matrices, ...
user avatar
  • 422
1 vote
1 answer
80 views

Convert a polynomial to a vector [duplicate]

I am trying to transform a generated polynomial terms into a vector, I used the command 'MonomialList', ...
user avatar
0 votes
1 answer
56 views

Total Spin Matrix Squared (Casimir Operator)

I am trying to get Mathematica to compute the Casimir operator of a 4 particle system of spin $1/2$ fermions. I have the following code which does not do what I would like it to. ...
user avatar
  • 137
0 votes
0 answers
72 views

How to matricize a vector?

I am wondering how to represent a vector as a matrix, using specified dimensions. For example, MatrixForm[{a, b, c, d}] gives me a column vector. But I would want ...
user avatar
0 votes
1 answer
94 views

How do I find the unit vector in the direction of the minimal rate of change?

A ball falls on the surface $x^4 z+x^9 y^2+y^2 z^3=65$ at the point (-1,-3,2). How do I find a three-dimensional unit vector in the direction that the ball will begin to roll. I know that the ball ...
user avatar
  • 115
3 votes
2 answers
151 views

How to subtract a list from certain sublists of a list? [closed]

I have a problem in doing an operation on this vector {{2,3},{3,4},{5,6}}-{1,1} I want to minus this to get the result ...
user avatar
1 vote
1 answer
154 views

Solving equation set with vectors

I have six unit vectors in real $3$D space v1,v2,v3,v4,v5,v6; Represent the dot product between some of the vectors as the Cos ...
user avatar
  • 422
0 votes
1 answer
63 views

Output not showing in For loop

My code is ...
user avatar
0 votes
1 answer
40 views

Reduce expressions into (simplified) matrix and vector forms

I have some computation that results in a rather complicated looking expression that could be much simplified by converting it into matrix or vector expressions. For example, instead of ...
user avatar
  • 206
2 votes
1 answer
134 views

Dot Product of Vector with matrix components

In Physics it's common to write matrices in vector components to simplify notation. This commonly occures with the pauli vector $\vec\sigma = \begin{pmatrix}\sigma_1 & \sigma_2 & \sigma_3\end{...
user avatar
  • 1,121
0 votes
1 answer
65 views

Finding the Curvature of the path of a particle

How do I find the curvature of the vector when t=5? The function is: v[t_] := {2 t^4 + 2, 6 t^3 + 1, 3 t^2 + 4}
user avatar
  • 115
2 votes
0 answers
62 views

Finding the Torsion given a vector r[t]

How do I find the torsion of a vector? The function is: r[t_]:={Sin[7t],t^4,Cos[7t]}
user avatar
  • 115
1 vote
2 answers
75 views

How would I find the Binormal vector? [duplicate]

How would I find the Binormal vector if r[t_]:={sin(7t),t^4,cos(7t)} in Mathematica? This is the Mathematica code I have: ...
user avatar
  • 115
1 vote
0 answers
40 views

I am searching for the Eigen stuff of a non linear transformation

I have a slightly odd problem I have been working on as part of a project on probability models. The full problem itself is not relevant but here is where I am stuck. I have a 6D space $P$, where all ...
user avatar
0 votes
0 answers
43 views

How would you write a electric field in cylindrical coordinates?

I am new to Mathematica and I am trying to automate the process of finding electric and magnetic fields for TE and TM modes in a cylindrical superconducting cavity. I could not find documentation ...
user avatar
4 votes
2 answers
270 views

Is it possible to solve vector equations?

For example if we define parametric line segment curve1[t_, p1_, p2_] := t*p2 + (1 - t)*p1; where p1 and ...
user avatar
  • 725
2 votes
1 answer
151 views

Writing a system of ODEs in vector form

I have the following system: $\frac{dx}{dt} = p_x \\ \frac{dy}{dt} = p_y \\ \frac{dp_x}{dt}=-\frac{\partial V}{\partial x} \\ \frac{dp_y}{dt}=-\frac{\partial V}{\partial y}$ ,where $V(x,y) = \frac{1}{...
user avatar
  • 199
0 votes
1 answer
71 views

How can I remove the attributes "Orderless" from function Times stably and reliably?

Recently I have been doing some algebra of partitioned matrices, where product like below is common: where $A_{11}, A_{12}, X, Y$ are all partitioned matrix blocks thus all are matrices in essence. ...
user avatar
  • 403
0 votes
1 answer
107 views

dot product and norm [closed]

Can you solve the following problem in mathematica program? Thank you. Let x=(x1,x2,x3),y=(y1,y2,y3) and ⟨x,y⟩=x1y1+2x2y2+x3y3 be an inner product in a three-dimensional real vector space. Define the ...
user avatar
0 votes
0 answers
63 views

Can I use assumptions to declare a variable's type?

I'm trying to declare $P$ as a vector. I searched for a while, the closest way seems to be Assumptions: ...
user avatar
2 votes
0 answers
90 views

Bug with ListVectorPlot in 12.3.1?

Bug fixed in 13.0.0 The documentation shows that result of ...
user avatar
  • 271
2 votes
0 answers
47 views

Why does the dot product between a matrix and a vector not work? [duplicate]

Executing this code: ...
user avatar
  • 2,911
3 votes
1 answer
120 views

How can I do operations in this basis (using matrices)? [closed]

Let's define $u=t+1/2$ $v=t-1/2$ Now, I have vectors in the basis $e_n=u^n-v^n$, I want to apply functions to such expressions, but as a result get expressions in the same basis again. For instance, $...
user avatar
  • 2,911
1 vote
0 answers
54 views

How to generate a Gaussian random velocity field

Let us assume we have a 2-dimensional velocity field $\textbf{u}=(u_x,u_y)$ defined via its stream function $\psi(\textbf{x})$ as \begin{cases} u_x=\partial_y\psi(\textbf{x}) \\ u_y=-\partial_x\psi(\...
user avatar
0 votes
0 answers
80 views

piecewise vector field and composition of piecewise functions

I have the following vector field ...
user avatar
  • 41
0 votes
2 answers
61 views

FindRoot with vector function

I have trouble with FindRoot for vector variables, I have search MMA SE find a solution. in Szabolcs‘s code, Vector FindRoot ...
user avatar
  • 445
1 vote
1 answer
55 views

Why doesn't my code evaluate element of a vector at a given t?

I have written a code to solve the Shrodinger equation for a particular three level siystem in two ways: the first way I defined three functions C1[t], C2[t], C3[t] and I solved three ODEs; the ...
user avatar
1 vote
1 answer
49 views

Interpolate function against time

I have two vectors called lammdaWind11 and timeWind11. They are of size 51*1. I have interpolted each one independently as ...
user avatar
0 votes
0 answers
61 views

velocity four-vector definition by xAct

I want to define the velocity vector by the following relation and evaluate the norm of the vector by using the Minkowski metric. I have defined the tensor x (position tensor) in xAct, but I don't ...
user avatar
0 votes
0 answers
64 views

Is it possible to generate a random vector space in Mathematica?

The idea is that I’d like to try to use Mathematica to work through proofs. So if a proof says, “Let there be a vector space V…”, I would like to see a concrete representation of that vector space in ...
user avatar
0 votes
1 answer
50 views

Plotting two vector fields $\vec V_1=-y\hat i+x \hat j$ and $\vec V_1=2\vec V_1$ on the same plot

I want to compare how two vector fields $\vec V_1=-y\hat i+x \hat j$ and $\vec V_1=2\vec V_1=2(-y\hat i+x \hat j)$ various concentric circles $x^2+y^2=a^2$ with $a^2=1,2,3$ etc. I can plot them ...
user avatar
1 vote
3 answers
73 views

Drawing circles on top of a vector field drawn using VectorPlot

I am using the command VectorPlot[{{y, -x}}, {x, -4, 4}, {y, -4, 4}] to plot the vector field $\vec{V}=y\hat{i}-x\hat{j}$. On top of this, I need to draw circles of radii $1,2,3...$, etc. I am no ...
user avatar
0 votes
2 answers
83 views

How to find a matrix satisfying following equation

I have a $N \times 1$ vector $F(t)$ for $0\leq t \leq 1$. I want to find a $N\times N$ Matrix $C$ (a real-valued matrix) satisfying the following equation: $$\int_0^t F(t_0)dt_0= C.F(t)$$ If it ...
user avatar
  • 513
3 votes
0 answers
61 views

Using ColorFunction Rasterizes the plot

When I make a simple plot using ColorFunction, the Mathematica rasterize the plot. Is anyone else having this issue? Does anyone know a way to avoid this? ...
user avatar
  • 31
1 vote
1 answer
148 views

how to rotate a 3D vector around arbitrary axis

I have three vectors red, blue, and green and their origins are at (x,y,z) where red and blue are perpendicular and can be rotated together in the x-y plane by ...
user avatar
1 vote
1 answer
113 views

Generate a normalized Haar-random vector

What is the procedure to generate a random qutrit quantum state? That is, I want to generate a $3 \times 1$ vector $u$ such that $u$ is generated by a Haar random $3 \times 3$ unitary $U$ multiplied ...
user avatar
2 votes
4 answers
110 views

multi-dimensional interpolating function evaluation and extract dimension

I have an interpolating function which output dimension is greater than 1, so it's a vector. I get it as the result of a NDSolveValue. The problem is that I'm not able to Evaluate it. I would obtain ...
user avatar

1
2 3 4 5
12