Robotran C Documentation
Classes | Functions
mbs_dopri5.h File Reference
#include "mbs_data.h"
#include "integrator.h"
#include "mbs_dirdyn.h"
#include "useful_functions.h"
#include "mbs_dirdyn_struct.h"
#include "mbs_project_interface.h"
#include "dopri5.h"
#include "MBSfun.h"
#include "mbs_message.h"

Go to the source code of this file.

Classes

struct  MbsDirdynDopri5
 Dopri5 structure for dirdyn. More...
 

Functions

void initialize_dopri5 (MbsData *mbs_data, MbsDirdyn *mbs_dd)
 Initialize all needed fields in MbsDirdyn for Dopri5 integrator. More...
 
int loop_dopri5 (double t0, double tf, MbsData *mbs_data, MbsDirdyn *mbs_dd)
 Integrate the motion from t0 to tf. More...
 
void finish_dopri5 (MbsData *mbs_data, MbsDirdyn *mbs_dd)
 Finalize and clear memory allocated for dopri5 integrator. More...
 
int fcn_dopri5 (unsigned int n, long nr, double tsim, double y[], double dydt[], MbsData *s, MbsDirdyn *mbs_dd)
 dopri5 derivative function More...
 
int solout_dopri5 (long nr, double tsim_old, double tsim, double y[], unsigned n, int *irtrn, int init_flag, MbsData *s, MbsDirdyn *mbs_dd)
 dopri5 simulation own gestion at each succesful step More...
 
void error_dopri5 (MbsData *mbs_data, MbsDirdyn *dd, int err)
 If an error occurs during time integration, this function prints the error message and call finish_dopri5. More...
 

Function Documentation

◆ error_dopri5()

void error_dopri5 ( MbsData mbs_data,
MbsDirdyn dd,
int  err 
)

If an error occurs during time integration, this function prints the error message and call finish_dopri5.

Parameters
mbs_dataThe computed MBS structure
mbs_ddThe associated MbsDirdyn structure
errThe error number

◆ fcn_dopri5()

int fcn_dopri5 ( unsigned int  n,
long  nr,
double  tsim,
double  y[],
double  dydt[],
MbsData s,
MbsDirdyn mbs_dd 
)

dopri5 derivative function

Parameters
[in]ndimension of the system [-]
[in]nrsolour iteration [-]
[in]tsimcurrent simulation time [s]
[in]ystate vector of size n
[out]dydtderivative of state vector y
[in,out]sRobotran main structure
[in,out]mbs_dddirect dynamic main module structure
Returns
Error status, <0 in case of failure.

◆ finish_dopri5()

void finish_dopri5 ( MbsData mbs_data,
MbsDirdyn mbs_dd 
)

Finalize and clear memory allocated for dopri5 integrator.

Parameters
mbs_dataThe computed MBS structure
mbs_ddThe associated MbsDirdyn structure

◆ initialize_dopri5()

void initialize_dopri5 ( MbsData mbs_data,
MbsDirdyn mbs_dd 
)

Initialize all needed fields in MbsDirdyn for Dopri5 integrator.

Parameters
mbs_dataThe computed MBS structure
mbs_ddThe associated MbsDirdyn structure

◆ loop_dopri5()

int loop_dopri5 ( double  t0,
double  tf,
MbsData mbs_data,
MbsDirdyn mbs_dd 
)

Integrate the motion from t0 to tf.

Parameters
t0The initial time
tfThe final time
mbs_dataThe computed MBS structure
mbs_ddThe associated MbsDirdyn structure
Returns
Error status, <0 in case of failure.

◆ solout_dopri5()

int solout_dopri5 ( long  nr,
double  tsim_old,
double  tsim,
double  y[],
unsigned  n,
int *  irtrn,
int  init_flag,
MbsData s,
MbsDirdyn mbs_dd 
)

dopri5 simulation own gestion at each succesful step

Parameters
[in]nrsolour iteration [-]
[in]tsim_oldlast time solout was called [s]
[in]tsimcurrent simulation time [s]
[in]ystate vector of size n
[in]ndimension of the system [-]
[out]irtrnset a negative value to stop the simulation
[in]init_flag1 if initial call to solout, 0 otherwise
[in,out]sRobotran main structure
[in,out]mbs_dddirect dynamic main module structure
Returns
Error status, <0 in case of failure.