# Class FirstOrderLinearR¶

class FirstOrderLinearR : public FirstOrderR

First Order Linear Relation.

Linear Relation for First Order Dynamical Systems:

$\begin{split} y &=& C(t,z)x(t) + F(t,z)z + D(t,z)\lambda + e(t,z) \\ R &=& B(t,z) \lambda \end{split}$

The following operators can be plugged: B(t,z), C(t,z), D(t,z), e(t,z), F(t,z)

Public Functions

inline FirstOrderLinearR()

default constructor

FirstOrderLinearR(const std::string &Cname, const std::string &Bname)

Constructor with C and B plugin names.

Parameters
• Cname – the plugin name for computing the C matrix

• Bname – the plugin name for computing the B matrix

FirstOrderLinearR(const std::string &Cname, const std::string &Dname, const std::string &Fname, const std::string &Ename, const std::string &Bname)

Constructor with all plugin names.

Parameters
• Cname – the plugin name for computing the C matrix

• Dname – the plugin name for computing the D matrix

• Fname – the plugin name for computing the F matrix

• Ename – the plugin name for computing the e vector

• Bname – the plugin name for computing the B matrix

FirstOrderLinearR(SP::SimpleMatrix C, SP::SimpleMatrix B)

create the Relation from constant matrices (only B and C operators)

Parameters
• C – the C matrix

• B – the B matrix

FirstOrderLinearR(SP::SimpleMatrix C, SP::SimpleMatrix D, SP::SimpleMatrix F, SP::SiconosVector e, SP::SimpleMatrix B)

create the Relation from a set of data

Parameters
• C – the C matrix

• D – the D matrix

• F – the F matrix

• e – the e matrix

• B – the B matrix

virtual ~FirstOrderLinearR() noexcept = default

destructor

inline void setComputeCFunction(const std::string &pluginPath, const std::string &functionName)

set a specified function to compute the matrix C

Parameters
• pluginPath – the complete path to the plugin

• functionName – the function name to use in this plugin

inline void setComputeDFunction(const std::string &pluginPath, const std::string &functionName)

set a specified function to compute the matrix D

Parameters
• pluginPath – the complete path to the plugin

• functionName – the function name to use in this plugin

inline void setComputeBFunction(const std::string &pluginPath, const std::string &functionName)

set a specified function to compute the matrix B

Parameters
• pluginPath – the complete path to the plugin

• functionName – the function name to use in this plugin

virtual void computeC(double time, BlockVector &z, SimpleMatrix &C)

Function to compute the matrix C.

Parameters
• time – the current time

• z – the auxiliary input vector

• C – the C matrix

virtual void computeD(double time, BlockVector &z, SimpleMatrix &D)

Function to compute the matrix D.

Parameters
• time – the current time

• z – the auxiliary input vector

• D – the D matrix

virtual void computeF(double time, BlockVector &z, SimpleMatrix &F)

Function to compute the matrix F.

Parameters
• time – the current time

• z – the auxiliary input vector

• F – the F matrix

virtual void computee(double time, BlockVector &z, SiconosVector &e)

Function to compute the vector e.

Parameters
• time – the current time

• z – the auxiliary input vector

• e – the e vector

virtual void computeB(double time, BlockVector &z, SimpleMatrix &B)

Function to compute the matrix B.

Parameters
• time – the current time

• z – the auxiliary input vector

• B – the B matrix

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

to compute the output y = h(t,x,…) of the Relation

Parameters
• time – current time value

• x – coordinates of the dynamical systems involved in the relation

• lambda – interaction $$\lambda$$ vector

• z – user defined parameters (optional)

• y – the resulting vector

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

to compute the nonsmooth input r = g(t,x,…) of the Relation

Parameters
• time – current time value

• lambda – interaction $$\lambda$$ vector

• z – user defined parameters (optional)

• r – the resulting vector

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

default function to compute y

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

default function to compute r

Parameters
virtual void display() const override

print the data to the screen

inline void setePtr(SP::SiconosVector newe)

set e operator

Parameters

newe – the new value of e

inline SP::SiconosVector e() const

get e

Returns

e matrix

inline virtual bool isLinear() override

determines if the Relation is linear

Returns

true if the relation is linear.

inline virtual void computeJach(double time, Interaction &inter) override

compute all the H Jacobian

Parameters
• time – the current time

• inter – the interaction using this relation

inline virtual void computeJacg(double time, Interaction &inter) override

compute all the G Jacobian

Parameters
• time – the current time

• inter – the interaction using this relation

• interProp