siconos.kernel.FirstOrderType2R (Python class)

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

Bases: siconos.kernel.FirstOrderR

First order non linear Relation.

Relation for First Order Dynamical Systems, with:

\[\begin{split}y &= h(x,\lambda,z)\\ r &= g(\lambda,z)\end{split}\]

Operators (and their corresponding plug-in):

  • h: saved in Interaction as y (plug-in: output[0])
  • \(\nabla_x h\): jacobianH[0] ( output[1] )
  • g: saved in DS as r ( input[0])
  • \(\nabla_\lambda g\): jacobianG[0] ( input[1] )

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

Constructors

FirstOrderType2R()

Basic contructor.

FirstOrderType2R(str pluginh, str pluging)

data constructor

Parameters:
  • pluginh – name of the plugin to compute h
  • pluging – name of the plugin to compute g
FirstOrderType2R(str pluginh, str pluging, str pluginJacobianhx, str pluginJacobianglambda)

data constructor

Parameters:
  • pluginh – name of the plugin to compute h
  • pluging – name of the plugin to compute g
  • pluginJacobianhx – name of the plugin to compute the Jacobian of h according to x \(\nabla_x h\)
  • pluginJacobianglambda – name of the plugin to compute the jacobian of g according to lambda
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]

default function to compute r, using the data from the Interaction and DS

Parameters:
  • time – current time (not used)
  • inter – Interaction using this Relation
  • level – not used
computeJacg(double time, Interaction inter) → None[source]
computeJacglambda(double time, array_like (np.float64, 1D) lambda, array_like (np.float64, 2D) B) → None[source]

default function to compute jacobianG according to lambda

Parameters:
  • time – current time (not used)
  • lambda – the nonsmooth input used to evaluate the jacobian
  • B – the matrix used to store the jacobian
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) x, array_like (np.float64, 1D) lambda, array_like (np.float64, 2D) D) → None[source]

default function to compute jacobianh according to lambda

Parameters:
  • time – current time (not used)
  • x – the state used to evaluate the jacobian
  • lambda – the nonsmooth input used to evaluate the jacobian
  • D – the matrix used to store the jacobian
computeJachx(double time, array_like (np.float64, 1D) x, array_like (np.float64, 1D) lambda, array_like (np.float64, 2D) C) → None[source]

default function to compute \(\nabla_x h\)

Parameters:
  • time – current time (not used)
  • x – the state used to evaluate the jacobian
  • lambda
  • C – the matrix used to store the jacobian
computeOutput(double time, Interaction inter, int level=0) → None[source]

default function to compute y, using the data from the Interaction and DS

Parameters:
  • time – current time (not used)
  • inter – Interaction using this Relation
  • level – not used
computeg(double time, array_like (np.float64, 1D) lambda, array_like (np.float64, 1D) r) → None[source]

default function to compute g

Parameters:
  • time – the current time
  • lambda – XXX
  • r – the nonsmooth “input” vector
computeh(double time, array_like (np.float64, 1D) x, array_like (np.float64, 1D) lambda, array_like (np.float64, 1D) y) → None[source]

default function to compute y = h(x, lambda, t)

Parameters:
  • time – the current time
  • x – the state vector
  • lambda – XXX
  • y – the “output” vector
initialize(Interaction inter) → None[source]

initialize the relation (check sizes, memory allocation …)

Parameters:inter – the interaction that owns this relation
requireResidu() → bool[source]

return true if the relation requires the computation of residu

Returns:true if residu are required, false otherwise