|
Robotran C Documentation
|
Go to the documentation of this file.
16 #ifndef MBS_W_METHODS_H_INCLUDED
17 #define MBS_W_METHODS_H_INCLUDED
21 #define W_S 2 // order of the method, 2 per default
34 #define W_A21 0.66666666666667
36 #define W_C2 0.66666666666667
39 #define W_GAMMA11 0.788675134594813 //(0.5 + (sqrt(3.0)/6.0))
40 #define W_GAMMA22 0.788675134594813 // (0.5 + (sqrt(3.0)/6.0))
41 #define W_GAMMA21 -1.051566846126417 //(-2.0 * W_A21 * W_GAMMA22)
122 #endif // MBS_W_METHODS_H_INCLUDED
double * Freeze_dfdx
Definition: mbs_w_methods.h:58
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 * jpxv
useful vector to store Jnp * xv [1 x nqu]
Definition: mbs_w_methods.h:66
void error_w_methods(MbsData *mbs_data, MbsDirdyn *dd, int err)
If an error occurs during time integration, this function prints the error message and call finish_w_...
Definition: mbs_w_methods.c:220
This header defines global functions for W methods integrator in C.
double ** Freeze_dfdy
Definition: mbs_w_methods.h:58
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
void(* loop_fct)(MbsData *, MbsDirdyn *)
The function to be called at the end of each time step, or waypoints.
Definition: mbs_w_methods.h:78
int(* derivs)(double, double[], double[], MbsData *, MbsDirdyn *)
The function computing the derivative of the system.
Definition: mbs_w_methods.h:76
#define W_S
Definition: mbs_w_methods.h:21
int nState
size of the state vector
Definition: mbs_dirdyn_struct.h:174
int loop_w_methods(double t0, double tf, MbsData *mbs_data, MbsDirdyn *mbs_dd)
Integrate the motion from t0 to tf.
Definition: mbs_w_methods.c:86
int nqu
Number of independent articulations.
Definition: mbs_data.h:262
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
double * dysav
vector save dydx from previous step [1xn]
Definition: mbs_w_methods.h:51
double ** dfdy
vector of derivatives of f by y [nxn]
Definition: mbs_w_methods.h:49
Declaration of functions that are project dependent.
void free_ivec_0(int *vec)
release memory for a vector of integers, starting with index 0
Definition: mbs_1D_array.c:490
double * B_param
Parameter B.
Definition: mbs_w_methods.h:72
void free_dmat_0(double **mat)
release memory for a matrix of doubles, starting at index 0
Definition: mbs_matrix.c:332
int(* save_realtime_update)(MbsDirdyn *dd, MbsData *mbs_data)
Definition: mbs_w_methods.h:80
double * yout
Allocation of a vector (dvec_0) of size nState.
Definition: mbs_dirdyn_struct.h:177
double ** A
left side of the equation, at step i [nqu x nqu]
Definition: mbs_w_methods.h:62
void mbs_warning_msg(const char *msg,...)
Send a warning message.
Definition: mbs_message.c:100
void error_w_methods(MbsData *mbs_data, MbsDirdyn *dd, int err)
If an error occurs during time integration, this function prints the error message and call finish_w_...
Definition: mbs_w_methods.c:220
void finish_w_methods(MbsData *mbs_data, MbsDirdyn *mbs_dd)
Finalize and clear memory allocated for W Methods integrator.
Definition: mbs_w_methods.c:165
double * partial_right_hand_term
partial rigth hand step variable [1 x nqu]
Definition: mbs_w_methods.h:65
void * integrator_struct
pointer to store integrator structure
Definition: mbs_dirdyn_struct.h:205
double * B
right side of the equation, at step i [1 x nqu]
Definition: mbs_w_methods.h:63
double * C_param
Parameter C.
Definition: mbs_w_methods.h:73
double ** get_dmat_0(int nb_r, int nb_c)
create (with memory allocation) a [nb_r times nb_c] matrix of doubles, starting at index 0
Definition: mbs_matrix.c:277
double tsim
current simulation time
Definition: mbs_dirdyn_struct.h:171
void initialize_w_methods(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 W Methods integrator.
Definition: mbs_w_methods.c:27
#define W_GAMMA11
Definition: mbs_w_methods.h:39
double * sum_alpha_gamma
internal step variable [1 x nqu]
Definition: mbs_w_methods.h:64
#define W_C1
Definition: mbs_w_methods.h:35
double ** GAM_param
Parameter Gamma.
Definition: mbs_w_methods.h:74
double * dfdx
vector of derivatives of f by x [1xn]
Definition: mbs_w_methods.h:50
#define W_B2
Definition: mbs_w_methods.h:38
#define W_GAMMA21
Definition: mbs_w_methods.h:41
double * Freeze_dydx
Definition: mbs_w_methods.h:58
#define W_GAMMA22
Definition: mbs_w_methods.h:40
int save_realtime_update(MbsDirdyn *dd, MbsData *mbs_data)
update the real-time and saving modules if requested
Definition: mbs_dirdyn.c:1252
void initialize_w_methods(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 W Methods integrator.
Definition: mbs_w_methods.c:27
double * ysav
vector save y from previous step [1xn]
Definition: mbs_w_methods.h:52
W Methods structure for dirdyn.
Definition: mbs_w_methods.h:46
int * get_ivec_0(int l_v)
create (with memory allocation) a vector (length l_v) of integers, starting at index 0
Definition: mbs_1D_array.c:474
int Freeze_jacobian_index
Definition: mbs_w_methods.h:59
Definition: mbs_data.h:246
#define DIRDYN_INTEGRATOR_WAYPOINT_TIME_ERROR_max
Definition: mbs_dirdyn_struct.h:32
double * A_param
Parameter A.
Definition: mbs_w_methods.h:71
#define W_B1
Definition: mbs_w_methods.h:37
double * intermediate_y
useful vector to store y [1xnqu]
Definition: mbs_w_methods.h:69
int loop_w_methods(double t0, double tf, MbsData *mbs_data, MbsDirdyn *mbs_dd)
Integrate the motion from t0 to tf.
Definition: mbs_w_methods.c:86
This header defines specific integrators functions in C.
int w_methods(double y[], double dydx[], int n, double x, double h, double yout[], int(*derivs)(double, double[], double[], MbsData *, MbsDirdyn *), MbsData *s, MbsDirdyn *mbs_dd)
W Methods integrator implementation.
Definition: w_methods.c:25
double * f
vector to store the call of f' [1xn]
Definition: mbs_w_methods.h:54
int flag_stop
stop the simulation. For dirdyn, equil, invdyn and solvekin only.
Definition: mbs_data.h:397
#define W_A21
first order parameters
Definition: mbs_w_methods.h:34
void free_dvec_0(double *vec)
release memory for a vector of doubles, starting at index 0
Definition: mbs_1D_array.c:971
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
double dt
current integration step size
Definition: mbs_dirdyn_struct.h:172
MbsDirdynOptions * options
structure defining the option of a direct dynamic
Definition: mbs_dirdyn_struct.h:168
double ** delta_p
to store delta p
Definition: mbs_w_methods.h:67
double ** delta_v
to store delta v
Definition: mbs_w_methods.h:68
void finish_w_methods(MbsData *mbs_data, MbsDirdyn *dd)
Finalize and clear memory allocated for W Methods integrator.
Definition: mbs_w_methods.c:165
#define W_C2
Definition: mbs_w_methods.h:36
int * indx
index for LU decomp and system resolution
Definition: mbs_w_methods.h:55