|
Robotran C Documentation
|
Go to the documentation of this file.
17 #ifndef MBS_RK4_H_INCLUDED
18 #define MBS_RK4_H_INCLUDED
77 #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:43
int flag_precise_dynamics
= 1 to call the direct dynamics at the beginning of each time step of integration.
Definition: mbs_dirdyn_struct.h:118
void mbs_msg(const char *msg,...)
Send a message.
Definition: mbs_message.c:87
double tsim
The time value.
Definition: mbs_data.h:305
double * y
Pointer to the state vector, this is a dvec_0 of size nState.
Definition: mbs_dirdyn_struct.h:175
int nState
size of the state vector
Definition: mbs_dirdyn_struct.h:174
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:955
double * yd
Pointers to the derivative vector (dvec_0) of size nState.
Definition: mbs_dirdyn_struct.h:182
Declaration of functions that are project dependent.
double * dym
allocated saved derivative vector
Definition: mbs_rk4.h:29
double * dyt
allocated derivative vector
Definition: mbs_rk4.h:28
double * yout
Allocation of a vector (dvec_0) of size nState.
Definition: mbs_dirdyn_struct.h:177
double * yt
allocated state vector
Definition: mbs_rk4.h:27
void * integrator_struct
pointer to store integrator structure
Definition: mbs_dirdyn_struct.h:205
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:22
double tsim
current simulation time
Definition: mbs_dirdyn_struct.h:171
int(* derivs)(double, double[], double[], MbsData *, MbsDirdyn *)
The function computing the derivative of the system.
Definition: mbs_rk4.h:31
Runge-Kutta 4 structure for dirdyn.
Definition: mbs_rk4.h:25
int(* save_realtime_update)(MbsDirdyn *dd, MbsData *mbs_data)
Definition: mbs_rk4.h:35
int save_realtime_update(MbsDirdyn *dd, MbsData *mbs_data)
update the real-time and saving modules if requested
Definition: mbs_dirdyn.c:1252
Definition: mbs_data.h:246
#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:121
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:397
void finish_rk4(MbsData *mbs_data, MbsDirdyn *dd)
Finalize and clear memory allocated for RK4 integrator.
Definition: mbs_rk4.c:121
int flag_solout_wp
1 to call solout only at required waypoints (only if flag_waypoint activated), default = 0
Definition: mbs_dirdyn_struct.h:128
General structure of the direct dynamic module.
Definition: mbs_dirdyn_struct.h:166
void initialize_rk4(MbsData *mbs_data, MbsDirdyn *mbs_dd, int(*derivs)(double, double[], double[], MbsData *, MbsDirdyn *), void(*loop_fct)(MbsData *, MbsDirdyn *), int(*save_realtime_update)(MbsDirdyn *dd, MbsData *mbs_data))
Initialize all needed fields in MbsDirdyn for RK4 integrator.
Definition: mbs_rk4.c:24
double dt
current integration step size
Definition: mbs_dirdyn_struct.h:172
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:138
void initialize_rk4(MbsData *mbs_data, MbsDirdyn *mbs_dd, int(*derivs)(double, double[], double[], MbsData *, MbsDirdyn *), void(*loop_fct)(MbsData *, MbsDirdyn *), int(*save_realtime_update)(MbsDirdyn *dd, MbsData *mbs_data))
Initialize all needed fields in MbsDirdyn for RK4 integrator.
Definition: mbs_rk4.c:24
MbsDirdynOptions * options
structure defining the option of a direct dynamic
Definition: mbs_dirdyn_struct.h:168
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:138
void(* loop_fct)(MbsData *, MbsDirdyn *)
The function to be called at the end of each time step, or waypoints.
Definition: mbs_rk4.h:33
int loop_rk4(double t0, double tf, MbsData *mbs_data, MbsDirdyn *mbs_dd)
Integrate the motion from t0 to tf.
Definition: mbs_rk4.c:43