File kernel/src/modelingTools/LagrangianCompliantR.hpp

Go to the source code of this file

class LagrangianCompliantR : public LagrangianR
#include <LagrangianCompliantR.hpp>

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

ACCEPT_STD_VISITORS()
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 computeJacg(double time, Interaction &inter)
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.

Protected Functions

LagrangianCompliantR()

default constructor

void _zeroPlugin()

To initialize all the plugin functions with NULL.

ACCEPT_SERIALIZATION(LagrangianCompliantR)

serialization hooks

virtual void checkSize(Interaction &inter)

check sizes of the relation specific operators.

Parameters

void initialize(Interaction &inter)

initialize G matrices or components specific to derived classes.

Parameters

Protected Attributes

SP::PluggedObject _pluginJachlambda

LagrangianR plug-in to compute h(q,lambda,z)

Parameters
  • sizeDS: : sum of the sizes of all the DynamicalSystems involved in the interaction
  • q: : pointer to the first element of q
  • sizeY: : size of vector y (ie of lambda and of the interaction)
  • lambda: : pointer to lambda of the interaction
  • y: : pointer to the first element of y
  • sizeZ: : size of vector z.
  • z: : a vector of user-defined parameters