Skip to main content
9 votes
Accepted

FEM for vector valued problems: reference request

Short answer: Just replicate the vector of interpolation functions into a block-diagonal matrix, as showed e.g. on page 5 in this lecture note. Detailed answer: Mathematically oriented texts typically ...
Zoltan Csati's user avatar
5 votes

k nearest neighbors dictionary for vectors?

What you're describing is also a critical step in the k-nearest-neighbours method. So no need to reinvent the wheel, we can just look how other people have sped up that algorithm. I don't know about ...
Thijs Steel's user avatar
  • 1,723
4 votes

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

The short answer is "It depends". Certainly, you can try to find the Helmholtz decomposition on your sampled data, and find your irrotational and solenoidal components. However, there are certain ...
Anton Menshov's user avatar
  • 8,672
4 votes

FEM for vector valued problems: reference request

We can show how it works on the example of linear elasticity. In classical finite elements formulations, on every node, we will have a scalar shape (base) function to which we have associated number ...
likask's user avatar
  • 906
4 votes

In Eigen, can a sparse matrix contain vectors/objects instead of simple scalar values?

Certainly. There are a few things you have to define for your type that are listed on this page in the documentation: https://eigen.tuxfamily.org/dox/TopicCustomizing_CustomScalar.html It basically ...
Tyler Olsen's user avatar
  • 1,512
3 votes
Accepted

Algorithm to merge two polygons (using connectivities)?

Easy: Decompose the polygons into (unoriented) line segments each of which is sorted by vertex index: $$ A = \{[1,2], [2,3], [3,4], [4,5], [1,5]\}, \\ B = \{ [1,6], [6,7],[7,8],[3,8], [2,3], [1,2]...
Wolfgang Bangerth's user avatar
2 votes

Plotting or Visualizing a Higher dimensional vector field

Somehow I have to use t-sne, but I really don't know how. Since you have a PhD my answer will be brief, it's quite a lengthy subject. The aim of dimensionality reduction is to preserve as much of ...
Rob's user avatar
  • 121
2 votes
Accepted

Vector characterization of cylinder displacements in a box

You're correct, if the orientational vector is unitary. Otherwise you must calculate the unitary vector in the direction of $\vec{O}_1$ and then perform the projection (just divide by the norm of the ...
The Doctor's user avatar
2 votes
Accepted

How to deal with numerical errors in electrostatic field calculations

I will try to answer the part of the question regarding the accuracy of the calculation, which certainly affects all the other things. Integrals of the type ($T_j$ denoting the $j$th triangle in the ...
Anton Menshov's user avatar
  • 8,672
2 votes
Accepted

Find representatives of vector-space in set of vectors?

You can think of each vector as a point in your linear space. As such, we can use a simple quadtree/octree-like algorithm to map your points into boxes, with "nearby" vectors assigned to the same or ...
smh's user avatar
  • 673
2 votes

In Lanczos algorithm, can we choose the staring vector to be the first eigenvector of the input matrix A?

Of course you can! The starting vector is completely arbitrary. You'll get breakdown at step 1 if you do though. Be sure to check what it entails. This will typically happen by a "happy accident&...
Federico Poloni's user avatar
1 vote
Accepted

Computing excited states using itensor (with DMRG)

For anyone interested in this problem, I found the following solution: ...
brzepkowski's user avatar
1 vote
Accepted

Solving Vectorial Poisson Equation in FENICS

Ok I will answer my own question: The problem is in the line solve(L==a,A,bc) which needs to be replaced by solve(a==L,A,bc). ...
Mantabit's user avatar
  • 121
1 vote

Find representatives of vector-space in set of vectors?

Initialize the cluster centers as your subset $V\in X$, where $V=\{x_i\}$. Then run a couple of K-mediods iterations. After that you will see that the certain vectors will come closer, essentially ...
Tolga Birdal's user avatar
  • 2,229
1 vote

Find representatives of vector-space in set of vectors?

Sounds like you want to thin your data where it is dense, and learn the support of your data summarized by data points. If you don't have too many points, you can generate a distance matrix, and prune ...
Memming's user avatar
  • 870
1 vote
Accepted

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

After some searching I found a C/C++ function called project() in the article 'Real-Time Fluid Dynamics for Games' by Jos Stam http://www.dgp.toronto.edu/people/stam/reality/Research/pdf/GDC03.pdf I ...
Bart's user avatar
  • 141
1 vote
Accepted

two level iterators C++

While I don't state this to be an optimal implementation or one taking into account the all edge cases, below is a sample implementation I put together for your task that can give you an idea of how ...
spektr's user avatar
  • 4,258
1 vote

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

From your comment "The plot emphasises expectedly the connections of node 1", I guess that maybe the idea is showing that node 1 is connected not only to a set of nodes that are "one close to the ...
Federico Poloni's user avatar
1 vote

Efficiently approximating sum of 2-norms

If you just want an approximation to the sum of their norms, you can choose a random sample of $m$ of the indices (i.e., a random set $S \subseteq \{1,2,\dots,N\}$ of size $m$) and compute $$f(\...
D.W.'s user avatar
  • 477

Only top scored, non community-wiki answers of a minimum length are eligible