Robotran C Documentation
Functions
mbs_rk4.c File Reference

This file implements the functions of the Runge Kutta order 4 integration method in C. More...

#include "mbs_rk4.h"
#include "mbs_message.h"

Functions

void initialize_rk4 (MbsData *mbs_data, MbsDirdyn *mbs_dd)
 Initialize all needed fields in MbsDirdyn for RK4 integrator. More...
 
int loop_rk4 (double t0, double tf, MbsData *mbs_data, MbsDirdyn *mbs_dd)
 Integrate the motion from t0 to tf. More...
 
void finish_rk4 (MbsData *mbs_data, MbsDirdyn *dd)
 Finalize and clear memory allocated for RK4 integrator. More...
 
void error_rk4 (MbsData *mbs_data, MbsDirdyn *dd, int err)
 If an error occurs during time integration, this function prints the error message and call finish_rk4. More...
 

Detailed Description

This file implements the functions of the Runge Kutta order 4 integration method in C.

This file implements the functions of the Runge Kutta order 4 integration method in C. Specific functions implementation of the algorithm.

Creation date: December 2017

Author
Olivier Lantsoght

Modification date: April 2018 \modified by Sebastien Timmermans

(c) Universite catholique de Louvain

Function Documentation

◆ error_rk4()

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

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

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

◆ finish_rk4()

void finish_rk4 ( MbsData mbs_data,
MbsDirdyn mbs_dd 
)

Finalize and clear memory allocated for RK4 integrator.

Parameters
mbs_dataThe computed MBS structure
mbs_ddThe associated MbsDirdyn structure

◆ initialize_rk4()

void initialize_rk4 ( MbsData mbs_data,
MbsDirdyn mbs_dd 
)

Initialize all needed fields in MbsDirdyn for RK4 integrator.

Parameters
mbs_dataThe computed MBS structure
mbs_ddThe associated MbsDirdyn structure

◆ loop_rk4()

int loop_rk4 ( 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.

user loop

user loop