Robotran C Documentation
mbs_custom.h
Go to the documentation of this file.
1 
13  #ifndef MBS_CUSTOM_H_INCLUDED
14 #define MBS_CUSTOM_H_INCLUDED
15 
16 #include "mbs_data.h"
17 #include "integrator.h"
18 #include "mbs_dirdyn.h"
19 #include "useful_functions.h"
20 #include "mbs_dirdyn_struct.h"
21 #include "mbs_project_interface.h"
22 #include "MBSfun.h"
23 
27 typedef struct MbsDirdynCustom
28 {
29  double *yt2;
30 
32 
38 void initialize_custom(MbsData *mbs_data, MbsDirdyn *mbs_dd);
39 
49 int loop_custom(double t0, double tf, MbsData *mbs_data, MbsDirdyn *mbs_dd);
50 
56 void finish_custom(MbsData *mbs_data, MbsDirdyn *mbs_dd);
57 
58 
66 void error_custom(MbsData *mbs_data, MbsDirdyn *dd, int err);
67 
68 #endif // MBS_CUSTOM_H_INCLUDED
error_custom
void error_custom(MbsData *mbs_data, MbsDirdyn *dd, int err)
If an error occurs during time integration, this function prints the error message and call finish_cu...
Definition: mbs_custom.c:125
MbsDirdynOptions::flag_precise_dynamics
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
useful_functions.h
mbs_dirdyn.h
MbsData::tsim
double tsim
The time value.
Definition: mbs_data.h:208
MbsDirdyn::y
double * y
Pointer to the state vector, this is a dvec_0 of size nState.
Definition: mbs_dirdyn_struct.h:153
mbs_data.h
MbsDirdyn::nState
int nState
size of the state vector
Definition: mbs_dirdyn_struct.h:152
mbs_dirdyn_struct.h
loop_custom
int loop_custom(double t0, double tf, MbsData *mbs_data, MbsDirdyn *mbs_dd)
Integrate the motion from t0 to tf with a custom integrator implemented by the user.
Definition: mbs_custom.c:39
get_dvec_0
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
finish_custom
void finish_custom(MbsData *mbs_data, MbsDirdyn *mbs_dd)
Finalize and clear memory allocated for Custom integrator.
Definition: mbs_custom.c:115
MbsDirdyn::yd
double * yd
Pointers to the derivative vector (dvec_0) of size nState.
Definition: mbs_dirdyn_struct.h:160
mbs_project_interface.h
MbsDirdyn::yout
double * yout
Allocation of a vector (dvec_0) of size nState.
Definition: mbs_dirdyn_struct.h:155
mbs_fct_dirdyn
int mbs_fct_dirdyn(double tsim, double y[], double dydt[], MbsData *s, MbsDirdyn *dd)
direct dynamics derivative computation
Definition: mbs_dirdyn.c:1067
initialize_custom
void initialize_custom(MbsData *mbs_data, MbsDirdyn *mbs_dd)
Initialize all needed fields in MbsDirdyn for Custom integrator.
Definition: mbs_custom.c:22
MBSfun.h
MbsDirdyn::integrator_struct
void * integrator_struct
pointer to store integrator structure
Definition: mbs_dirdyn_struct.h:183
MbsDirdynOptions::dt0
double dt0
initial value of the integration step size, default = 0.001
Definition: mbs_dirdyn_struct.h:45
loop_custom
int loop_custom(double t0, double tf, MbsData *mbs_data, MbsDirdyn *mbs_dd)
Integrate the motion from t0 to tf with a custom integrator implemented by the user.
Definition: mbs_custom.c:39
user_dirdyn_loop
void user_dirdyn_loop(MbsData *mbs_data, MbsDirdyn *mbs_dd)
user own loop functions
Definition: user_dirdyn.c:46
MbsDirdyn::tsim
double tsim
current simulation time
Definition: mbs_dirdyn_struct.h:149
mbs_msg
void mbs_msg(char *msg,...)
Send a message.
Definition: mbs_message.c:76
initialize_custom
void initialize_custom(MbsData *mbs_data, MbsDirdyn *mbs_dd)
Initialize all needed fields in MbsDirdyn for Custom integrator.
Definition: mbs_custom.c:22
bader.h
This header defines function for bader integrators in C. based on an external source.
save_realtime_update
int save_realtime_update(MbsDirdyn *dd, MbsData *mbs_data)
update the real-time and saving modules if requested
Definition: mbs_dirdyn.c:1146
mbs_message.h
mbs_euler_explicit.h
This header defines global functions for Euler Explicit integrator in C.
ThetaSC
int ThetaSC(double y[], double dydx[], int n, double x, double h, double yout[], int(*derivs)(double, double[], double[], MbsData *, MbsDirdyn *), MbsData *s, MbsDirdyn *dd)
Unknown integrator.
Definition: thetaSC.c:26
MbsData
Definition: mbs_data.h:149
DIRDYN_INTEGRATOR_WAYPOINT_TIME_ERROR_max
#define DIRDYN_INTEGRATOR_WAYPOINT_TIME_ERROR_max
Definition: mbs_dirdyn_struct.h:32
MbsDirdynCustom::yt2
double * yt2
allocated state vector
Definition: mbs_custom.h:29
MbsDirdynOptions
Structure defining the option of a direct dynamic.
Definition: mbs_dirdyn_struct.h:38
error_custom
void error_custom(MbsData *mbs_data, MbsDirdyn *dd, int err)
If an error occurs during time integration, this function prints the error message and call finish_cu...
Definition: mbs_custom.c:125
integrator.h
This header defines specific integrators functions in C.
MbsData::flag_stop
int flag_stop
stop the simulation. For dirdyn, equil, invdyn and solvekin only.
Definition: mbs_data.h:298
mbs_custom.h
This header defines global functions for custom integrator in C. Advanced user can modify this file.
MbsDirdynOptions::flag_solout_wp
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
MbsDirdyn
General structure of the direct dynamic module.
Definition: mbs_dirdyn_struct.h:144
MbsDirdyn::options
MbsDirdynOptions * options
structure defining the option of a direct dynamic
Definition: mbs_dirdyn_struct.h:146
mbs_warning_msg
void mbs_warning_msg(char *msg,...)
Send a warning message.
Definition: mbs_message.c:89
finish_custom
void finish_custom(MbsData *mbs_data, MbsDirdyn *mbs_dd)
Finalize and clear memory allocated for Custom integrator.
Definition: mbs_custom.c:115
MbsDirdynCustom
Custom integrator structure for dirdyn.
Definition: mbs_custom.h:27