|
Robotran C Documentation
|
Go to the documentation of this file.
17 #ifndef MBS_RK4_H_INCLUDED
18 #define MBS_RK4_H_INCLUDED
73 #endif // MBS_RK4_H_INCLUDED
int loop_rk4(double t0, double tf, MbsData *mbs_data, MbsDirdyn *mbs_dd)
Integrate the motion from t0 to tf.
Definition: mbs_rk4.c:34
int flag_precise_dynamics
= 1 to call the direct dynamics at the beginning of each time step of integration.
Definition: mbs_dirdyn_struct.h:112
double tsim
The time value.
Definition: mbs_data.h:208
double * y
Pointer to the state vector, this is a dvec_0 of size nState.
Definition: mbs_dirdyn_struct.h:153
int nState
size of the state vector
Definition: mbs_dirdyn_struct.h:152
double * get_dvec_0(int l_v)
create (with memory allocation) a vector (length l_v) of doubles, starting at index 0
Definition: mbs_1D_array.c:880
double * yd
Pointers to the derivative vector (dvec_0) of size nState.
Definition: mbs_dirdyn_struct.h:160
double * dym
allocated saved derivative vector
Definition: mbs_rk4.h:35
double * dyt
allocated derivative vector
Definition: mbs_rk4.h:34
double * yout
Allocation of a vector (dvec_0) of size nState.
Definition: mbs_dirdyn_struct.h:155
int mbs_fct_dirdyn(double tsim, double y[], double dydt[], MbsData *s, MbsDirdyn *dd)
direct dynamics derivative computation
Definition: mbs_dirdyn.c:1067
double * yt
allocated state vector
Definition: mbs_rk4.h:33
void * integrator_struct
pointer to store integrator structure
Definition: mbs_dirdyn_struct.h:183
int rk4(double y[], double dydx[], int n, double x, double h, double yout[], int(*derivs)(double, double[], double[], MbsData *, MbsDirdyn *), MbsData *s, MbsDirdyn *dd)
Runge Kutta 4 integrator implementation Given values for the variables y[1..n] and their derivatives ...
Definition: rk4.c:21
void initialize_rk4(MbsData *mbs_data, MbsDirdyn *mbs_dd)
Initialize all needed fields in MbsDirdyn for RK4 integrator.
Definition: mbs_rk4.c:19
void user_dirdyn_loop(MbsData *mbs_data, MbsDirdyn *mbs_dd)
user own loop functions
Definition: user_dirdyn.c:46
double tsim
current simulation time
Definition: mbs_dirdyn_struct.h:149
void mbs_msg(char *msg,...)
Send a message.
Definition: mbs_message.c:76
Runge-Kutta 4 structure for dirdyn.
Definition: mbs_rk4.h:31
void initialize_rk4(MbsData *mbs_data, MbsDirdyn *mbs_dd)
Initialize all needed fields in MbsDirdyn for RK4 integrator.
Definition: mbs_rk4.c:19
int save_realtime_update(MbsDirdyn *dd, MbsData *mbs_data)
update the real-time and saving modules if requested
Definition: mbs_dirdyn.c:1146
Definition: mbs_data.h:149
#define DIRDYN_INTEGRATOR_WAYPOINT_TIME_ERROR_max
Definition: mbs_dirdyn_struct.h:32
void finish_rk4(MbsData *mbs_data, MbsDirdyn *mbs_dd)
Finalize and clear memory allocated for RK4 integrator.
Definition: mbs_rk4.c:108
Structure defining the option of a direct dynamic.
Definition: mbs_dirdyn_struct.h:38
This header defines specific integrators functions in C.
int flag_stop
stop the simulation. For dirdyn, equil, invdyn and solvekin only.
Definition: mbs_data.h:298
void finish_rk4(MbsData *mbs_data, MbsDirdyn *dd)
Finalize and clear memory allocated for RK4 integrator.
Definition: mbs_rk4.c:108
int flag_solout_wp
1 to call solout only at required waypoints (only if flag_waypoint activated), default = 0
Definition: mbs_dirdyn_struct.h:122
General structure of the direct dynamic module.
Definition: mbs_dirdyn_struct.h:144
double dt
current integration step size
Definition: mbs_dirdyn_struct.h:150
This header defines global functions for Runge Kutta 4 integrator in C.
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_rk...
Definition: mbs_rk4.c:124
MbsDirdynOptions * options
structure defining the option of a direct dynamic
Definition: mbs_dirdyn_struct.h:146
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_rk...
Definition: mbs_rk4.c:124
int loop_rk4(double t0, double tf, MbsData *mbs_data, MbsDirdyn *mbs_dd)
Integrate the motion from t0 to tf.
Definition: mbs_rk4.c:34