|
Robotran C Documentation
|
Go to the documentation of this file.
15 #ifndef MBS_BADER_H_INCLUDED
16 #define MBS_BADER_H_INCLUDED
81 #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:112
#define KMAXX
Definition: bader.h:30
int loop_bader(double t0, double tf, MbsData *mbs_data, MbsDirdyn *mbs_dd)
Integrate the motion from t0 to tf.
Definition: mbs_bader.c:61
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:30
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:208
double * y
Pointer to the state vector, this is a dvec_0 of size nState.
Definition: mbs_dirdyn_struct.h:153
double * yerr
Definition: mbs_bader.h:31
int nState
size of the state vector
Definition: mbs_dirdyn_struct.h:152
This header defines global functions for Bader integrator in C.
double ** Freeze_dfdy
Definition: mbs_bader.h:34
int nqu
Number of independent articulations.
Definition: mbs_data.h:165
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:204
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
double dt_max
maximal time step [s], default = 1.0e-3
Definition: mbs_dirdyn_struct.h:130
double * yd
Pointers to the derivative vector (dvec_0) of size nState.
Definition: mbs_dirdyn_struct.h:160
void free_ivec_0(int *vec)
release memory for a vector of integers, starting with index 0
Definition: mbs_1D_array.c:415
double * ytemp
Definition: mbs_bader.h:39
double * c
pzextr and rzextr pointors
Definition: mbs_bader.h:42
void free_dmat_0(double **mat)
release memory for a matrix of doubles, starting at index 0
Definition: mbs_matrix.c:293
int mbs_fct_dirdyn(double tsim, double y[], double dydt[], MbsData *s, MbsDirdyn *dd)
direct dynamics derivative computation
Definition: mbs_dirdyn.c:1067
void finish_bader(MbsData *mbs_data, MbsDirdyn *mbs_dd)
Finalize and clear memory allocated for Bader integrator.
Definition: mbs_bader.c:158
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:107
double * err
Definition: mbs_bader.h:31
int dummy
Definition: mbs_bader.h:30
void * integrator_struct
pointer to store integrator structure
Definition: mbs_dirdyn_struct.h:183
double ** d
Definition: mbs_bader.h:32
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:238
double dt0
initial value of the integration step size, default = 0.001
Definition: mbs_dirdyn_struct.h:45
double * yseq
Definition: mbs_bader.h:31
void user_dirdyn_loop(MbsData *mbs_data, MbsDirdyn *mbs_dd)
user own loop functions
Definition: user_dirdyn.c:46
int * indx
simpr specific pointors
Definition: mbs_bader.h:38
double tsim
current simulation time
Definition: mbs_dirdyn_struct.h:149
double ** dfdy
Definition: mbs_bader.h:39
void mbs_msg(char *msg,...)
Send a message.
Definition: mbs_message.c:76
double * Freeze_dfdx
Definition: mbs_bader.h:34
double * del
Definition: mbs_bader.h:39
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:134
void free_dvec_1(double *vec)
release memory for a vector of doubles, starting at index 1
Definition: mbs_1D_array.c:901
void finish_bader(MbsData *mbs_data, MbsDirdyn *dd)
Finalize and clear memory allocated for Bader integrator.
Definition: mbs_bader.c:158
double toler
mixed error tolerances [-], default = 1.0e-3
Definition: mbs_dirdyn_struct.h:127
double * dfdx
Definition: mbs_bader.h:39
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:204
#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:192
This header defines function for bader integrators in C. based on an external source.
double * fx
Definition: mbs_bader.h:42
double * Freeze_dydx
Definition: mbs_bader.h:34
void initialize_bader(MbsData *mbs_data, MbsDirdyn *mbs_dd)
Initialize all needed fields in MbsDirdyn for Bader integrator.
Definition: mbs_bader.c:23
int save_realtime_update(MbsDirdyn *dd, MbsData *mbs_data)
update the real-time and saving modules if requested
Definition: mbs_dirdyn.c:1146
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:399
Definition: mbs_data.h:149
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:32
Structure defining the option of a direct dynamic.
Definition: mbs_dirdyn_struct.h:38
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:27
This header defines specific integrators functions in C.
double ** a
Definition: mbs_bader.h:39
int flag_stop
stop the simulation. For dirdyn, equil, invdyn and solvekin only.
Definition: mbs_data.h:298
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:885
int Freeze_jacobian_index
Definition: mbs_bader.h:35
void free_dmat_1(double **mat)
release memory for a matrix of doubles, starting at index 1
Definition: mbs_matrix.c:301
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:906
void free_dvec_0(double *vec)
release memory for a vector of doubles, starting at index 0
Definition: mbs_1D_array.c:896
int loop_bader(double t0, double tf, MbsData *mbs_data, MbsDirdyn *mbs_dd)
Integrate the motion from t0 to tf.
Definition: mbs_bader.c:61
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
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:255
void initialize_bader(MbsData *mbs_data, MbsDirdyn *mbs_dd)
Initialize all needed fields in MbsDirdyn for Bader integrator.
Definition: mbs_bader.c:23
General structure of the direct dynamic module.
Definition: mbs_dirdyn_struct.h:144
double * ysav
Definition: mbs_bader.h:31
Euler Implicit structure for dirdyn.
Definition: mbs_euler_implicit.h:31
bader structure for dirdyn
Definition: mbs_bader.h:28
MbsDirdynOptions * options
structure defining the option of a direct dynamic
Definition: mbs_dirdyn_struct.h:146
void mbs_warning_msg(char *msg,...)
Send a warning message.
Definition: mbs_message.c:89