|
Robotran C Documentation
|
Go to the documentation of this file.
13 #ifndef MBS_DOPRI5_H_INCLUDED
14 #define MBS_DOPRI5_H_INCLUDED
113 #endif // MBS_DOPRI5_H_INCLUDED
void initialize_dopri5(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 Dopri5 integrator.
Definition: mbs_dopri5.c:23
void mbs_msg(const char *msg,...)
Send a message.
Definition: mbs_message.c:87
int fcn_dopri5(unsigned int n, long nr, double tsim, double y[], double dydt[], MbsData *s, MbsDirdyn *mbs_dd)
dopri5 derivative function
Definition: mbs_dopri5.c:92
double dt0
Initial value of the integration step size [s]. For dirdyn and invdyn only. This parameter is set fro...
Definition: mbs_data.h:309
Dopri5 structure for dirdyn.
Definition: mbs_dopri5.h:23
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
#define DOPRI5_NB_ALLOC_VEC
number of vectors to allocate for dopri5
Definition: mbs_dirdyn_struct.h:22
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_do...
Definition: mbs_dopri5.c:168
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 dt_max
maximal time step [s], default = 1.0e-3
Definition: mbs_dirdyn_struct.h:136
Declaration of functions that are project dependent.
int nmax
maximal number of steps [-], default = 1e9
Definition: mbs_dirdyn_struct.h:132
int(* save_realtime_update)(MbsDirdyn *dd, MbsData *mbs_data)
Definition: mbs_dopri5.h:38
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
Definition: mbs_dopri5.c:133
void(* loop_fct)(MbsData *, MbsDirdyn *)
The function to be called at the end of each time step, or waypoints.
Definition: mbs_dopri5.h:35
int loop_dopri5(double t0, double tf, MbsData *mbs_data, MbsDirdyn *mbs_dd)
Integrate the motion from t0 to tf.
Definition: mbs_dopri5.c:50
void * integrator_struct
pointer to store integrator structure
Definition: mbs_dirdyn_struct.h:205
This header defines function for dopri5 in C. based on an external source (see below)
double dt0
initial value of the integration step size, default = 0.001
Definition: mbs_dirdyn_struct.h:45
void initialize_dopri5(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 Dopri5 integrator.
Definition: mbs_dopri5.c:23
void finish_dopri5(MbsData *mbs_data, MbsDirdyn *mbs_dd)
Finalize and clear memory allocated for dopri5 integrator.
Definition: mbs_dopri5.c:71
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_do...
Definition: mbs_dopri5.c:168
static double hout
Definition: dopri5.c:31
int save_realtime_update(MbsDirdyn *dd, MbsData *mbs_data)
update the real-time and saving modules if requested
Definition: mbs_dirdyn.c:1252
int dopri5(unsigned n, FcnEqDiff fcn, double x, double *y, double xend, double *rtoler, double *atoler, int itoler, SolTrait solout, int iout, double uround, double safe, double fac1, double fac2, double beta, double hmax, double h, long nmax, int meth, long nstiff, unsigned nrdens, unsigned *icont, unsigned licont, double **dopri5_alloc_tab, MbsData *s, MbsDirdyn *dd, double *last_h)
See the source file for more informations.
Definition: dopri5.c:528
void finish_dopri5(MbsData *mbs_data, MbsDirdyn *mbs_dd)
Finalize and clear memory allocated for dopri5 integrator.
Definition: mbs_dopri5.c:71
double * dydt_save
save dydt of the last time step
Definition: mbs_dopri5.h:29
int flag_save
1 if first dydt save done, 0 otherwise
Definition: mbs_dopri5.h:25
Definition: mbs_data.h:246
double rtoler
relative error tolerances [-], default = 1.0e-3
Definition: mbs_dirdyn_struct.h:134
double t0
Initial time of the simulation [s]. For dirdyn and invdyn only. This parameter is set from dirdyn/inv...
Definition: mbs_data.h:307
int flag_stop
stop the simulation. For dirdyn, equil, invdyn and solvekin only.
Definition: mbs_data.h:397
double solout_last_t
last time solout was called
Definition: mbs_dopri5.h:27
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
Definition: mbs_dopri5.c:133
int fcn_dopri5(unsigned int n, long nr, double tsim, double y[], double dydt[], MbsData *s, MbsDirdyn *mbs_dd)
dopri5 derivative function
Definition: mbs_dopri5.c:92
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
double ** alloc_tab
allocated state vectors
Definition: mbs_dopri5.h:31
double atoler
absolute error tolerances [-], default = 1.0e-6
Definition: mbs_dirdyn_struct.h:135
General structure of the direct dynamic module.
Definition: mbs_dirdyn_struct.h:166
int flag_waypoint
1 to use waypoints, 0 otherwise, default =0
Definition: mbs_dirdyn_struct.h:127
int loop_dopri5(double t0, double tf, MbsData *mbs_data, MbsDirdyn *mbs_dd)
Integrate the motion from t0 to tf.
Definition: mbs_dopri5.c:50
MbsDirdynOptions * options
structure defining the option of a direct dynamic
Definition: mbs_dirdyn_struct.h:168
int(* derivs)(double, double[], double[], MbsData *, MbsDirdyn *)
The function computing the derivative of the system.
Definition: mbs_dopri5.h:33