|
Robotran C Documentation
|
Go to the documentation of this file.
15 #ifndef MBS_ROSENBROCK_H_INCLUDED
16 #define MBS_ROSENBROCK_H_INCLUDED
85 #endif // MBS_ROSENBROCK_H_INCLUDED
double solout_last_t
last time solout was called (0.0 by default)
Definition: mbs_rosenbrock.h:27
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
int(* derivs)(double, double[], double[], MbsData *, MbsDirdyn *)
The function computing the derivative of the system.
Definition: mbs_rosenbrock.h:38
void mbs_msg(const char *msg,...)
Send a message.
Definition: mbs_message.c:87
int * indx
Definition: mbs_rosenbrock.h:31
double * ysav
Definition: mbs_rosenbrock.h:33
void(* loop_fct)(MbsData *, MbsDirdyn *)
The function to be called at the end of each time step, or waypoints.
Definition: mbs_rosenbrock.h:40
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 * dydt_save
save dydt of the last time step
Definition: mbs_rosenbrock.h:29
int nState
size of the state vector
Definition: mbs_dirdyn_struct.h:174
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
int flag_save
1 if first dydt save done, 0 otherwise
Definition: mbs_rosenbrock.h:25
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
double * Freeze_dydx
Definition: mbs_rosenbrock.h:35
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
int nmax
maximal number of steps [-], default = 1e9
Definition: mbs_dirdyn_struct.h:132
double * Freeze_dfdx
Definition: mbs_rosenbrock.h:35
void free_dmat_0(double **mat)
release memory for a matrix of doubles, starting at index 0
Definition: mbs_matrix.c:332
void mbs_warning_msg(const char *msg,...)
Send a warning message.
Definition: mbs_message.c:100
This header defines global functions for rosenbrock integrator in C.
int loop_rosenbrock(double t0, double tf, MbsData *mbs_data, MbsDirdyn *mbs_dd)
Integrate the motion from t0 to tf.
Definition: mbs_rosenbrock.c:74
void initialize_rosenbrock(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 Rosenbrock integrator.
Definition: mbs_rosenbrock.c:31
void * integrator_struct
pointer to store integrator structure
Definition: mbs_dirdyn_struct.h:205
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 tsim
current simulation time
Definition: mbs_dirdyn_struct.h:171
Rosenbrock integration structure for dirdyn.
Definition: mbs_rosenbrock.h:23
double ** a
Definition: mbs_rosenbrock.h:32
void error_rosenbrock(MbsData *mbs_data, MbsDirdyn *dd, int err)
If an error occurs during time integration, this function prints the error message and call finish_ro...
Definition: mbs_rosenbrock.c:198
void error_rosenbrock(MbsData *mbs_data, MbsDirdyn *dd, int err)
If an error occurs during time integration, this function prints the error message and call finish_ro...
Definition: mbs_rosenbrock.c:198
double * g3
Definition: mbs_rosenbrock.h:33
double ** Freeze_dfdy
Definition: mbs_rosenbrock.h:35
double * g4
Definition: mbs_rosenbrock.h:33
double toler
mixed error tolerances [-], default = 1.0e-3
Definition: mbs_dirdyn_struct.h:133
void finish_rosenbrock(MbsData *mbs_data, MbsDirdyn *dd)
Finalize and clear memory allocated for Rosenbrock integrator.
Definition: mbs_rosenbrock.c:158
int(* save_realtime_update)(MbsDirdyn *dd, MbsData *mbs_data)
Definition: mbs_rosenbrock.h:42
double ** dfdy
Definition: mbs_rosenbrock.h:32
double * dfdx
Definition: mbs_rosenbrock.h:32
double * err
Definition: mbs_rosenbrock.h:32
int save_realtime_update(MbsDirdyn *dd, MbsData *mbs_data)
update the real-time and saving modules if requested
Definition: mbs_dirdyn.c:1252
int Freeze_jacobian_index
Definition: mbs_rosenbrock.h:36
double * g2
Definition: mbs_rosenbrock.h:33
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
#define DIRDYN_INTEGRATOR_WAYPOINT_TIME_ERROR_max
Definition: mbs_dirdyn_struct.h:32
void finish_rosenbrock(MbsData *mbs_data, MbsDirdyn *mbs_dd)
Finalize and clear memory allocated for Rosenbrock integrator.
Definition: mbs_rosenbrock.c:158
This header defines specific integrators functions in C.
int loop_rosenbrock(double t0, double tf, MbsData *mbs_data, MbsDirdyn *mbs_dd)
Integrate the motion from t0 to tf.
Definition: mbs_rosenbrock.c:74
void initialize_rosenbrock(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 Rosenbrock integrator.
Definition: mbs_rosenbrock.c:31
int flag_stop
stop the simulation. For dirdyn, equil, invdyn and solvekin only.
Definition: mbs_data.h:397
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 * dysav
Definition: mbs_rosenbrock.h:32
double * g1
Definition: mbs_rosenbrock.h:33
MbsDirdynOptions * options
structure defining the option of a direct dynamic
Definition: mbs_dirdyn_struct.h:168
int rosenbrock(int n, int(*derivs)(double, double[], double[], MbsData *, MbsDirdyn *), double *x, double y[], double eps, double hmax, double htry, long nmax, double dydx[], double yscal[], double *hnext, MbsData *s, MbsDirdyn *dd, double *hdid)
Fourth-order Rosenbrock step for integrating stiff problems, with monitoring of local truncation erro...
Definition: rosenbrock.c:105