siconos.kernel.LagrangianLinearTIDS (Python class)

class siconos.kernel.LagrangianLinearTIDS(*args)[source]

Bases: siconos.kernel.LagrangianDS

Lagrangian Linear Systems with time invariant coefficients - \(M\dot v + Cv + Kq = F_{ext}(t,z) + p\).

The class LagrangianLinearTIDS allows to define and compute a generic ndof- dimensional Lagrangian Linear Time Invariant Dynamical System of the form :

\(M \ddot q + C \dot q + K q = F_{ext}(t,z) + p,\)

where

  • \(q \in R^{ndof}\) is the set of the generalized coordinates,
  • \(\dot q \in R^{ndof}\) the velocity, i. e. the time derivative of the generalized coordinates.
  • \(\ddot q \in R^{ndof}\) the acceleration, i. e. the second time derivative of the generalized coordinates.
  • \(p \in R^{ndof}\) the forces due to the Non Smooth Interaction. In particular case of Non Smooth evolution, the variable p contains the impulse and not the force.
  • \(M \in R^{ndof \times ndof}\) is Mass matrix stored in the SiconosMatrix mass().
  • \(K \in R^{ndof \times ndof}\) is the stiffness matrix stored in the SiconosMatrix K().
  • \(C \in R^{ndof \times ndof}\) is the viscosity matrix stored in the SiconosMatrix C().
  • \(z \in R^{zSize}\) is a vector of arbitrary algebraic variables, some sort of discret state.

The equation of motion is also shortly denoted as: \(M(q,z) \dot v = F(v, q, t, z) + p\)

where

  • \(F(v, q, t, z) \in R^{ndof}\) collects the total forces acting on the system, that is \(F(v, q, t, z) = F_{ext}(t, z) - Cv - Kq\) This vector is stored in the SiconosVector forces()

If required (e.g. for Event-Driven like simulation), reformulation as a first- order system (DynamicalSystem) is possible, with:

  • \(n= 2 ndof\)

  • \(x = \left[\begin{array}{c}q \\ \dot q\end{array}\right]\)

  • rhs given by:

    \[\]
nowrap:

rhs(x,t,z) = left[begin{array}{c} dot q \ ddot q = M^{-1}left[F_{ext}(t, z) - C dot q - K q + p right]\ end{array}right] Its jacobian is:

\[\]

nabla_{x}rhs(x,t) = left[begin{array}{cc} 0 & I \ -M^{-1}K & -M^{-1}C \ end{array}right]

The input due to the non smooth law is:

\[\begin{split}r = \left[\begin{array}{c}0 \\ p \end{array}\right]\end{split}\]

Generated class (swig), based on C++ header Program listing for file kernel/src/modelingTools/LagrangianLinearTIDS.hpp.

Constructors

LagrangianLinearTIDS(array_like (np.float64, 1D) q0, array_like (np.float64, 1D) v0, array_like (np.float64, 2D) M, array_like (np.float64, 2D) K, array_like (np.float64, 2D) C)

constructor from initial state and all matrix operators.

Parameters:
  • q0 – initial coordinates
  • v0 – initial velocity
  • M – mass matrix
  • K – stiffness matrix
  • C – damping matrix
LagrangianLinearTIDS(array_like (np.float64, 1D) q0, array_like (np.float64, 1D) v0, array_like (np.float64, 2D) M)

constructor from initial state and mass matrix only.

Leads to \(M\dot v = F_{ext}(t,z) + p\).

Parameters:
  • q0 – initial coordinates
  • v0 – initial velocity
  • M – mass matrix
C() -> array_like (np.float64, 2D)[source]

get damping matrix (pointer link)

Returns:pointer on a SiconosMatrix
K() -> array_like (np.float64, 2D)[source]

get stiffness matrix (pointer link)

Returns:pointer on a SiconosMatrix
computeForces(double time, array_like (np.float64, 1D) q, array_like (np.float64, 1D) velocity) → None[source]

Compute \(F(v,q,t,z)\).

Parameters:
  • time – the current time
  • q – SP::SiconosVector: pointers on q
  • velocity – SP::SiconosVector: pointers on velocity
display() → None[source]

print the data onto the screen

getC() -> array_like (np.float64, 2D)[source]

get a copy of the damping matrix

Returns:SimpleMatrix
getK() -> array_like (np.float64, 2D)[source]

get a copy of the stiffness matrix

Returns:SimpleMatrix
initRhs(double t) → None[source]

allocate (if needed) and compute rhs and its jacobian.

Parameters:t – time of initialization
isLinear() → bool[source]
Returns:true if the Dynamical system is linear.
jacobianqDotForces() -> array_like (np.float64, 2D)[source]

get \(\nabla_{\dot q}F(v,q,t,z)\) (pointer link)

Returns:pointer on a SiconosMatrix
jacobianqForces() -> array_like (np.float64, 2D)[source]

get \(\nabla_qF(v,q,t,z)\) (pointer link)

Returns:pointer on a SiconosMatrix
setC(array_like (np.float64, 2D) C) → None[source]

set (copy) the value of the damping matrix

Parameters:C – new damping matrix
setCPtr(array_like (np.float64, 2D) newPtr) → None[source]

set damping matrix (pointer link)

Parameters:newPtr – pointer to the new damping matrix
setK(array_like (np.float64, 2D) K) → None[source]

set (copy) the value of the stiffness matrix

Parameters:K – new stiffness matrix
setKPtr(array_like (np.float64, 2D) newPtr) → None[source]

set stiffness matrix (pointer link)

Parameters:newPtr – pointer to the new Stiffness matrix