# Class LagrangianCompliantR¶

class LagrangianCompliantR : public LagrangianR

Lagrangian Compliant Relation: Scleronomous, Non-Holonomic (function of lambda).

$$Y[0] = y = h(q,\lambda(t),z)$$

$$Y[1] = \dot y = G0(q,\lambda(t),z)\dot q + G1((q,\lambda(t),z)\dot\lambda(t)$$

$$p = G0^t(q,\lambda(t),z)\lambda(t)$$

with $$G0(q,\lambda(t),z) = \nabla_q h(q,\lambda(t),z)$$ $$G1(q,\lambda(t),z) = \nabla_{\lambda}h(q,\lambda(t),z)$$

h, G0 and G1 are connected to user-defined functions.

Public Functions

LagrangianCompliantR(const std::string &pluginh, const std::string &pluginJacobianhq, const std::string &pluginJacobianhlambda)

constructor from a set of data

Parameters
• pluginh: the name of the plugin to compute h

• pluginJacobianhq: the name of the plugin to compute the gradient of h w.r.t q

• pluginJacobianhlambda: the name of the plugin to compute the gradient of h w.r.t $$\lambda$$

virtual ~LagrangianCompliantR()

destructor

virtual void computeh(double time, SiconosVector &q, SiconosVector &lambda, SiconosVector &z, SiconosVector &y)

compute y = h(q,v,t) using plug-in mechanism

Parameters
• time: the current time

• q: vector of coordinates

• lambda: vector for

$\lambda$

• z: parameter vector

• y: vector for y

void computeInput(double time, Interaction &inter, unsigned int level = 0)

to compute the input

Parameters
• time: the current time

• inter: the Interaction owning lambda

• level: “derivative” order of lambda used to compute input

void computeJach(double time, Interaction &inter)

compute all the H Jacobian

Parameters
• time: the current time

• inter: the interaction using this relation

virtual void computeJachlambda(double time, SiconosVector &q0, SiconosVector &lambda, SiconosVector &z)

compute the jacobian of h w.r.t.

$$\lambda$$ using plug-in mechanism

Parameters
• time: current time

• q0: coordinates

• lambda: vector for

$\lambda$

• z: vector of parameters

virtual void computeJachq(double time, SiconosVector &q, SiconosVector &lambda, SiconosVector &z)

compute the jacobian of h w.r.t.

q using plug-in mechanism

Parameters
• time: current time

• q: vector of coordinates

• lambda: vector for

$\lambda$

• z: parameter vector

void computeOutput(double time, Interaction &inter, unsigned int derivativeNumber = 0)

to compute output

Parameters
• time: the current time

• inter: the Interaction owning y

• derivativeNumber: the number of the derivative to compute, optional, default = 0.