siconos.kernel.FirstOrderType1R (Python class)

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

Bases: siconos.kernel.FirstOrderR

FirstOrder Non Linear Relation.

Derived from FirstOrderR - See this class for more comments.

Relation for First Order Dynamical Systems, with:

\[\]

y &= h(x,z)\ r &= g(lambda,z)

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/FirstOrderType1R.hpp.

Constructors

FirstOrderType1R()

default constructor

FirstOrderType1R(str pluginh, str pluging)

build from plugin for \(h(x,z)\) and \(g(\lambda, z)\)

Parameters:
  • pluginh – the plugin to compute h
  • pluging – the plugin to compute g
FirstOrderType1R(str pluginh, str pluging, str pluginJachx, str pluginJacglambda)

build from plugin for \(h(x,z)\), \(g(\lambda, z)\) and their gradients

Parameters:
  • pluginh – the plugin to compute h
  • pluging – the plugin to compute g
  • pluginJachx – the plugin to compute \(\nabla_x h\)
  • pluginJacglambda – the plugin to compute \(\nabla_{\lambda} g\)
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, 1D) z, 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
  • z – the extra 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
computeJachx(double time, array_like (np.float64, 1D) x, array_like (np.float64, 1D) z, 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
  • z – the extra input used to evaluate the jacobian
  • C – the matrix used to store the jacobian
computeJachz(double time, array_like (np.float64, 1D) x, array_like (np.float64, 1D) z, array_like (np.float64, 2D) F) → None[source]

default function to compute \(\nabla_z h\)

Parameters:
  • time – current time (not used)
  • x – the state used to evaluate the jacobian
  • z – the extra input used to evaluate the jacobian
  • F – 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) z, array_like (np.float64, 1D) r) → None[source]

default function to compute g

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

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

Parameters:
  • time – the current time
  • x – the state vector
  • z – the external input
  • 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