Questions tagged [vector]

Mathematical vectors, operations on vectors and vectorized programming.

71 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
7
votes
0answers
52 views

VectorPlot not localizing variables

Is this a bug or not? u = {{}}; VectorPlot[{1, u^2}, {u, 0, 1}, {z, 0, 0.4}] The VectorPlot works fine if ...
6
votes
0answers
2k views

computation of gradient vector field in 3D using GradientOrientationFilter

I want to compute a 3D gradient vector field of an Image3D object using the built-in GradientOrientationFilter function in Mathematica. From the documentation I ...
5
votes
0answers
303 views

How to verify the convexity of a function?

I have an optimization problem with the following objective function in $(x,y)$ $$ A\log \left(\sum_{i=1}^n x_i\right)+\log\left(1-\frac{f}{n}\left(\sum_{i=1}^n\frac{x_i}{y_i}\right)\right) $$ where $...
4
votes
0answers
101 views

Indicate Unit Vectors in Solve

I'm solving a system defined by two rays. The rays originate from two points {x,y,z} and {x,y,z-h}. They go in directions (unit ...
4
votes
0answers
283 views

How to access the components of a vector-valued interpolating function

I have a problem in accessing the components of a vector-valued interpolating function. I have the following data: data = {{0, {1, 0}}, {1, {0, 1}}}; with a ...
3
votes
0answers
52 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? ...
3
votes
0answers
66 views

How to digitize a vector field?

Is there some way that I can digitize both the direction and the magnitude of a vector field accessible in JPEG format? To clarify what I mean, I want to have the numerical value of: 1)magnitude and 2)...
3
votes
0answers
166 views

Converting complex equations to matrix form

My question is a continuation of the topic: How to convert equation to vector (matrix) form? It is necessary to separate the components of equations into vectors and matrices and a combination of ...
2
votes
0answers
64 views

Using Curl and Grad in cylindrical coordinates gives different result than in Cartesian

I am doing a quite elementary calculation to verify $$ \vec \nabla\cdot V = \vec\nabla \times \vec A $$ Where $V$ is just some scalar function in $\rho$, $\phi$ and $z$ and $A$ is defined as $$ ...
2
votes
0answers
50 views

12.1 VectorPlot - How to show differing magnitudes in the new implementation

I'm graphing vector fields for a class. Magnitude is important at least initially. In 12.0 and earlier VectorPlot plotted the different magnitudes as length. In 12.1 VectorPlot represents magnitude by ...
2
votes
1answer
77 views

Plotting list data of cross product of field vectors

I have some experimental data points of electric Ey(t, value) and magnetic field Hz(t, value). I am trying to calculate the ...
2
votes
1answer
225 views

Including legend with reference magnitude in a VectorPlot

I'd like to plot a vector field with a legend for the magnitude of a reference vector. I have read all the document of VectorPlot and found only ...
2
votes
0answers
58 views

How to get results in terms of vector operations?

Is there a simple way to simplify an expression in terms of vector operations? For example, when I evaluate this; ...
2
votes
0answers
69 views

How to represent arbitrarily dimensioned vectors in mathematica?

I've seen here that vectors in Mathematica can be represented as lists. I was recently trying to do the computation Solve[(a + (x-1)*b).b==0, x] where a and b are ...
2
votes
0answers
151 views

Plot trackers for defects in vector field

I plot some defect configurations like these and I would like to be able to add some trackers on top of them, similar to these: A much simpler working example of the first picture can be produced ...
2
votes
0answers
184 views

Vector field reconstruction

I have a time series (a sequence of 2D points), and I would like to reconstruct a vector field that contains this path. Here is my data (each successive point is sampled 1 second later): ...
2
votes
0answers
2k views

StreamPlot in 3 Dimensions

I would like to plot the vector equation $\left( {\begin{array}{*{20}{c}} {\frac{{ - a + \sqrt {{a^2} + 4bc} }}{c}}\\ {\frac{{ - a - \sqrt {{a^2} + 4bc} }}{c}}\\ 1 \end{array}} \right)$ as a stream ...
2
votes
0answers
154 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
0answers
52 views

Grouping vectors into groups of 3 by attribute

Three groups are given, each with eight $3 \times3$-vectors: ...
1
vote
0answers
49 views

StreamPlot works slow with analitical functions

I'm day to day user in Mathematica, that's I will be happy to any kind of help in code optimisation. So, I try to plot gradient for beatings between two laser modes and plot intensity, phase and phase ...
1
vote
1answer
99 views

VectorScaling on VectorPlot produces vectors of wrong length

I'm trying to plot the following VectorField: VectorPlot[{x/Sqrt[x^2 + y^2], y/Sqrt[x^2 + y^2]}, {x, -5, 5}, {y, -5, 5}] I want to use a VectorScaling-option such ...
1
vote
0answers
35 views

Arrowheads from VectorPlot3D not rendering when exported as STL

I am trying to export VectorPlot3D output to an STL file (or any 3D format). My goal is to allow my students to use Augmented Reality to better visualize the vector field. However, when I export to ...
1
vote
0answers
63 views

How to write a program on gradients and the path for steepest ascent?

I'm given two functions f[x ,y ]=Cos[x]*Cos[y]/(6+x^2+y^2) and df[x ,y ]=Grad[F[x,y],{x,y}] I was given a note that ...
1
vote
0answers
54 views

How to use Solve[] properly to find an integer 3d vector solution to an equation with a condition?

I didn't use Mathematica for years and I am VERY rusty regarding the best way to solve this problem : 2*vectk.vectG = G^2, k = 2*pi/lambda I have the G vector and I want to find all vector k that can ...
1
vote
1answer
98 views

Plot a sum of vectors using inline free format or wolframalpha. What is the hidden code?

Using Wolframalpha or inline free format you can obtain a nice representation of a sum of vectors. An example is shown below. Whish is the hidden code? (or a code that make the same representation). ...
1
vote
1answer
145 views

Import OVF 2.0 Vector field files

I'm using a simulation software (mumax3) which outputs OVF_2.0 files. It can either export binary or text files. The binary files are usually much smaller than the text files. I would like to use the ...
1
vote
0answers
70 views

LeviCivitaTensor contraction indices

My computer has problems when I try to perform a calculation with TensorContract. In particular, with the second answer to my previous question Contracting indices ...
1
vote
0answers
97 views

How to use Mathematica to find the coordinates of 7 points?

Could anyone please help me with using Mathematica to find the coordinates of 7 equally spaced points on the unit sphere $S^3$ in $\mathbb{R}^4$? Thanks a lot!
1
vote
0answers
64 views

Minimal and maximal angular separation of two spheres as viewed from surface of third sphere

Short version: find the values of theta and phi that make overlapValue (defined below) maximal and the values of theta and phi that make it minimal, given that all other values are constants and ...
1
vote
0answers
89 views

Vector Color function usage

Can anyone explain why there is a difference between following plots: ...
1
vote
0answers
59 views

VectorPlot interval as a union of intervals

What would you suggest me to do if I want to use VectorPlot in a certain region of a plane? e.g.: ...
1
vote
0answers
35 views

Text misalignment in vector graphic format export

In converting a number of old notebooks into a format for e-readers, Mathematica has some issues with vector formats. SVG export would have been ideal to use, but the exporter fails to recognize, for ...
1
vote
0answers
65 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 = ...
1
vote
0answers
80 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
125 views

Plot vectors read in from file

From a file, I read in vectors and their origins. I construct a table from this which I want to plot in 3 dimensions. However, the ListVectorPlot3D only shows an ...
1
vote
0answers
95 views

plot a (r,phi) vector in 3D

I have a vector, with its 3 components function just of the position in the x,y plane (as r, phi): ...
1
vote
0answers
569 views

Symbolic derivatives with vectors and matrices

I'm currently trying to solve some problems using symbolic vectors and matrices of arbitrary size. However, I have some problems with understanding and verifying the results: I defined the vectors as ...
1
vote
0answers
125 views

Performance tuning with memoisation, compilation and vectorization - further possibilities?

In order to tune the performance of noticeably slow code of mine, I had a look at many different excellent posts on this topic here on M.SE, e.g. here to name the most interesting one. Now I ask ...
1
vote
0answers
136 views

Orthonormal Preserves Angle Between Vectors

Consider: U = {{4/5, 3/5}, {3/5, -4/5}}; u1 = {1, 3}; u2 = {-1, 3}; VectorAngle[u1, u2] VectorAngle[U.u1, U.u2] Which produces this output: ArcCos[4/5] ArcCos[4/...
1
vote
0answers
54 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: ...
1
vote
0answers
263 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
0answers
199 views

Ray tracing: Insufficient precision

I am writing a ray tracer to find the intersection point between a single ray and a cylinder. ...
1
vote
0answers
113 views

Solving for vector elements in a function to which the vectors are not passed explicitly

I want to define a function which takes in two integers (indicating the lengths of 2 vectors), and solves a simple set of expressions at a set of points to find all the values in both the vectors. so ...
0
votes
0answers
54 views

piecewise vector field and composition of piecewise functions

I have the following vector field ...
0
votes
0answers
33 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 ...
0
votes
0answers
55 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 ...
0
votes
0answers
31 views

How To Define Indexed Vectors

I have to define two 2-D vectors to be multiplied by a matrix and multiplied by several Clebsch-Gordan coefficients. Below are my definitions and my attempt at computing the sum. ...
0
votes
0answers
30 views

Looking for a starting point to solve a PDE with vector-coefficients

I am looking for a good source for Mathematica in order to solve a PDE with vector coefficients. I have found this: https://reference.wolfram.com/language/FEMDocumentation/tutorial/SolvingPDEwithFEM....
0
votes
2answers
97 views

How can I create and plot (in the same diagram) 1000 different vectors in Mathematica?

I'm new to Mathematica and I got stuck. Also, I'm not a programmer, so I would like to ask the following question. I want to make 1000 different vectors, of which everyone contains 55 random elements. ...
0
votes
0answers
41 views

Steam plotting of vector field showing empty output

I am trying to plot the stream lines for a vector field function, whose definition is exported to the wdx file uploaded here. The following simple code returns an empty plot: ...