Is the the derivation of the following motion equation correct?

58 Views Asked by At

Suppose I have an undirected graph $G = (V,E)$, suppose $|V| = m$ and for each such vertex we associate a point mass $Q_1,\ldots Q_m$. Now we connect $Q_i$ and $Q_j$ with a spring if and only if $(Q_i,Q_j) \in E$.

Now imagine you have such system (call it a mesh) in space, no movement at first. So basically the kinetic energy of the system is given by

$$ T = \sum_{Q_i} \frac{1}{2}\lVert Q_i' \rVert^2 $$

Assume we are in a vector field defined as

$$ U(Q_i) = k_r \sqrt{x_i^2 + y_i^2} + k_g z_i $$

the total amount of potential energy is given by

$$ V = \sum_i U(Q_i) + k_e \sum_i \sum_{j \in \mathcal{N}(i)} \left(\lVert Q_i - Q_j \rVert - l_{ij} \right)^2 $$

The motion equation can be derived by setting $$ 0 = \frac{\partial V}{\partial Q_i} + \frac{d}{dt}\frac{\partial T}{\partial Q_i'} $$

And such equation leads me to

$$ 0 = k_g \hat{e}_3 + k_r \frac{\text{Proj}_{span(e_1,e_2)} Q_i}{\lVert \text{Proj}_{span(e_1,e_2)} Q_i \rVert} + k_e \sum_{j \in \mathcal{N}{i}} \left(\lVert Q_i - Q_j \rVert - l_{ij} \right) \frac{Q_i - Q_j}{\lVert Q_i - Q_j \rVert} + Q_i'' $$

And this lead me to the motion equation

$$ Q_i'' = -k_g \hat{e}_3 - k_r \frac{\text{Proj}_{span(e_1,e_2)} Q_i}{\lVert \text{Proj}_{span(e_1,e_2)} Q_i \rVert} - k_e \sum_{j \in \mathcal{N}{i}} \left(\lVert Q_i - Q_j \rVert - l_{ij} \right) \frac{Q_i - Q_j}{\lVert Q_i - Q_j \rVert} $$

Is the equation correct? (I'm currently simulating it and I'm getting weird results, like instabilities).

What I'm trying to simulate is essentially like stretching some elastic material, assuming it is modelled with a triangular mesh where each triangle's edge has a spring connecting the two adjacent vertices.

The assumptions are uniform mass, I think even considering it it would cancel out.

1

There are 1 best solutions below

4
On BEST ANSWER

Yes, a few things. First off, you used the potential energy of a deflected linear spring to be $k \Delta x^2$, but it's actually $\frac{1}{2} k \Delta x^2$. Secondly, I think deriving the equation of motion for an individual vertex using $F=ma$ is much easier here. You can then just write the equation of motion for an individual particle as:

$$-\nabla U(Q_i) + \sum_{j \in \mathcal{N}(i)} k_{ij} (||Q_i-Q_j||-l_{ij}) \frac{Q_j-Q_i}{||Q_i-Q_j||} = m_i Q''_i $$

Then, if you're encountering stability issues, I would recommend checking that you're using a stable integrator. For equations like this, the Leapfrog or Verlet integrator is common. Leapfrog is easy to implement (explicit), accurate, and stable.