siconos.kernel.LagrangianCompliantR (Python class)

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

Bases: siconos.kernel.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.

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

Constructors

LagrangianCompliantR(str pluginh, str pluginJacobianhq, str 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\)
checkSize(inter: Interaction) → void[source]

checkSize(Interaction inter)=0 -> None

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 the input

Parameters:
  • time – the current time
  • inter – the Interaction owning lambda
  • 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
computeJachlambda(double time, array_like (np.float64, 1D) q0, array_like (np.float64, 1D) lambda, array_like (np.float64, 1D) z) → None[source]

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
computeJachq(double time, array_like (np.float64, 1D) q, array_like (np.float64, 1D) lambda, array_like (np.float64, 1D) z) → None[source]

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
computeOutput(double time, Interaction inter, int derivativeNumber=0) → None[source]

to compute output

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

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
initialize(Interaction inter) → None[source]

initialize components specific to derived classes.

Parameters:inter – the interaction using this relation