|
Robotran C Documentation
|
Go to the documentation of this file.
15 #ifndef MBS_EULEREX_H_INCLUDED
16 #define MBS_EULEREX_H_INCLUDED
20 #define P_INF_VALUE 0.143 // value tat was best for haptic piano, see ST
115 #endif // MBS_EULEREX_H_INCLUDED
int flag_precise_dynamics
= 1 to call the direct dynamics at the beginning of each time step of integration.
Definition: mbs_dirdyn_struct.h:162
void mbs_msg(const char *msg,...)
Send a message.
Definition: mbs_message.c:87
void alpha_method(double h, MbsData *mbs_data, MbsDirdyn *mbs_dd)
Source code for a simplified alpha-method We call it AlphaM.
Definition: mbs_euler_explicit.c:179
double tsim
The time value.
Definition: mbs_data.h:306
int(* derivs)(double, double[], double[], MbsData *, MbsDirdyn *)
The function computing the derivative of the system.
Definition: mbs_euler_explicit.h:37
double * y
Pointer to the state vector, this is a dvec_0 of size nState.
Definition: mbs_dirdyn_struct.h:219
int nState
size of the state vector
Definition: mbs_dirdyn_struct.h:218
void euler_explicit(double h, MbsData *mbs_data, MbsDirdyn *mbs_dd)
Source code for the Euler Explicit integration.
Definition: mbs_euler_explicit.c:155
int nqu
Number of independent articulations.
Definition: mbs_data.h:263
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:1055
double alpha_f
Definition: mbs_euler_explicit.h:35
double * yd
Pointers to the derivative vector (dvec_0) of size nState.
Definition: mbs_dirdyn_struct.h:226
Declaration of functions that are project dependent.
void(* loop_fct)(MbsData *, MbsDirdyn *)
The function to be called at the end of each time step, or waypoints.
Definition: mbs_euler_explicit.h:39
void error_eulerEx(MbsData *mbs_data, MbsDirdyn *dd, int err)
If an error occurs during time integration, this function prints the error message and call finish_eu...
Definition: mbs_euler_explicit.c:145
@ Eulaire
Definition: integrator.h:29
#define P_INF_VALUE
Definition: mbs_euler_explicit.h:20
void mbs_warning_msg(const char *msg,...)
Send a warning message.
Definition: mbs_message.c:100
void eulaire(double h, MbsData *mbs_data, MbsDirdyn *mbs_dd)
Source code for unknown integrator but based partially on euler explicit We call it Eulaire.
Definition: mbs_euler_explicit.c:167
int loop_eulerEx(double t0, double tf, MbsData *mbs_data, MbsDirdyn *mbs_dd)
Integrate the motion from t0 to tf.
Definition: mbs_euler_explicit.c:64
double alpha_m
Definition: mbs_euler_explicit.h:35
void * integrator_struct
pointer to store integrator structure
Definition: mbs_dirdyn_struct.h:262
int(* save_realtime_update)(MbsDirdyn *dd, MbsData *mbs_data)
Definition: mbs_euler_explicit.h:41
double dt0
initial value of the integration step size, default = 0.001
Definition: mbs_dirdyn_struct.h:45
void finish_eulerEx(MbsData *mbs_data, MbsDirdyn *mbs_dd)
Finalize and clear memory allocated for Euler Explicit integrator.
Definition: mbs_euler_explicit.c:128
int loop_eulerEx(double t0, double tf, MbsData *mbs_data, MbsDirdyn *mbs_dd)
Integrate the motion from t0 to tf.
Definition: mbs_euler_explicit.c:64
double tsim
current simulation time
Definition: mbs_dirdyn_struct.h:215
double beta
Definition: mbs_euler_explicit.h:35
@ AlphaM
Definition: integrator.h:29
Euler Explicit structure for dirdyn.
Definition: mbs_euler_explicit.h:30
double div_alpha_m
internal parameters of the alpha-method
Definition: mbs_euler_explicit.h:35
void initialize_eulerEx(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 Euler Explicit integrator.
Definition: mbs_euler_explicit.c:23
void euler_explicit(double h, MbsData *mbs_data, MbsDirdyn *mbs_dd)
Source code for the Euler Explicit integration.
Definition: mbs_euler_explicit.c:155
double gamma
Definition: mbs_euler_explicit.h:35
void finish_eulerEx(MbsData *mbs_data, MbsDirdyn *dd)
Finalize and clear memory allocated for Euler Explicit integrator.
Definition: mbs_euler_explicit.c:128
void alpha_method(double h, MbsData *mbs_data, MbsDirdyn *mbs_dd)
Source code for a simplified alpha-method We call it AlphaM.
Definition: mbs_euler_explicit.c:179
int save_realtime_update(MbsDirdyn *dd, MbsData *mbs_data)
update the real-time and saving modules if requested
Definition: mbs_dirdyn.c:1451
This header defines global functions for Euler Explicit integrator in C.
double * a_n_1
vector used for alpha-method to store current internal accelerations
Definition: mbs_euler_explicit.h:34
void error_eulerEx(MbsData *mbs_data, MbsDirdyn *dd, int err)
If an error occurs during time integration, this function prints the error message and call finish_eu...
Definition: mbs_euler_explicit.c:145
euler_integrator_implementation choice_of_euler
to choose between Eulaire, Alpah method and Euler explicit
Definition: mbs_euler_explicit.h:32
Definition: mbs_data.h:247
void initialize_eulerEx(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 Euler Explicit integrator.
Definition: mbs_euler_explicit.c:23
#define DIRDYN_INTEGRATOR_WAYPOINT_TIME_ERROR_max
Definition: mbs_dirdyn_struct.h:32
This header defines specific integrators functions in C.
int integrator
Set integrator to use, available value: RK4, Dopri5, Rosenbrock, EulerEx, Eulaire,...
Definition: mbs_dirdyn_struct.h:153
int flag_stop
stop the simulation in case of non zero value. Negative for error, positive for user_wanted behavior.
Definition: mbs_data.h:409
void copy_dvec_0(double *vec_src, double *vec_dest, int l_v)
Copy the content of a vector (of sizel_v) of doubles to a second vector, starting with index 0.
Definition: mbs_1D_array.c:1100
void free_dvec_0(double *vec)
release memory for a vector of doubles, starting at index 0
Definition: mbs_1D_array.c:1090
int flag_solout_wp
1 to call solout only at required waypoints (only if flag_waypoint activated), default = 0
Definition: mbs_dirdyn_struct.h:172
General structure of the direct dynamic module.
Definition: mbs_dirdyn_struct.h:210
double dt
current integration step size
Definition: mbs_dirdyn_struct.h:216
MbsDirdynOptions * options
structure defining the option of a direct dynamic
Definition: mbs_dirdyn_struct.h:212
double * a_n
vector used for alpha-method to store previous internal accelerations
Definition: mbs_euler_explicit.h:33
void eulaire(double h, MbsData *mbs_data, MbsDirdyn *mbs_dd)
Source code for unknown integrator but based partially on euler explicit We call it Eulaire.
Definition: mbs_euler_explicit.c:167
void(* euler_integrator_implementation)(double h, MbsData *mbs_data, MbsDirdyn *mbs_dd)
This pointer is used to choose between the two implementations of euler.
Definition: mbs_euler_explicit.h:25