siconos.kernel.FirstOrderNonLinearR (Python class)

class siconos.kernel.FirstOrderNonLinearR[source]

Bases: siconos.kernel.FirstOrderR

Pointer to function for plug-in for operators related to input and its gradients.

FirstOrder Non Linear Relation.

Relation for First Order Dynamical Systems, with:

\[\begin{split}y &=& h(X,t,\lambda,Z) \\ R &=& g(X,t,\lambda,Z)\end{split}\]

X, Z, R corresponds to DynamicalSystem variables. If DS1 and DS2 are involved in the linked Interaction, then X =[x1 x2], Z=[z1 z2] …

\(y \ and \ \lambda\) are specific variables of the interaction (see this class for more details). h and g are plugged on external functions, via plug-in mechanism (see SiconosSharedLibrary).

h <=> output

g <=> input

Operators (and their corresponding plug-in):

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

Note: we use a vector for jacobianG while there is only one jacobian. Just for future changes and to allow easy new implementations if some other variables are required in g.

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

Constructors

FirstOrderNonLinearR()

basic constructor

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) x, 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
  • x
  • lambda
  • z
  • B
computeJacgx(double time, array_like (np.float64, 1D) x, array_like (np.float64, 1D) lambda, array_like (np.float64, 1D) z, array_like (np.float64, 2D) K) → None[source]

default function to compute jacobianG according to x

Parameters:
  • time – double : current time
  • x
  • lambda
  • z
  • K
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, 1D) z, array_like (np.float64, 2D) D) → None[source]
computeJachx(double time, array_like (np.float64, 1D) x, array_like (np.float64, 1D) lambda, array_like (np.float64, 1D) z, array_like (np.float64, 2D) C) → None[source]

default function to compute jacobianH

Parameters:
  • time – : current time
  • x
  • lambda
  • z
  • C
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) x, 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 – : current time
  • x
  • lambda
  • z
  • r
computeh(double time, array_like (np.float64, 1D) x, array_like (np.float64, 1D) lambda, array_like (np.float64, 1D) z, array_like (np.float64, 1D) y) → None[source]

default function to compute h

Parameters:
  • time – : current time
  • x
  • lambda
  • z
  • y
initialize(Interaction inter) → None[source]

initialize the relation (check sizes, memory allocation …)

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

return true if the relation requires the computation of residu

Returns:true if residu are required, false otherwise