# siconos.kernel.LagrangianRheonomousR (Python class)¶

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

Bases: siconos.kernel.LagrangianR

Lagrangian (Non Linear) Rheonomous Relation.

This class provides tools to describe non linear relation of the type:



y = h(q,t,z) \ dot y = nabla^top_q(q,t,z)dot q + frac{partial }{partial t}h(q,t,z) \

or more generally



dot y = H(q,t,z)dot q + frac{partial }{partial t}h(q,t,z)

and by duality

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

The following operators (and their jacobians) can be plugged, in the usual way (see User Guide, ‘User-defined plugins’)

• $$h(q,t,z)$$
• $$\nabla_q h(q,t,z)$$
• $$\dot h(q,t,z)$$

The plugin functions must fit with the following signature (FPtr4):

void func(unsigned int qsize, double* q, double time, unsigned int ysize, double* buffer , unsigned int sizez, double* z)

buffer being either $$y$$, $$\dot h$$ or $$\nabla_qh$$.

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

Constructors

LagrangianRheonomousR(str pluginh, str pluginJacobianhq, str pluginDoth)

constructor from a set of data

Parameters: pluginh – name of the plugin to compute h. Its signature must be “void userPluginH(unsigned int, double*, double, unsigned int, double*, unsigned int, double*)” pluginJacobianhq – name of the plugin to compute jacobian h according to q. Its signature must be “void userPluginG0(unsigned int, double*, double, unsigned int, double*, unsigned int, double*)” pluginDoth – name of the plugin to compute hDot. Its signature must be “void userPluginHDot(unsigned int, double*, double, unsigned int, double*, unsigned int, double*)
checkSize(Interaction inter) → None[source]

check sizes of the relation specific operators.

Parameters: inter – an Interaction using this relation
computeInput(double time, Interaction inter, int level=0) → None[source]

to compute p

Parameters: time – current time inter – the Interaction level – “derivative” order of lambda used to compute input
computeJacg(double time, Interaction inter) → None[source]
computeJach(double time, Interaction inter) → None[source]

compute all the H Jacobian

Parameters: time – the current time inter – the interaction using this relation
computeJachq(double time, array_like (np.float64, 1D) q, array_like (np.float64, 1D) z) → None[source]

to compute the jacobian of h using plug-in mechanism.

Index shows which jacobian is computed

Parameters: time – double, current time q – the coordinates vector z – the parameters vector
computeOutput(double time, Interaction inter, int derivativeNumber=0) → None[source]

to compute output

Parameters: time – current time inter – the Interaction derivativeNumber – number of the derivative to compute, optional, default = 0.
computeh(double time, array_like (np.float64, 1D) q, array_like (np.float64, 1D) z, array_like (np.float64, 1D) y) → None[source]

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

Parameters: time – current time q – the vector of coordinates z – the vector of parameters y – the y vector
computehDot(double time, array_like (np.float64, 1D) q, array_like (np.float64, 1D) z) → None[source]

to compute hDot using plug-in mechanism

Parameters: time – current time q – the vector of coordinates z – the vector of parameters
hDot() -> array_like (np.float64, 1D)[source]

get a pointer on vector hDot

Returns: a smart pointer on a SiconosVector
initialize(Interaction inter) → None[source]

initialize G matrices or components specific to derived classes.

Parameters: inter – the Interaction
setComputehDotFunction(str pluginpath, str name) → None[source]

to set a specified function to compute function hDot

Parameters: pluginpath – the complete path to the plugin name – the name of the function to use in this plugin