# File kernel/src/modelingTools/FirstOrderR.hpp¶

Go to the source code of this file

General interface for relations.

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

FirstOrder Relation.

This is an abstract class for all relation operating on first order systems. It should not be used. Rather, the following classes should be used:

• FirstOrderNonlinearR: for fully nonlinear relations: $$y = h(t, X, \lambda, Z)$$, $$R = g(t, X, \lambda, Z)$$.

• FirstOrderType2R: specialization with $$y = h(t, X, \lambda, Z)$$, $$R = g(t, \lambda, Z)$$.

• FirstOrderType1R: further specialization with $$y = h(t, X, Z)$$, $$R = g(t, \lambda, Z)$$.

• FirstOrderLinearR: linear case: $$y = C(t)x + D(t)\lambda + F(t) z + e$$, $$R = B(t)\lambda$$.

• FirstOrderLinearR: time-invariant linear case: $$y = Cx + D\lambda + F z + e$$, $$R = B\lambda$$.

If the relation involves only one DynamicalSystem, then $$R = r$$, $$X = x$$, and $$Z = z$$. With two, then $$R = [r_1, r_2]$$, $$X = [x_1 x_2]$$, and $$Z = [z_1 z_2]$$.

Remember that $y$ and  are relation from the Interaction, and have the same size.

Public Types

enum FirstOrderRDS

Values:

x
z
r
DSlinkSize
enum FirstOrderRMat

Values:

mat_C
mat_D
mat_F
mat_B
mat_K
relationMatricesSize
enum FirstOrderRVec

Values:

e
relationVectorsSize

Public Functions

virtual ~FirstOrderR()

destructor

SP::SimpleMatrix B() const

get B

Return

B matrix

SP::SimpleMatrix C() const

get C

Return

C matrix

virtual void checkSize(Interaction &inter) = 0

check sizes of the relation specific operators.

Parameters
• inter: an Interaction using this relation

SP::SimpleMatrix D() const

get D

Return

D matrix

SP::SimpleMatrix F() const

get F

Return

F matrix

virtual void initialize(Interaction &inter)

initialize the relation (check sizes, memory allocation …)

Parameters
• inter: the interaction using this relation

SP::SimpleMatrix K() const

get K

Return

K matrix

void setBPtr(SP::SimpleMatrix newB)

set B to pointer newB

Parameters
• newB: the B matrix

void setCPtr(SP::SimpleMatrix newC)

set C to pointer newC

Parameters
• newC: the C matrix

void setDPtr(SP::SimpleMatrix newD)

set D to pointer newPtr

Parameters
• newD: the D matrix

void setFPtr(SP::SimpleMatrix newF)

set F to pointer newPtr

Parameters
• newF: the F matrix

Protected Functions

FirstOrderR(RELATION::SUBTYPES newType)

basic constructor

Parameters
• newType: the type of the relation

ACCEPT_SERIALIZATION(FirstOrderR)

serialization hooks

Protected Attributes

SP::SimpleMatrix _B

A matrix to store the constant Jacobian of g(t, X, lambda, Z) w.r.t lambda.

SP::SimpleMatrix _C

The following matrices are used if the relation is linear w.r.t to some variables.

If the matricesa are, the computation of the Jacobian is not done.A matrix to store the constant Jacobian of h(t, X, lambda, Z) w.r.t X

SP::SimpleMatrix _D

A matrix to store the constant Jacobian of h(t, X, lambda, Z) w.r.t lambda.

SP::SimpleMatrix _F

A matrix to store the constant Jacobian of h(t, X, lambda, Z) w.r.t Z.

SP::SimpleMatrix _K

A matrix to store the constant Jacobian of g(t, X, lambda, Z) w.r.t X.

SP::SiconosVector _vec_r

Continuous memory vector of size of r to call plugin.

SP::SiconosVector _vec_x

Continuous memory vector of size of x to call plugin.

SP::SiconosVector _vec_z

Continuous memory vector of size of z to call plugin.