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() noexcept = default
destructor
-
virtual void computeh(double time, const BlockVector &q, const SiconosVector &lambda, BlockVector &z, SiconosVector &y)
to compute the output y = h(q,z) of the Relation
- Parameters:
time – current time value
q – coordinates of the dynamical systems involved in the relation
lambda – interaction \( \lambda \) vector
z – user defined parameters (optional)
y – the resulting vector
-
virtual void computeJachq(double time, const BlockVector &q, const SiconosVector &lambda, BlockVector &z)
to compute the jacobian of h(…).
Set attribute _jachq (access: jacqhq())
- Parameters:
time – current time value
q – coordinates of the dynamical systems involved in the relation
lambda – interaction \( \lambda \) vector
z – user defined parameters (optional)
-
virtual void computeJachlambda(double time, const BlockVector &q0, const SiconosVector &lambda, BlockVector &z)
compute the jacobian of h w.r.t.
\( \lambda \) . Set attribute _jachlambda (access: jacqhlambda())
- Parameters:
time – current time value
q – coordinates of the dynamical systems involved in the relation
lambda – interaction \( \lambda \) vector
z – user defined parameters
-
virtual void computeOutput(double time, Interaction &inter, unsigned int derivativeNumber = 0) override
to compute output
- Parameters:
time – the current time
inter – the Interaction owning y
derivativeNumber – the number of the derivative to compute, optional, default = 0.
-
virtual void computeInput(double time, Interaction &inter, unsigned int level = 0) override
to compute the input
- Parameters:
time – the current time
inter – the Interaction owning lambda
level – “derivative” order of lambda used to compute input
-
virtual void computeJach(double time, Interaction &inter) override
compute all the H Jacobian
-
inline virtual void computeJacg(double time, Interaction &inter) override
compute all the G Jacobian
-
ACCEPT_STD_VISITORS()#
Protected Functions
-
ACCEPT_SERIALIZATION(LagrangianCompliantR)#
-
inline LagrangianCompliantR()#
default constructor
-
virtual void initialize(Interaction &inter) override#
initialize G matrices or components specific to derived classes
- Parameters:
inter – : the Interaction
-
virtual void checkSize(Interaction &inter) override#
check sizes of the relation specific operators.
- Parameters:
inter – an Interaction using this relation
-
virtual void _zeroPlugin() override#
To initialize all the plugin functions with nullptr.
Protected Attributes
-
SP::PluggedObject _pluginJachlambda = {nullptr}#
LagrangianR plug-in to compute h(q,lambda,z)
- Param sizeDS:
: sum of the sizes of all the DynamicalSystems involved in the interaction
- Param q:
: pointer to the first element of q
- Param sizeY:
: size of vector y (ie of lambda and of the interaction)
- Param lambda:
: pointer to lambda of the interaction
- Param y:
[inout] : pointer to the first element of y
- Param sizeZ:
: size of vector z.
- Param z:
[inout] : a vector of user-defined parameters
-
LagrangianCompliantR(const std::string &pluginh, const std::string &pluginJacobianhq, const std::string &pluginJacobianhlambda)