Robotran C Documentation
bader.h
Go to the documentation of this file.
1 
18 #ifndef BADER_H_INCLUDED
19 #define BADER_H_INCLUDED
20 
21 #include "mbs_data.h"
22 #include "integrator.h"
23 #include "mbs_dirdyn.h"
24 #include "useful_functions.h"
25 #include "mbs_dirdyn_struct.h"
26 #include "mbs_project_interface.h"
27 #include "MBSfun.h"
28 #include "nrfct.h"
29 
30 #define KMAXX 7
31 #define IMAXX (KMAXX+1)
32 #define SAFE1 0.25
33 #define SAFE2 0.7
34 #define REDMAX 1.0e-5
35 #define REDMIN 0.7
36 #define TINY 1.0e-30
37 #define SCALMX 0.1
38 
59 int simpr(double y[], double dydx[], int nvar, double xs, double htot, int nstep, double yout[],
60  int(*derivs)(double, double[], double[], MbsData *, MbsDirdyn *), MbsData *s, MbsDirdyn *dd);
61 
81 int mmid(double y[], double dydx[], int nvar, double xs, double htot, int nstep, double yout[],
82  int(*derivs)(double, double[], double[], MbsData *, MbsDirdyn *),
83  MbsData *s, MbsDirdyn *dd);
84 
114 int bader(double y[], double dydx[], int nv, double *xx, double htry, double eps,
115  double yscal[], double *hdid, double *hnext, double h_max,
116  int(*derivs)(double, double[], double[], MbsData *, MbsDirdyn *), MbsData *s, MbsDirdyn *dd);
117 
133 void pzextr(int iest, double xest, double yest[], double yz[], double dy[], int nv, MbsData *s, MbsDirdyn *dd);
134 
135 
140 void rzextr(int iest, double xest, double yest[], double yz[], double dy[], int nv, MbsData *s, MbsDirdyn *dd);
141 
142 #endif // BADER_H_INCLUDED
dmaxarg1
static double dmaxarg1
Definition: bader.c:28
sqrarg
static double sqrarg
Definition: bader.c:28
KMAXX
#define KMAXX
Definition: bader.h:30
complex_float
Implementation of eig function using lapacke without using the lapackE interface.
Definition: cholesky.c:14
mbs_estim_jac_acc
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
useful_functions.h
lubksb_0
void lubksb_0(double **a, int n, int *indx, double b[])
Definition: lubksb.c:31
mbs_dirdyn.h
pzextr
void pzextr(int iest, double xest, double yest[], double yz[], double dy[], int nv, MbsData *s, MbsDirdyn *dd)
Use polynomial extrapolation to evaluate nv functions at x = 0 by fitting a polynomial to a sequence ...
Definition: bader.c:353
mbs_data.h
mbs_bader.h
This header defines global functions for Bader integrator in C.
mbs_dirdyn_struct.h
dminarg1
static double dminarg1
Definition: bader.c:29
get_dvec_0
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
maxarg1
static double maxarg1
Definition: bader.c:28
lubksb
void lubksb(double **a, int n, int *indx, double b[])
Definition: lubksb.c:10
rzextr
void rzextr(int iest, double xest, double yest[], double yz[], double dy[], int nv, MbsData *s, MbsDirdyn *dd)
Exact substitute for pzextr, but uses diagonal rational function extrapolation instead of polynomial ...
Definition: bader.c:387
mbs_project_interface.h
free_ivec_0
void free_ivec_0(int *vec)
release memory for a vector of integers, starting with index 0
Definition: mbs_1D_array.c:415
SAFE1
#define SAFE1
Definition: bader.h:32
free_dmat_0
void free_dmat_0(double **mat)
release memory for a matrix of doubles, starting at index 0
Definition: mbs_matrix.c:293
mbs_invLU_0
int mbs_invLU_0(double **A, double **Am1, int n)
Inverse the square matrix A using a LU decomposition.
Definition: inverse_lapack.c:28
maxarg2
static double maxarg2
Definition: bader.c:28
rzextr
void rzextr(int iest, double xest, double yest[], double yz[], double dy[], int nv, MbsData *s, MbsDirdyn *dd)
Exact substitute for pzextr, but uses diagonal rational function extrapolation instead of polynomial ...
Definition: bader.c:387
mbs_matrix.h
k1
double * k1
Definition: dopri5.c:32
minarg2
static double minarg2
Definition: bader.c:29
dminarg2
static double dminarg2
Definition: bader.c:29
ludcmp
int ludcmp(double **a, int n, int *indx, double *d)
LU decomposition of a matrix with index starting at 1.
Definition: ludcmp.c:19
mbs_freeze_jac
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
complex_double
Definition: cholesky.c:15
_MBS_ERR_LOW_LU_DCMP
#define _MBS_ERR_LOW_LU_DCMP
Low Level error number LU decompostion = -2.
Definition: mbs_errors_names.h:122
complex_float::x
float x
Definition: cholesky.c:14
mbs_1D_array.h
mmid
int mmid(double y[], double dydx[], int nvar, double xs, double htot, int nstep, double yout[], int(*derivs)(double, double[], double[], MbsData *, MbsDirdyn *), MbsData *s, MbsDirdyn *dd)
Modified midpoint step.
Definition: bader.c:286
MBSfun.h
MbsDirdyn::integrator_struct
void * integrator_struct
pointer to store integrator structure
Definition: mbs_dirdyn_struct.h:183
ludcmp_0
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
get_dmat_0
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
minarg1
static double minarg1
Definition: bader.c:29
nstep
static long nstep
Definition: dopri5.c:29
MbsDirdyn::tsim
double tsim
current simulation time
Definition: mbs_dirdyn_struct.h:149
mbs_msg
void mbs_msg(char *msg,...)
Send a message.
Definition: mbs_message.c:76
dmaxarg2
static double dmaxarg2
Definition: bader.c:28
simpr
int simpr(double y[], double dydx[], int nvar, double xs, double htot, int nstep, double yout[], int(*derivs)(double, double[], double[], MbsData *, MbsDirdyn *), MbsData *s, MbsDirdyn *dd)
Performs one step of semi-implicit midpoint rule.
Definition: bader.c:169
TINY
#define TINY
Definition: ludcmp.c:17
complex_float::y
float y
Definition: cholesky.c:14
MbsDirdynOptions::n_freeze
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
free_dvec_1
void free_dvec_1(double *vec)
release memory for a vector of doubles, starting at index 1
Definition: mbs_1D_array.c:901
complex_double::y
double y
Definition: cholesky.c:15
simpr
int simpr(double y[], double dydx[], int nvar, double xs, double htot, int nstep, double yout[], int(*derivs)(double, double[], double[], MbsData *, MbsDirdyn *), MbsData *s, MbsDirdyn *dd)
Performs one step of semi-implicit midpoint rule.
Definition: bader.c:169
SAFE2
#define SAFE2
Definition: bader.h:33
REDMIN
#define REDMIN
Definition: bader.h:35
mmid
int mmid(double y[], double dydx[], int nvar, double xs, double htot, int nstep, double yout[], int(*derivs)(double, double[], double[], MbsData *, MbsDirdyn *), MbsData *s, MbsDirdyn *dd)
Modified midpoint step.
Definition: bader.c:286
_MBS_ERR_MOD_SPEC_16
#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
nrfct.h
bader.h
This header defines function for bader integrators in C. based on an external source.
bader
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
transpose_dmat_0
void transpose_dmat_0(double **tab_src, double **tab_dest, int nb_r, int nb_c)
Transpose a [nb_r times nb_c] matrix of doubles and store the results in a [y times nb_r] matrix,...
Definition: mbs_matrix.c:440
mbs_message.h
REDMAX
#define REDMAX
Definition: bader.h:34
get_ivec_0
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
complex_double::x
double x
Definition: cholesky.c:15
MbsData
Definition: mbs_data.h:149
bader
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
integrator.h
This header defines specific integrators functions in C.
get_dvec_1
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
free_dvec_0
void free_dvec_0(double *vec)
release memory for a vector of doubles, starting at index 0
Definition: mbs_1D_array.c:896
MbsDirdyn
General structure of the direct dynamic module.
Definition: mbs_dirdyn_struct.h:144
pzextr
void pzextr(int iest, double xest, double yest[], double yz[], double dy[], int nv, MbsData *s, MbsDirdyn *dd)
Use polynomial extrapolation to evaluate nv functions at x = 0 by fitting a polynomial to a sequence ...
Definition: bader.c:353
MbsDirdynBader
bader structure for dirdyn
Definition: mbs_bader.h:28
IMAXX
#define IMAXX
Definition: bader.h:31
MbsDirdyn::options
MbsDirdynOptions * options
structure defining the option of a direct dynamic
Definition: mbs_dirdyn_struct.h:146
SCALMX
#define SCALMX
Definition: bader.h:37
_MBS_ERR_LOW_LAPACKE
#define _MBS_ERR_LOW_LAPACKE
Low Level error number problem with Lapacke system resolution = -5.
Definition: mbs_errors_names.h:137
mbs_errors_names.h