System assembly
Assembling equations of motion is done within the C++ class CSystem
, see the file CSystem.cpp
.
The general idea is to assemble, i.e. to sum up, (parts of) residuals attributed by different objects. The summation process is based on coordinate indices to which the single equations belong to.
Let’s assume that we have two simple ObjectMass1D
objects, with object indices \(o0\) and \(o1\) and having mass \(m_0\) and \(m_1\). They are connected to nodes of type Node1D
\(n0\) and \(n1\), with global coordinate indices \(c0\) and \(c1\).
The partial object residuals, which are fully independent equations, read
where \(RHS_{c0}\) and \(RHS_{c1}\) the right-hand-side of the respective equations/coordinates. They represent forces, e.g., from LoadCoordinate
items (which directly are applied to coordinates of nodes), say \(f_{c0}\) and \(f_{c1}\), that are in case also summed up on the right hand side.
Let us for now assume that
Now we add another ObjectMass1D
object with object index \(o2\), having mass \(m_2\), but letting the object * again* use node \(n0\) with coordinate \(c0\).
In this case, the total object residuals read
It is clear, that now the mass in the first equation is increased due to the fact that two objects contribute to the same coordinate. The same would happen, if several loads are applied to the same coordinate.
Finally, if we add a CoordinateSpringDamper
, assuming a spring \(k\) between coordinates \(c0\) and \(c1\), the RHS of equations related to \(c0\) and \(c1\) is now augmented to
The system of equation would therefore read
It should be noted, that all (components of) residuals (‘equations’) are summed up for the according coordinates, and also all contributions to the mass matrix. Only constraint equations, which are related to Lagrange parameters always get their ‘own’ Lagrange multipliers, which are automatically assigned by the system and therefore independent for every constraint.