File kernel/src/modelingTools/FirstOrderType1R.hpp

Go to the source code of this file

non linear relations, with y depending on dynamical systems state and r on lambda.

Typedefs

typedef void (*Type1Ptr)(unsigned int, double *, unsigned int, double *, unsigned int, double *)

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

class FirstOrderType1R : public FirstOrderR
#include <FirstOrderType1R.hpp>

FirstOrder Non Linear Relation.

Derived from FirstOrderR - See this class for more comments.

Relation for First Order Dynamical Systems, with:

\[\begin{split}y &= h(x,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] )

Public Functions

FirstOrderType1R()

default constructor

FirstOrderType1R(const std::string &pluginh, const std::string &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(const std::string &pluginh, const std::string &pluging, const std::string &pluginJachx, const std::string &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\)

~FirstOrderType1R()

destructor

ACCEPT_STD_VISITORS()
virtual void checkSize(Interaction &inter)

check sizes of the relation specific operators.

Parameters

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

default function to compute g

Parameters
  • time: the current time
  • lambda: the lambda vector
  • z: the external input
  • r: the nonsmooth “input” vector

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

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

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 computeJacg(double time, Interaction &inter)
void computeJacglambda(double time, SiconosVector &lambda, SiconosVector &z, SimpleMatrix &B)

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

virtual void computeJach(double time, Interaction &inter)

compute all the H Jacobian

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

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

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

void computeJachz(double time, SiconosVector &x, SiconosVector &z, SimpleMatrix &F)

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

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

virtual void initialize(Interaction &inter)

initialize the relation (check sizes, memory allocation …)

Parameters
  • inter: the interaction that owns this relation

virtual bool requireResidu()

return true if the relation requires the computation of residu

Return
true if residu are required, false otherwise

Protected Functions

ACCEPT_SERIALIZATION(FirstOrderType1R)

serialization hooks