Robotran C Documentation
Functions
mbs_linearipk.c File Reference
#include "mbs_errors_names.h"
#include "mbs_linearipk.h"
#include "mbs_message.h"
#include "mbs_project_interface.h"

Functions

int mbs_linearipk (double **GK, MbsLpk *lpk, MbsAux *aux, MbsData *s, int EqChoice)
 compute the linearized damping matrix Gr or stiffness matrix Kr for a given configuration (q,qd,qdd). More...
 
int mbs_lineari_fct (double *x, double *Fx, MbsLpk *lpk, MbsAux *aux, MbsData *s, int EqChoice)
 compute the Fx vector for a given vector x. More...
 
MbsLpkmbs_new_lpk (MbsData *s, int nx, int nF)
 create a new lpk structure that is used to compute the linearized matrices Gr and Kr. More...
 
void mbs_delete_lpk (MbsLpk *lpk)
 free memory of the lpk structure. More...
 

Detailed Description

This file implements the functions tangent computation of the system with the lpk approach.

Author
Robotran team

Original file by Q Docquier, 2016

(c) Universite catholique de Louvain

Function Documentation

◆ mbs_delete_lpk()

void mbs_delete_lpk ( MbsLpk lpk)

free memory of the lpk structure.

Parameters
[in,out]lpkthe MbsLpk structure to delete.

◆ mbs_lineari_fct()

int mbs_lineari_fct ( double *  x,
double *  Fx,
MbsLpk lpk,
MbsAux *  aux,
MbsData s,
int  EqChoice 
)

compute the Fx vector for a given vector x.

The values in the vector x are set in the memory pointed by MbsLpk::x_ptr (typically the independents joints coordinates MbsData::q or velocities MbsData::qd).

NOTE: this function could be clearly improved by the use of a vector of pointer that either point the velocities or the positions.

Parameters
[in]xcontains the independent position OR velocities OR the extra differential states.
[out]Fxcontains the residual of the reduced equations of motion OR the extra set of constitutive ODE for the provided vector x.
[in]lpkcomputation structure used for the linearization.
[in]auxauxilary structure necessary for the computation of the reduced residual.
[in]sdata structure, just used for the computation.
[in]EqChoicedigit that indicates on which equations is performed the linearization:
  • 1: on the reduced Equation of Motion;
  • 2: on the user derivatives equations;
  • 3: on the user added equilibrium equations.
Returns
Error status, <0 in case of failure.

◆ mbs_linearipk()

int mbs_linearipk ( double **  GK,
MbsLpk lpk,
MbsAux *  aux,
MbsData s,
int  EqChoice 
)

compute the linearized damping matrix Gr or stiffness matrix Kr for a given configuration (q,qd,qdd).

The compted matrix depend weither MbsLpk::x_ptr points to MbsData::q[MbsData::qu] or MbsData::qd[MbsData::qu].

NOTE: this function could be clearly improved by the use of a vector of pointer that either point the velocities or the positions.

Parameters
[out]GKcontains the resulting linearized matrix (Gr or Kr).
[in]lpkcomputation structure used for the linearization.
[in]auxauxilary structure necessary for the computation of the reduced residual.
[in]sdata structure containing the mbs configuration (q,qd,qdd).
[in]EqChoicedigit that indicates on which equations is performed the linearization (see mbs_lineari_fct())
Returns
Error status, <0 in case of failure.

◆ mbs_new_lpk()

MbsLpk* mbs_new_lpk ( MbsData s,
int  nx,
int  nF 
)

create a new lpk structure that is used to compute the linearized matrices Gr and Kr.

Parameters
[in]sthe data structure of the mbs.
[in]nxthe number of variables
[in]nFthe number of equations
Returns
An allocated and initialized new lpk structure.