Robotran C Documentation
Functions
mbs_statespace.h File Reference
#include "mbs_statespace_struct.h"
#include "mbs_data.h"
#include "mbs_aux.h"
#include "useful_functions.h"
#include "MBSfun.h"
#include "mbs_linearipk.h"

Go to the source code of this file.

Functions

MbsSSmbs_new_statespace (MbsData *s, int nu, int ny, int compute_uxd, int compute_JS)
 Create a new structure state-space that contains the matrices (A,B,C,D). More...
 
MbsSSblank_new_statespace (int nx, int nu, int ny)
 Allocate and intialize a statespace with almost fields to NULL. More...
 
int mbs_compute_statespace (MbsSS *ss, MbsData *mbs_data)
 Compute the matrices (A,B,C,D) for a mbs configuration (q,qd,qdd). More...
 
int mbs_compute_linearMatrices (MbsSS *ss, MbsData *mbs_data, MbsLpk *lpk, MbsAux *aux)
 Compute the linearized matrices necessary to obtain the (A,B,C) state-space representation. More...
 
void mbs_delete_statespace (MbsSS *ss)
 Free memory of the state-space structure. More...
 
void mbs_print_statespace (MbsSS *ss)
 Print the state-space structure. More...
 

Function Documentation

◆ blank_new_statespace()

MbsSS* blank_new_statespace ( int  nx,
int  nu,
int  ny 
)

Allocate and intialize a statespace with almost fields to NULL.

According to the values of nx, nu and ny, the following field may points to allocated memory instead of NULL:

Parameters
[in]nxnumber of state.
[in]nunumber of input.
[in]nynumber of output.
Returns
A pointer to the allocated structure.

◆ mbs_compute_linearMatrices()

int mbs_compute_linearMatrices ( MbsSS ss,
MbsData mbs_data,
MbsLpk lpk,
MbsAux *  aux 
)

Compute the linearized matrices necessary to obtain the (A,B,C) state-space representation.

Parameters
[in,out]sscontains the index vectors with info for B and C. the computed A,B,C,D are stored in ss.
[in]mbs_datadata structure containing the mbs configuration (q,qd,qdd).
[in]lpkcomputation structure used for the linearization.
[in]auxauxilary structure necessary for the computation of the reduced residual.
Returns
Error status, <0 in case of failure.

◆ mbs_compute_statespace()

int mbs_compute_statespace ( MbsSS ss,
MbsData mbs_data 
)

Compute the matrices (A,B,C,D) for a mbs configuration (q,qd,qdd).

Parameters
[in,out]sscontains the index vectors with info for B and C. the computed A,B,C,D are stored in ss.
[in]mbs_datadata structure containing the mbs configuration (q,qd,qdd).
Returns
Error status, <0 in case of failure.

◆ mbs_delete_statespace()

void mbs_delete_statespace ( MbsSS ss)

Free memory of the state-space structure.

Parameters
[in]ssstate-space structure to delete.

◆ mbs_new_statespace()

MbsSS* mbs_new_statespace ( MbsData s,
int  nu,
int  ny,
int  compute_uxd,
int  compute_JS 
)

Create a new structure state-space that contains the matrices (A,B,C,D).

Note that the user as to specifiy in index vectors:

  • which state are part of C
  • which jointForce is used as an input.
Parameters
[in]sdata structure containing the mbs configuration (q,qd,qdd).
[in]nunumber of input, based on this, a vector of index is created and must be filled by the user.
[in]nynumber of output, based on this, a vector of index is created and must be filled by the user.
[in]compute_uxdflag to compute the modes associated with the extra constitutive differential equations
[in]compute_JSflag to compute the non diagonal terms
Returns
A pointer to the allocated structure.

◆ mbs_print_statespace()

void mbs_print_statespace ( MbsSS ss)

Print the state-space structure.

Parameters
[in]ssstate-space structure to print.