# Class LagrangianR¶

class LagrangianR : public Relation

Lagrangian Non Linear Relation (generic interface)

This class is an interface for specific Lagrangian Relations used for Lagrangian dynamical systems.

• $$y = h(t,q,\dot q,\ldots)$$ describes the constraint (the relation)

• The Jacobian of the constraints with respect to the coodinates $$q$$ i.e. $$\nabla^T_q h(t,q,\dot q,\ldots)$$ , is accessed with jachq().

This Jacobian is mainly used for Newton linearization and to compute the time-derivative of the constraint,

$$y = h(q,\ldots)$$ that is $$\dot y (t) = \nabla^T_q h(t,q,\dot q,\ldots) (q) \dot q +\ldots$$

This object can also store more general linearized part of the gap function. If $$y=h(q)$$ models a gap function, then the time derivative can be generically written as

$$\dot y (t) = H(q,\ldots) \dot q +\ldots.$$ The matrix $$H(q,\ldots)$$ can also be accessed using jachq().

• The Jacobian of the constraints with respect to the generalized velocities $$\dot q$$

i.e. $$\nabla^\top_{\dot q} h(t,q,\dot q,\ldots)$$ is accessed using jachqDot().

• The time-derivative of Jacobian of the constraints with respect to the generalized coordinates $$q$$

i.e. $$\frac{d}{dt} \nabla^\top_{q} h(t,q,\dot q,\ldots).$$ , is accessed using dotJachq().

This value is useful to compute the second-order time&#8212;derivative of the constraints with respect to time.

All these operators can be defined with user-defined plugins.

Public Functions

virtual ~LagrangianR() noexcept = default

destructor

inline virtual void initialize(Interaction &inter) override

initialize the relation (check sizes, memory allocation …)

Parameters

inter – the interaction using this relation

inline SP::SimpleMatrix jachq() const

get a pointer on matrix Jach[index]

Returns

a pointer on a SimpleMatrix

inline void setJachqPtr(SP::SimpleMatrix newPtr)

set Jach[index] to pointer newPtr (pointer link)

Parameters

newPtr – the new matrix

virtual void display() const override

main relation members display