|
Robotran C Documentation
|
Go to the documentation of this file.
15 #ifndef MBS_BADER_H_INCLUDED
16 #define MBS_BADER_H_INCLUDED
85 #endif // MBS_BADER_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:118
#define KMAXX
Definition: bader.h:28
void initialize_bader(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 Bader integrator.
Definition: mbs_bader.c:23
void mbs_msg(const char *msg,...)
Send a message.
Definition: mbs_message.c:87
int loop_bader(double t0, double tf, MbsData *mbs_data, MbsDirdyn *mbs_dd)
Integrate the motion from t0 to tf.
Definition: mbs_bader.c:65
int mbs_estim_jac_acc(double x, double htry, double y[], double dydx[], int compute_dfdx, double dfdx[], double **dfdy, int n, int(*derivs)(double, double[], double[], MbsData *, MbsDirdyn *), MbsData *s, MbsDirdyn *dd)
Evaluate the Jacobian of a function accelerations using finite difference.
Definition: integrator.c:35
This header defines global functions for Euler Implicit integrator in C.
void lubksb_0(double **a, int n, int *indx, double b[])
Definition: lubksb.c:31
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
double * yerr
Definition: mbs_bader.h:25
int nState
size of the state vector
Definition: mbs_dirdyn_struct.h:174
This header defines global functions for Bader integrator in C.
double ** Freeze_dfdy
Definition: mbs_bader.h:28
int nqu
Number of independent articulations.
Definition: mbs_data.h:262
void error_bader(MbsData *mbs_data, MbsDirdyn *dd, int err)
If an error occurs during time integration, this function prints the error message and call finish_ba...
Definition: mbs_bader.c:211
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
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.
void free_ivec_0(int *vec)
release memory for a vector of integers, starting with index 0
Definition: mbs_1D_array.c:490
double * ytemp
Definition: mbs_bader.h:33
double * c
pzextr and rzextr pointors
Definition: mbs_bader.h:36
void free_dmat_0(double **mat)
release memory for a matrix of doubles, starting at index 0
Definition: mbs_matrix.c:332
void finish_bader(MbsData *mbs_data, MbsDirdyn *mbs_dd)
Finalize and clear memory allocated for Bader integrator.
Definition: mbs_bader.c:165
void mbs_warning_msg(const char *msg,...)
Send a warning message.
Definition: mbs_message.c:100
int mbs_freeze_jac(int freeze_index, int *next_freeze_index, double x, double h, double y[], double dydx[], int compute_dfdx, double dfdx[], double **dfdy, double dydx_freeze[], double dfdx_freeze[], double **dfdy_freeze, int n, int(*derivs)(double, double[], double[], MbsData *, MbsDirdyn *), MbsData *s, MbsDirdyn *mbs_dd)
Freeze the Jacobian of an integrator structure until mbs_dd->options->n_freeze.
Definition: integrator.c:129
void(* loop_fct)(MbsData *, MbsDirdyn *)
The function to be called at the end of each time step, or waypoints.
Definition: mbs_bader.h:40
double * err
Definition: mbs_bader.h:25
int dummy
Definition: mbs_bader.h:24
void * integrator_struct
pointer to store integrator structure
Definition: mbs_dirdyn_struct.h:205
int(* save_realtime_update)(MbsDirdyn *dd, MbsData *mbs_data)
Definition: mbs_bader.h:42
double ** d
Definition: mbs_bader.h:26
int ludcmp_0(double **a, int n, int *indx, double *d)
LU decomposition of a matrix with index starting at 0.
Definition: ludcmp.c:82
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 dt0
initial value of the integration step size, default = 0.001
Definition: mbs_dirdyn_struct.h:45
double * yseq
Definition: mbs_bader.h:25
int * indx
simpr specific pointors
Definition: mbs_bader.h:32
double tsim
current simulation time
Definition: mbs_dirdyn_struct.h:171
double ** dfdy
Definition: mbs_bader.h:33
void initialize_bader(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 Bader integrator.
Definition: mbs_bader.c:23
double * Freeze_dfdx
Definition: mbs_bader.h:28
double * del
Definition: mbs_bader.h:33
int n_freeze
number of time step when the jacobian is freezed (computed once at the start of the n_freeze time ste...
Definition: mbs_dirdyn_struct.h:140
void free_dvec_1(double *vec)
release memory for a vector of doubles, starting at index 1
Definition: mbs_1D_array.c:976
void finish_bader(MbsData *mbs_data, MbsDirdyn *dd)
Finalize and clear memory allocated for Bader integrator.
Definition: mbs_bader.c:165
double toler
mixed error tolerances [-], default = 1.0e-3
Definition: mbs_dirdyn_struct.h:133
double * dfdx
Definition: mbs_bader.h:33
void error_bader(MbsData *mbs_data, MbsDirdyn *dd, int err)
If an error occurs during time integration, this function prints the error message and call finish_ba...
Definition: mbs_bader.c:211
#define _MBS_ERR_MOD_SPEC_16
Generic error number Module specific errors range from -11 to -19 please read the error message a...
Definition: mbs_errors_names.h:202
This header defines function for bader integrators in C. based on an external source.
double * fx
Definition: mbs_bader.h:36
double * Freeze_dydx
Definition: mbs_bader.h:28
int save_realtime_update(MbsDirdyn *dd, MbsData *mbs_data)
update the real-time and saving modules if requested
Definition: mbs_dirdyn.c:1252
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
Definition: mbs_data.h:246
int bader(double y[], double dydx[], int nv, double *xx, double htry, double eps, double yscal[], double *hdid, double *hnext, double h_max, int(*derivs)(double, double[], double[], MbsData *, MbsDirdyn *), MbsData *s, MbsDirdyn *dd)
Semi - implicit extrapolation step for integrating stiffo.d.e.
Definition: bader.c:31
#define DIRDYN_INTEGRATOR_WAYPOINT_TIME_ERROR_max
Definition: mbs_dirdyn_struct.h:32
double * x
Definition: mbs_bader.h:26
int euler_implicit(double y[], double dydx[], int n, double *x, double h, double yout[], int(*derivs)(double, double[], double[], MbsData *, MbsDirdyn *), MbsData *s, MbsDirdyn *mbs_dd)
Euler Implicit integrator implementation.
Definition: euler_implicit.c:25
This header defines specific integrators functions in C.
int(* derivs)(double, double[], double[], MbsData *, MbsDirdyn *)
The function computing the derivative of the system.
Definition: mbs_bader.h:38
double ** a
Definition: mbs_bader.h:33
int flag_stop
stop the simulation. For dirdyn, equil, invdyn and solvekin only.
Definition: mbs_data.h:397
double * get_dvec_1(int l_v)
create (with memory allocation) a vector (length l_v) of doubles, starting at index 1
Definition: mbs_1D_array.c:960
int Freeze_jacobian_index
Definition: mbs_bader.h:29
void free_dmat_1(double **mat)
release memory for a matrix of doubles, starting at index 1
Definition: mbs_matrix.c:340
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:981
void free_dvec_0(double *vec)
release memory for a vector of doubles, starting at index 0
Definition: mbs_1D_array.c:971
int loop_bader(double t0, double tf, MbsData *mbs_data, MbsDirdyn *mbs_dd)
Integrate the motion from t0 to tf.
Definition: mbs_bader.c:65
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 ** get_dmat_1(int nb_r, int nb_c)
create (with memory allocation) a [nb_r times nb_c] matrix of doubles, starting at index 1
Definition: mbs_matrix.c:294
General structure of the direct dynamic module.
Definition: mbs_dirdyn_struct.h:166
double * ysav
Definition: mbs_bader.h:25
Euler Implicit structure for dirdyn.
Definition: mbs_euler_implicit.h:24
bader structure for dirdyn
Definition: mbs_bader.h:22
MbsDirdynOptions * options
structure defining the option of a direct dynamic
Definition: mbs_dirdyn_struct.h:168