File kernel/src/modelingTools/NewtonEulerR.hpp

Contents

File kernel/src/modelingTools/NewtonEulerR.hpp#

Go to the source code of this file

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

NewtonEuler (Non Linear) Relation (generic interface)

Relations for NewtonEuler Dynamical Systems. This class is only an interface for specific (Linear, Scleronomous …) NewtonEuler Relations (see derived classes).

Class name = type+subType.

If y = h(…), all the gradients of are handled by G object. For example, G[0] = \( \nabla_q h(q,...) \).

In corresponding derived classes, h and Gi are connected to plug-in functions (user-defined). For more details, see the DevNotes.pdf, chapter NewtonEuler.

Subclassed by NewtonEuler1DR

Public Types

enum NewtonEulerRDS#

Values:

enumerator z#
enumerator q0#
enumerator velocity#
enumerator dotq#
enumerator p0#
enumerator p1#
enumerator p2#
enumerator DSlinkSize#

Public Functions

inline NewtonEulerR()

Default constructor.

inline virtual ~NewtonEulerR()

destructor

inline SP::SimpleMatrix jachq() const

get a pointer on matrix Jach[index]

Returns:

a pointer on a SimpleMatrix

void setJachq(SP::SimpleMatrix newJachq)#
inline SP::SimpleMatrix jachqDot() const#
inline SP::SimpleMatrix dotJachq() const#
inline SP::SiconosVector secondOrderTimeDerivativeTerms()#
inline SP::SimpleMatrix jachlambda() const#
inline SP::SimpleMatrix jacglambda() const#
inline void setE(SP::SiconosVector newE)#
inline SP::SimpleMatrix jachqT() const#
inline void setJachqT(SP::SimpleMatrix newJachqT)#
inline virtual SP::SimpleMatrix H() const override#
void setJachqPtr(SP::SimpleMatrix newPtr)

set Jach[index] to pointer newPtr (pointer link)

Parameters:

newPtr – the new matrix

virtual void initialize(Interaction &inter) override

initialize components specific to derived classes.

Parameters:

interInteraction associated with the Relation

virtual void checkSize(Interaction &inter) override

check sizes of the relation specific operators.

Parameters:

inter – an Interaction using this relation

virtual void computeh(double time, const BlockVector &q0, SiconosVector &y)

to compute the output y = h(t,q,z) of the Relation

Parameters:
  • time – current time value

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

  • y – the resulting vector

inline virtual void computeJachlambda(double time, Interaction &inter)

default function to compute jacobianH

Parameters:
  • time – current time

  • inter – the interaction using this relation

inline virtual void computeJachq(double time, Interaction &inter, SP::BlockVector q0)

compute the jacobian of h w.r.t.

q

Parameters:
  • time – current time

  • inter – the interaction using this relation

  • q0 – the container of the block vector to the dynamical system

inline virtual void computeJachqDot(double time, Interaction &inter)

compute the jacobian of h w.r.t.

\( \dot{q} \)

Parameters:
  • time – current time

  • inter – the interaction using this relation

virtual void computeDotJachq(double time, const BlockVector &workQ, BlockVector &workZ, const BlockVector &workQdot)#
inline virtual void computeJacglambda(double time, Interaction &inter)

compute the jacobian of h w.r.t.

\( \dot{q} \)

Parameters:
  • time – current time

  • inter – the interaction using this relation

inline virtual void computeJacgq(double time, Interaction &inter)

compute the jacobian of h w.r.t.

\( \dot{q} \)

Parameters:
  • time – current time

  • inter – the interaction using this relation

inline virtual void computeJacgqDot(double time, Interaction &inter)

compute the jacobian of h w.r.t.

\( \dot{q} \)

Parameters:
  • time – current time

  • inter – the interaction using this relation

virtual void computeJachqT(Interaction &inter, SP::BlockVector q0)

default implementation consists in multiplying jachq and T in this implementation we use _T which is consitent which directly computed with computeT(q) when q is given this one in more consistent with the notion of function of q

Parameters:
  • inter – interaction that owns the relation

  • q0 – the block vector to the dynamical system position

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

compute all the jacobian of h

Parameters:
  • time – current time

  • inter – the interaction using this relation

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

compute all the jacobian of g

Parameters:
  • time – current time

  • inter – the interaction using this relation

void computeSecondOrderTimeDerivativeTerms(double time, Interaction &inter, VectorOfBlockVectors &DSlink, SP::DynamicalSystem ds1, SP::DynamicalSystem ds2)

To compute the terms of the second order time derivative of y \( \nabla_q h(q) \dot T v + \frac{d}{dt}(\nabla_q h(q) ) T v \).

Parameters:
  • time – current time

  • inter – interaction that owns the relation

  • DSlink – the container of the link to DynamicalSystem attributes

  • ds1 – dynamical system linked to this interaction (source)

  • ds2 – second ds linked to this interaction (target). If there is only one ds in the inter, call this function with …, ds, ds)

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

to compute output

Parameters:
  • time – current time

  • inter – the interaction using this relation

  • derivativeNumber – number of the derivative to compute, optional, default = 0.

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

to compute the input

Parameters:
  • time – current time

  • inter – the interaction using this relation

  • level – number of the derivative to compute, optional, default = 0.

inline virtual SP::SimpleMatrix C() const override

return a SP on the C matrix.

The matrix C in the linear case, else it returns Jacobian of the output with respect to x.

inline virtual SP::SimpleMatrix D() const

return a SP on the D matrix.

The matrix D in the linear case, else it returns Jacobian of the output with respect to lambda.

inline virtual SP::SimpleMatrix B() const

return a SP on the B matrix.

The matrix B in the linear case, else it returns Jacobian of the input with respect to lambda.

inline SP::SiconosVector contactForce() const

A buffer containing the forces due to this.

It is an output unused for the computation. Fix : is it usefull ?

Returns:

SP::SiconosVector

inline virtual void display() const override

main relation members display

ACCEPT_STD_VISITORS()#

Public Members

SP::PluggedObject _plugindotjacqh

Plugin object for the time&#8212;derivative of Jacobian i.e.

\( \frac{d}{dt} \nabla^T_{q} h(t,q,\dot q,\ldots) \) stored in _dotjachq

SP::SiconosVector _secondOrderTimeDerivativeTerms

the additional terms of the second order time derivative of y

\( \nabla_q h(q) \dot T v + \frac{d}{dt}(\nabla_q h(q) ) T v \)

Protected Functions

ACCEPT_SERIALIZATION(NewtonEulerR)#
inline NewtonEulerR(RELATION::SUBTYPES lagType)#

basic constructor

Parameters:

lagType – the sub-type of the relation

Protected Attributes

SP::SimpleMatrix _jachq#

The Jacobian of the constraints with respect to the generalized coodinates \( q \) i.e.

\[\nabla^T_q h(t,q,\dot q,\ldots)\]

SP::SimpleMatrix _jachqDot#

The Jacobian of the constraints with respect to the generalized velocities \( \dot q \) i.e.

\[\nabla^T_{\dot q} h(t,q,\dot q,\ldots)\]

SP::SimpleMatrix _dotjachq#

The time-derivative of Jacobian of the constraints with respect to the generalized coordinates \( q \) i.e.

\[\frac{d}{dt} \nabla^T_{q} h(t,q,\dot q,\ldots).\]
This value is useful to compute the second-order time&#8212;derivative of the constraints with respect to time.

SP::SimpleMatrix _jachlambda#
SP::SimpleMatrix _jacglambda#
SP::SiconosVector _e#

vector e

SP::SiconosVector _contactForce#

vector of contact forces, ie: _contactForce = B lambda.

Useful for the end user.

SP::SimpleMatrix _jachqT#

updated in computeJachqT: In the case of the bilateral constrains, it is _jachq._T.

In the case of a local frame, _jachqT is built from the geometrical datas(local frame, point of contact).

SP::SimpleMatrix _T#

local storage of _T as working vector to compute JachqT from q