Class FirstOrderNonLinearR

Defined in Program listing for file kernel/src/modelingTools/FirstOrderNonLinearR.hpp

class FirstOrderNonLinearR : public 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.

Public Functions

FirstOrderNonLinearR()

basic constructor

virtual ~FirstOrderNonLinearR()

destructor

virtual void checkSize(Interaction &inter)

check sizes of the relation specific operators.

Parameters

virtual void computeg(double time, SiconosVector &x, SiconosVector &lambda, SiconosVector &z, SiconosVector &r)

default function to compute g

Parameters
  • time: : current time
  • x:
  • lambda:
  • z:
  • r:

virtual void computeh(double time, SiconosVector &x, SiconosVector &lambda, SiconosVector &z, SiconosVector &y)

default function to compute h

Parameters
  • time: : current time
  • x:
  • lambda:
  • z:
  • y:

virtual void computeInput(double time, Interaction &inter, unsigned int level = 0)

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

Parameters

virtual void computeJacglambda(double time, SiconosVector &x, SiconosVector &lambda, SiconosVector &z, SimpleMatrix &B)

default function to compute jacobianG according to lambda

Parameters
  • time: current time
  • x:
  • lambda:
  • z:
  • B:

virtual void computeJacgx(double time, SiconosVector &x, SiconosVector &lambda, SiconosVector &z, SimpleMatrix &K)

default function to compute jacobianG according to x

Parameters
  • time: double : current time
  • x:
  • lambda:
  • z:
  • K:

virtual void computeJach(double time, Interaction &inter)

compute all the H Jacobian

Parameters
  • time: the current time
  • inter: the interaction using this relation

virtual void computeJachx(double time, SiconosVector &x, SiconosVector &lambda, SiconosVector &z, SimpleMatrix &C)

default function to compute jacobianH

Parameters
  • time: : current time
  • x:
  • lambda:
  • z:
  • C:

virtual void computeOutput(double time, Interaction &inter, unsigned int level = 0)

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

Parameters

void initialize(Interaction &inter)

initialize the relation (check sizes, memory allocation …)

Parameters
  • inter: the interaction using this relation

virtual bool requireResidu()

return true if the relation requires the computation of residu

Return
true if residu are required, false otherwise