Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [vector]

The tag has no usage guidance.

1
vote
1answer
78 views

Calculate xyz velocity vectors for circular orbit

I'm trying to calculate the xyz velocity vectors for a circular orbit given a set of position vectors, but I can't seem to get it right. The formula for obtaining the velocity magnitude is the ...
3
votes
1answer
52 views

Plotting or Visualizing a Higher dimensional vector field

I am trying to visualize a higher dimensional vector field. Is there a way to do this. I asked this question here, I was told to post it here. As an example, one can use $$\begin{eqnarray} \dot{x}...
3
votes
1answer
63 views

Vector characterization of cylinder displacements in a box

We have a cylinder of length $l$ (in units of its radius $d,$ as basic unit of length set to $d=1.$) in a box, and we consider an orthonormal Cartesian coordinate system with its origin placed at the ...
2
votes
1answer
117 views

How to deal with numerical errors in electrostatic field calculations

I want to trace electrostatic field lines emerging from 2D surfaces in 3D space. Eventually I want to find their intersection with an (uncharged) mesh. The charge distribution $\sigma(x), x \in \...
2
votes
3answers
178 views

Find representatives of vector-space in set of vectors?

Suppose I have a multi-dimensional vector space $X$, and a collection of $n$ vectors $\{x_i\}_{i=1}^n \subset X$, which are not evenly "spaced-out" in $X$. I am searching for $m<<n$ of these $...
3
votes
1answer
1k views

How to compute the Helmholtz decomposition of 2D and 3D vector fields?

I have a sample of 100 particles with their 3D positions and velocities. I want to decompose the velocity vector field to its curl free and divergence free components. Is it a feasible to do so for ...
2
votes
1answer
179 views

Software/code to extract a solenoidal (a.k.a. divergence-free) field from a 2D vector field numerically

Can somebody point me to software/code to extract a solenoidal (a.k.a. divergence-free) field from a 2D vector field numerically? There are a plethora of papers and documents describing how to do ...
0
votes
1answer
425 views

two level iterators C++ [closed]

I am trying to implement a two level iterator as I will now describe. Basically I have a "vector of vectors" and I want a single iterator that will loop over all the objects in the vector of vectors. ...
0
votes
1answer
75 views

Regarding solution vector of the wave equation

I am simulating the wave equation using FEM. For a 2D wave equation, when I visualise my output in Paraview, I see a separate solution in 'x' and 'y' direction for each node on the mesh. Therefore, if ...
1
vote
2answers
387 views

Find a permutation matrix (using the Matlab's function $symrcm$) of a matrix $A(2:end, 2:end)$

I've the following Matlab code: r = symrcm(A(2:end, 2:end)); prcm = [1 r + 1]; spy(A(prcm, prcm)); where A should be sparse ...
0
votes
1answer
69 views

Efficiently approximating sum of 2-norms

Suppose I have a real vector $\bf x$ of length $KN$, where $K<<N$. Let's say I break this vector $\bf x$ up into $N$ vectors each of length $K$, $${\bf x}_1,...{\bf x}_n.$$ Now I would like ...
0
votes
2answers
3k views

Plot vector field in matlab

I have the function of an electric dipole expressed in cartesian coordinates and I want to create the vector field using Matlab . The function is $$E_z= \frac{p}{4\pi\epsilon_0} \cdot \left(\...
4
votes
0answers
293 views

Numerically calculating the divergence of a set of oriented points

Say I have a set of oriented points at locations $\vec{v_i}$ with each some direction $\vec{n_i}$, in practice they represent the normals of some surface that has been non uniformly sampled. How would ...
1
vote
2answers
53 views

Arranging variable ranges into a cell MATLAB

I have the following simple code v=[]; for i=10:-1:1 for j=0:0.2:5 v(end+1)=i+j; end end min(v) It returns the minimum of vector $v$ whose length in this ...
0
votes
2answers
164 views

Vector and index notation equivalence

Given 2 vectors $\mathbf{u}$ and $\mathbf{v}$ the following are equivalent: $\mathbf{u}\cdot\mathbf{v}$ $\mathbf{u}^T \mathbf{v}$ $u_i v_i$ $v_i u_i$ $\mathbf{v}\cdot\mathbf{u}$ $\mathbf{v}^T\...
3
votes
1answer
260 views

Sparse matrix vector product using PETSC

I am trying to do a simple parallel sparse matrix vector multiplications using PETSC. My sparse matrix is a simple tridiagonal laplacian matrix, which is distributed over multiple processors using ...
0
votes
2answers
259 views

Rotate 2D shape around origin in a 3D space

I have a 2D square ABCD in a 3D space, with side length 2s, that is represented by four vectors (one for each vertex) and a fifth vector ...
3
votes
2answers
278 views

Direct Numerical Simulation of reacting flows

I need to write a DNS code for simulating reacting flows in turbulent conditions. The code has to be highly scalable, because the computational cost of simulations is expected very large. My idea is ...
0
votes
0answers
380 views

3D animation of a vector field (ParaView) [duplicate]

I am trying to create an animation of a 3d vector field in ParaView. All my data is in three matrices (201 x 201 x 201) corresponding to vectors components in x,y,z directions. And it's calculated in ...
1
vote
0answers
332 views

Get a single value from a global Vec in petsc [closed]

I don't understand the concept with local and global vec's in petsc when it come to DMDAVecGetArray and VecGetValues. I'm creating some DMDA Vec in parallel which works well. Now I want to access ...
0
votes
1answer
106 views

What is the best method to combine multiple vectored results into one chart?

Currently I am working on my research report where I've done a lot of measurements. For now I have uploaded everything into Matlab and visualise each on chart. Each one consists of 4 lines drawn with ...
7
votes
2answers
2k views

How can one produce a proper streamline plot?

I recently had trouble producing a proper streamline plot in Mathematica, and apparently the problem is a good bit harder than I appreciated. I would like to know if there exist general algorithms to ...
4
votes
1answer
117 views

Reconciling vector and scalar notation

I am trying to derive Galerkin type weak formulation for the Stokes equations. I'm having a bit of a problem reconciling the notation in the integration by parts. I know that the answer I'm looking ...
1
vote
0answers
40 views

Understanding the use of Minimum Translation Vector (MTV) for an elastic collision response

So, I'm trying to simulate polygon rigid body physics, both linear and angular. To calculate the MTV is easy in SAT (Minimum Translation Vector), and to use it to adjust position is also easy: ...
1
vote
1answer
67 views

Accurate dot-product of fields with only knowing normals

I am trying to accurately calculate $\vec{j} \cdot \vec{E}$ for an electron energy equation on a finite-volume mesh. $\vec{j}$ is the electron current density, and $\vec{E}$ is the electric field. ...
2
votes
1answer
2k views

Angular Velocity by Vector - 2D

This is originally a problem in programming, but since almost no one on Stackoverflow know how to solve this I went here instead; https://stackoverflow.com/questions/23003612/javascript-angular-...
1
vote
1answer
710 views

Coding complex equations into C++

I have here equations from a paper by E. Bradlow. They're for counting the events in a Weibull-distributed data set. $$\begin{align} \Pr(N(t)=n) &= \sum_{j=n}^\infty{\frac{(-1)^{j+n}(\lambda t^c)^...
2
votes
1answer
85 views

How can I efficiently position the different segments of a large vector in Eigen C++?

I have a very large(up to 9 000 000) VectorXi vector defined in Eigen C++ which is read from a data file. The vector consists of 0, 1, 2, ...n segments with ...
2
votes
1answer
124 views

combine $n$ vectors using $L2-normalization$

Suppose that I have the following vectors $v_1$, $v_2$, $v_3$ $\in R^n$,$n= 9$. What I want to do exactly is to combine these $3$ vectors into $1$ representative vector $V$. According to the ...
3
votes
1answer
3k views

How to change the dimensions of an Eigen Matrix in a loop?

I have a while loop, in which I use a Matrix A, vectors B and x with varying dimensions: <...
2
votes
1answer
142 views

Numerically efficient way to compute sparse-matrix arithmetic on GPU?

Can anyone tell me some very good/efficient numerial algorthims for GPU/CUDA to compute multiplication/ between sparse matrices (its good if you can recommend me some research papers)? I googled ...