Questions tagged [vector]

Mathematical vectors, operations on vectors and vectorized programming.

Filter by
Sorted by
Tagged with
4 votes
2 answers
114 views

How to call a list of pure functions/pure vector function? [closed]

In one dimension, pure functions work as usual: f = Function[{x}, 2 x] f[a] However, with a list of pure functions / a vector pure function this does not work with ...
faber's user avatar
  • 81
0 votes
0 answers
22 views

Polynomials as an infinite sized tuple vector [migrated]

Can I consider a vector space which contains the set of polynomial functions as an infinite-sized tuple vector space? for example, let us consider a vector space (V) (which is defined over R) which ...
Qwe Boss's user avatar
8 votes
6 answers
457 views

How to create an array from all combinations of the vector components?

Say I have vectors {a,b,c} and {w,x,y,z}. How can I get Mathematica to output an array ...
A P's user avatar
  • 83
4 votes
1 answer
127 views

Forcing Explicit Parentheses in Traditional Form

I have an expression in input form for the Cosine of a dihedral angle: ...
Stuart Poss's user avatar
  • 1,883
0 votes
1 answer
55 views

Optimized and compact code for tensor product

I am calculating products like in mathematica. In the given relations eta's are four vectors, $\gamma$'s are the Dirac matrices, $\sigma^{\mu\nu}$ is the anticommutation of the gamma matrices and ...
Zohaib Aarfi's user avatar
0 votes
0 answers
44 views

Finding coefficient of vector expression when using SuperLie package

I'm using the SuperLie package and using that have defined a Lie superalgebra with an ordered basis: ...
AXidenT's user avatar
  • 133
1 vote
0 answers
118 views

RG flow trajctory plot using StreamPlot

I have three flow (beta-function) equations: $\frac{dA}{dl}=-(B^2+C^2)$, $\frac{dB}{dl}=(2-4A)B$, $\frac{dC}{dl}=(2-A)C$, where $A=\pi/(2\arccos(-(x+y)/2)$, $B=(x+y)/2$ and $C=(x-y)/2$. I can make a ...
Barry's user avatar
  • 123
4 votes
2 answers
81 views

Easy way to plot a vector as an arrow

Is there an easy way to use the Mathematica command Plot to draw a vector arrow from one point p1 to a second point p2? Like in the plot below where p1=(0,0) and point p2=(4,6)? I got it to work ...
Chris O's user avatar
  • 91
1 vote
2 answers
49 views

Strange behavior when integrating vector valued piecewise function

The following straightforward integral should clearly equal $\{0,0\}$ for any $R\in\mathbb R$: ...
Funktorality's user avatar
2 votes
1 answer
78 views

Delete Null factors out of vector components

After running a very long loop, I get the following result given by a very long vector: ...
Daniel Vainshtein's user avatar
0 votes
0 answers
32 views

How to find clear solution for iterative problem by condition $<v_k ,v_n>=0$ If $k!=n$

I want to find x[n] by v[n] values without x[n] in solution by iterative below problem: <...
user68119's user avatar
3 votes
2 answers
487 views

Rendering of arrowheads in 3D

I have a vector-valued function and vectors have been drawn with Arrow for visualization purposes. ...
Syed's user avatar
  • 48.9k
9 votes
3 answers
2k views

Mimicking Günther Uecker's nail art

One of my favourite contemporary artists is Günther Uecker (born 13 March 1930 in Crivitz, Germany). He uses hammer and nails to create VectorPlot-like structures. ...
eldo's user avatar
  • 61.6k
0 votes
1 answer
98 views

Scalar product of vectors using dummy indices

How can I rewrite the following expression $expr1= (A\cdot B)(C\cdot D)(E\cdot F) + (A^\prime\cdot B^\prime)(C^\prime\cdot D^\prime)(E^\prime\cdot F^\prime) +\cdots $ in terms of the components as $...
Harken's user avatar
  • 95
0 votes
0 answers
93 views

Solve does not find solutions to large equation rotation matrix

I've been seeing some posts already where people mention Solve needs a bit of help to get things solved in some scenarios. I have been trying to figure out the solutions for equations. For the XYZ ...
Jose's user avatar
  • 11
1 vote
1 answer
128 views

Using "Table[]" to create a matrix without submatrices [duplicate]

I'm trying to create a certain 6x6 matrix using Mathematica's in-built "Table[]" function and have landed on ...
ConfusedCabbage's user avatar
0 votes
3 answers
111 views

Generalize the code to more variables

I have this code it runs and gives me the solution. How can I make it more compact and If I want it to extend(generalize) it to more variables how can I do it. I had asked a similar question here (...
Learner's user avatar
  • 219
1 vote
1 answer
75 views

Modify the size of vectors in vectorplot3D

I'm trying to plot in the neighborhood of the origin and I can't change the shape and size of the arrows. What I need is to be sure whether or not the solutions are attracted to the line that goes ...
Roberto De Arcia's user avatar
1 vote
2 answers
51 views

Extracting integers from a Dataset containing variables

I want to extract two vectors DataA = {1,0,0,0} and DataB = {0,2,5,0} from a dataset. I tried a few ways including using the dataset and ...
krygh's user avatar
  • 159
1 vote
2 answers
98 views

Can you recover the original vectors that, when summed together, achieved a particular criteria

I am wondering if it is possible to take the binary strings of length $3$ (tuples) whose sums have weight $2$ (i.e they have $2$ non-zero entries)(binary case, meaning they have two $1$'s entries) $$u ...
am567's user avatar
  • 491
1 vote
1 answer
30 views

How to find and delete the duplicates from lists of vectors

What I want to do is to take a list of vectors: u={{1,0,0,0},{0,1,0,0},{0,0,1,0}} v={{1,1,1,1},{1,0,0,0},{0,1,0,0}} I want to find the duplicates between u and v ...
am567's user avatar
  • 491
1 vote
0 answers
72 views

Mapping two pure functions over different lists

Say if I have two lists of vectors of the same length, for example: u = {{1,0,0},{0,1,0},{0,0,1}} v = {{1,0,1},{1,1,0},{1,1,1}} I want to add (modulo 2) ...
am567's user avatar
  • 491
0 votes
1 answer
87 views

Labelling vector state variables for solution of system of ODEs

This might be a duplicate, but I have not seen this problem addressed for DSolve usage. I have a system of ODEs of the form Y' = AY + B When we put this into Mathematica as a vector variable: ...
Nicola Gambaro's user avatar
1 vote
2 answers
49 views

How to delete duplicate lists of vectors (in any order) from a list of lists?

I have a list of vectors: v={{{0,0,0},{0,0,1},{1,1,0}}, {{1,0,0},{1,1,1},{0,1,1}}, {{0,0,1},{0,0,0},{1,1,0}}} Clearly, the first entry and the third entry contain the same vectors. I want to delete ...
am567's user avatar
  • 491
1 vote
1 answer
111 views

Extend the code for more variables (at least 100)

I have this code (not in best shape) for a problem in 3 variables. It does the job. The problem is I want to extend this to more number of variables around 100 at least. It is very painful to extend ...
Learner's user avatar
  • 219
0 votes
2 answers
69 views

Understanding SetDelayed, ":=" [closed]

Consider the example below, p = {1, 2, 3}; x = {x1,x2,x3}; fun[x_] := {{1, 0, 0}, {0, 1, 1}} . (p + x); fun2[x_] = {{1, 0, 0}, {0, 1, 1}} . (p + x); I expected <...
Adriana LE's user avatar
15 votes
1 answer
1k views

Visualizing gravity warping the fabric of spacetime

What is a stable way of creating a set of points that are attracted to a single moving point? I have tried the following: ...
martin's user avatar
  • 8,668
1 vote
1 answer
95 views

Vector 3d Plotting with New Mathematica Version

Hi Used to use the old version of Mathematica back in 2020. Now the new version is updated and I am trying to run the old code in the new version. My vector plots are very different. I wonder what I ...
physicsu83's user avatar
2 votes
1 answer
184 views

3d Vector Wrap of Half sphere

How I can plot the flowing image using Mathematica? Thanks,
physicsu83's user avatar
2 votes
1 answer
48 views

NMaximize with generic domain

I want to have a function that gets generic domain and function and does maximum on this domain. For this I tried the following straight-forward code: ...
user2679290's user avatar
4 votes
2 answers
167 views

Two simple vector partition rules

We have a vector of zeros and other numbers, f.e: vector = {0, 0, 0, 9, 0, 2, 0, 5, 0, 4, 0, 5, 6, 2, 0}; The two rules: Partition the vector in such a way that (1)...
eldo's user avatar
  • 61.6k
0 votes
0 answers
49 views

How to find linearly independent linear combinations of a set of vectors (general case)

If I have a list of vectors, say $v=\{v_{1}, v_{2}, \dots ,v_{n}\}$. Is there a way that I can get all linearly independent linear combinations of these vectors, such that if I change the content of ...
am567's user avatar
  • 491
2 votes
1 answer
80 views

Differentiating unit tangent vector does not work

I am new to Mathematica and I want to visualize the tangent and normal vector field of a particular embedding of the circle. In my code it is [CapitalGamma][s]. When I put the unit tangent vector (uT[...
Ama's user avatar
  • 35
4 votes
1 answer
105 views

Building projection operators efficiently

The projection operator $P$ is defined in quantum mechanics as $$ P=\sum_i^n \vert\psi_i\rangle \langle \psi_i\vert, $$ where $\vert\psi_i\rangle$ is a column vector and $(\langle \psi_i\vert=(\...
wooohooo's user avatar
  • 289
2 votes
0 answers
40 views

Coloring Vector if it points at (0,0,0) or (1,1,1)

I'm trying to plot a 3D vector field on a cubic space between [0,1]. I wanted to color the vectors based on their direction, where if they point towards (0,0,0) or the closer corners (1,0,0), (0,1,0), ...
Alexandre Pires's user avatar
1 vote
2 answers
97 views

Generate family of linear inequalities from vector variable for use in `FindInstance`

Suppose that I have a vector variable xvec = Array[x, 10]. How do I generate the family of linear inequalities $$F = \{ {x\in\mathbb{R}^{10}:x_1\geq x_2,\ldots,x_9\...
rrrrr's user avatar
  • 125
0 votes
1 answer
98 views

Taking the inverse Laplace Transform as a vector operation

I am solving a system of first-order equations using matrix operations and the Laplace Transform. I begin with the matrix equation that represents the solution to my system, like this: $$ \underline{\...
villaa's user avatar
  • 187
0 votes
1 answer
95 views

put vectors inside a vector

I have an empty vector like U = {}. In an iteration, I get u1 = {a, b} and I want to put the vector in U to have {{},{a,b}}. I can do this simply with U = {U, u1} command. But in another iteration, I ...
Mohammad Alinejad's user avatar
0 votes
2 answers
88 views

How to get Mathematica to carry out my computation of a vector norm fully?

I am relatively new to Mathematica, and I have come across the problem where Mathematica often doesn't seem to carry out calculations fully. For example: I have a vector v and want to find its norm, ...
Q.Ask's user avatar
  • 15
4 votes
1 answer
164 views

ConjugateTranspose[#] vs Conjugate[Transpose[#]] for lists [duplicate]

Bug introduced in 12.3 or earlier, fixed in 13.0. I'm getting contradictory behavior for eigenvectors of a matrix when using Conjugate, Transpose and ConjugateTranspose. I'll demonstrate using an ...
Nitin's user avatar
  • 431
1 vote
2 answers
66 views

How to keep arrowheads in successive vectors?

I am generating successive arrows to represent vectors, but when they coincide all the arrowheads disappear except the last. But since they are vectors I want to keep all arrowheads to show direction. ...
cybervigilante's user avatar
0 votes
0 answers
39 views

Optimization over nested variables, vectors and matrices

I am trying to optimize a function that is fairly complicated, but at the end I just want to solve a parametrized assignment problem using integer linear optimization with Mathematica. The main ...
WaterFox's user avatar
  • 185
8 votes
2 answers
363 views

Dot Product and Simplification

How to simplify the expression a b . x/((a b) . x) Where a is a scalar and b and x are vectors. I have tried the usual Simplify, FullSimplify, TensorExpand etc. ...
Breugem's user avatar
  • 785
1 vote
0 answers
58 views

Positioning of Text in a Graphics3D

I have an interesting problem to solve. I want to have Text in a Graphics3D. This can easily be done in the following way: ...
mathematica_guy's user avatar
3 votes
1 answer
87 views

ReplaceAll Elements in an Indexed Vector

Following up on how to define symbolic vectors Let x be an n-dimensional symbolic vector, where n is a positive integer large enough to be a massive pain in the butt. ...
NullPointerException's user avatar
4 votes
2 answers
625 views

How are Symbolic Vectors Defined?

It is my understanding that undefined symbols are considered scalars, so I can't index variables that aren't defined. It is possible to define a symbol as a vector of symbols as follows, allowing ...
NullPointerException's user avatar
0 votes
1 answer
85 views

Could Mathematica analytically work with operators (such as $\nabla$) and vectors?

I have the following expression: $$(\nabla+\vec{P})^2$$ where $P=(r\cos\theta sin\phi,r^4\sin\theta,r\cos^3\phi)$ I would like to open the brackets and simplify the expression. Are there in ...
Mam Mam's user avatar
  • 1,773
0 votes
0 answers
75 views

Functions for translating a vector from one coordinate system to another

I have a vector $\vec{H}$ with components in Cartesian coordinate system $(x,y,z)$: $\vec{H}=(0,0,H)$. I would like to obtain coordinate of this vector in Spherical coordinate system $(r,\theta,\phi)$....
Mam Mam's user avatar
  • 1,773
5 votes
1 answer
66 views

Assumptions about indexed variables

I am interested in the most efficient way to impose assumptions on indexed variables. In the following stylized problem, the following code ...
oyy's user avatar
  • 187
3 votes
1 answer
103 views

Verifying matrix exponential identity

I wish to verify the following matrix exponential identity using Mathematica: $$ \mathbb{e}^{i.x.\hat{n}.\sigma}= \cos{x}.\mathbb{I}+ i\sin{x}(\hat{n}.\sigma) $$ where $\mathbb{I}$ is the $2\times2$ ...
usernew76's user avatar

1
2 3 4 5
14