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 NewtonEulerFrom1DLocalFrameR

Public Types

enum NewtonEulerRDS

Values:

z
q0
velocity
dotq
p0
p1
p2
DSlinkSize

Public Functions

NewtonEulerR()
virtual ~NewtonEulerR()

destructor

ACCEPT_STD_VISITORS()
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.

Return
SP::SimpleMatrix

virtual SP::SimpleMatrix C() const

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.

Return
SP::SimpleMatrix

virtual void checkSize(Interaction &inter)

check sizes of the relation specific operators.

Parameters

virtual void computeDotJachq(double time, BlockVector &workQ, BlockVector &workZ, BlockVector &workQdot)
virtual void computeh(double time, BlockVector &q0, SiconosVector &y)

to compute y = h(q,v,t) using plug-in mechanism

Parameters
  • time: current time
  • q0: the position
  • y: the output

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

to compute the input

Parameters
  • time: current time
  • inter: the interaction using this relation
  • level: number of the derivative to compute, optional, default = 0.

virtual void computeJacg(double time, Interaction &inter)

compute all the jacobian of g

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

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

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

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 computeJach(double time, Interaction &inter)

compute all the jacobian of h

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

virtual void computeJachlambda(double time, Interaction &inter)

default function to compute jacobianH

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

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

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 computeJachqT(Interaction &inter, SP::BlockVector q0)
virtual void computeOutput(double time, Interaction &inter, unsigned int derivativeNumber = 0)

to compute output

Parameters
  • time: current time
  • inter: the interaction using this relation
  • derivativeNumber: number of the derivative to compute, optional, default = 0.

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)

SP::SiconosVector contactForce() const

A buffer containing the forces due to this.

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

Return
SP::SiconosVector

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.

Return
SP::SimpleMatrix

SP::SimpleMatrix dotJachq() const
virtual void initialize(Interaction &inter)

initialize components specific to derived classes.

Parameters

SP::SimpleMatrix jacglambda() const
SP::SimpleMatrix jachlambda() const
SP::SimpleMatrix jachq() const

get a pointer on matrix Jach[index]

Return
a pointer on a SimpleMatrix

SP::SimpleMatrix jachqDot() const
SP::SimpleMatrix jachqT() const
SP::SiconosVector secondOrderTimeDerivativeTerms()
void setE(SP::SiconosVector newE)
void setJachq(SP::SimpleMatrix newJachq)
void setJachqPtr(SP::SimpleMatrix newPtr)

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

Parameters
  • newPtr: the new matrix

void setJachqT(SP::SimpleMatrix newJachqT)

Public Members

SP::PluggedObject _plugindotjacqh

Plugin object for the timederivative 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

NewtonEulerR(RELATION::SUBTYPES lagType)

basic constructor

Parameters
  • lagType: the sub-type of the relation

ACCEPT_SERIALIZATION(NewtonEulerR)

serialization hooks

Protected Attributes

SP::SiconosVector _contactForce

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

Useful for the end user.

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 timederivative of the constraints with respect to time.

SP::SiconosVector _e

vector e

SP::SimpleMatrix _jacglambda
SP::SimpleMatrix _jachlambda
SP::SimpleMatrix _jachq

Jacobian matrices of H.

Jacobian matrices of \(y = h(t,q,\dot q,\ldots)\) 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 _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