Robotran C Documentation
mbs_linalg.h
Go to the documentation of this file.
1 
12 #ifndef mbs_lingalg_h
13 #define mbs_lingalg_h
14 /*--------------------*/
15 
16 
29 int mbs_eig_0(double **A, int n, double *eval_a, double *eval_b, double **evec_a, double **evec_b);
30 
43 int mbs_schur_0(double **A, int n, double **T, double **Z, double *WR, double *WI, int reorder);
44 
51 int mbs_rank_0(double** A, int m, int n);
52 
65 int mbs_choldc_0(double **A, int n);
66 
81 int mbs_cholsl_0(double **A, int n, double **B, int nb);
82 
92 int mbs_invLU_0(double **A, double **Am1, int n);
93 
107 int mbs_svdDcmp_0(double **A, int x, int y, double **U, double **S, double **VT);
108 
109 
136 int mbs_over_under_determined(double **A, double *b, int x, int y);
137 
138 #endif
w_methods
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
GAM
#define GAM
Definition: rosenbrock.c:47
MBS_INFO_FAILURE
#define MBS_INFO_FAILURE
Definition: mbs_define.h:31
mbs_msg
void mbs_msg(const char *msg,...)
Send a message.
Definition: mbs_message.c:87
SAFETY
#define SAFETY
Definition: rosenbrock.c:38
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:35
MbsData::qd
double * qd
Array with the current values of the generalized velocities.
Definition: mbs_data.h:285
E4
#define E4
Definition: rosenbrock.c:64
mbs_cholsl_0
int mbs_cholsl_0(double **A, int n, double **B, int nb)
Solves a symmetric positive definite system of linear equations AX=B (B being the right hand side wit...
Definition: cholesky.c:40
useful_functions.h
C3X
#define C3X
Definition: rosenbrock.c:67
mbs_w_methods.h
This header defines global functions for W methods integrator in C.
lubksb_0
void lubksb_0(double **a, int n, int *indx, double b[])
Definition: lubksb.c:31
B1
#define B1
Definition: rosenbrock.c:57
MbsData::tsim
double tsim
The time value.
Definition: mbs_data.h:305
MbsDirdyn::y
double * y
Pointer to the state vector, this is a dvec_0 of size nState.
Definition: mbs_dirdyn_struct.h:175
GROW
#define GROW
Definition: rosenbrock.c:39
W_S
#define W_S
Definition: mbs_w_methods.h:21
MbsDirdyn::nState
int nState
size of the state vector
Definition: mbs_dirdyn_struct.h:174
C32
#define C32
Definition: rosenbrock.c:53
mbs_dirdyn_struct.h
ERRCON
#define ERRCON
Definition: rosenbrock.c:43
MbsData::nqu
int nqu
Number of independent articulations.
Definition: mbs_data.h:262
mbs_error_msg
void mbs_error_msg(int err, const char *msg,...)
Send an error message.
Definition: mbs_message.c:131
C43
#define C43
Definition: rosenbrock.c:56
mbs_define.h
A32
#define A32
Definition: rosenbrock.c:50
E1
#define E1
Definition: rosenbrock.c:61
E2
#define E2
Definition: rosenbrock.c:62
A21
#define A21
Definition: rosenbrock.c:48
PSHRNK
#define PSHRNK
Definition: rosenbrock.c:42
mbs_rosenbrock.h
This header defines global functions for rosenbrock integrator in C.
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
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:129
MBSfun.h
mbs_close_kin
void mbs_close_kin(MbsData *s, MbsAux *mbs_aux)
compute the dependent velocities that solves the constraints.
Definition: mbs_close_loops.c:146
MbsDirdyn::integrator_struct
void * integrator_struct
pointer to store integrator structure
Definition: mbs_dirdyn_struct.h:205
A3X
#define A3X
Definition: rosenbrock.c:70
C31
#define C31
Definition: rosenbrock.c:52
C1X
#define C1X
Definition: rosenbrock.c:65
mbs_svdDcmp_0
int mbs_svdDcmp_0(double **A, int x, int y, double **U, double **S, double **VT)
Realize the singular value decomposition.
Definition: svdcmp_lapack.c:78
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
MbsDirdyn::tsim
double tsim
current simulation time
Definition: mbs_dirdyn_struct.h:171
MbsDirdynRK4
Runge-Kutta 4 structure for dirdyn.
Definition: mbs_rk4.h:25
MbsDirdynRosenbrock
Rosenbrock integration structure for dirdyn.
Definition: mbs_rosenbrock.h:23
MbsData::qu
int * qu
Array with the indices of the independent articulations (free)
Definition: mbs_data.h:271
B2
#define B2
Definition: rosenbrock.c:58
C4X
#define C4X
Definition: rosenbrock.c:68
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:140
mbs_eig_0
int mbs_eig_0(double **A, int n, double *eval_a, double *eval_b, double **evec_a, double **evec_b)
Compute the eigen values and vector of a matrix with index starting a 0.
Definition: eig_lapack.c:32
B3
#define B3
Definition: rosenbrock.c:59
MbsData::q
double * q
Array with the current values of the generalized coordinates.
Definition: mbs_data.h:284
rosenbrock
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
E3
#define E3
Definition: rosenbrock.c:63
nrfct.h
rk4
int rk4(double y[], double dydx[], int n, double x, double h, double yout[], int(*derivs)(double, double[], double[], MbsData *, MbsDirdyn *), MbsData *s, MbsDirdyn *dd)
Runge Kutta 4 integrator implementation Given values for the variables y[1..n] and their derivatives ...
Definition: rk4.c:22
mbs_message.h
MbsDirdynWMethods
W Methods structure for dirdyn.
Definition: mbs_w_methods.h:46
_MBS_ERR_MOD_SPEC_14
#define _MBS_ERR_MOD_SPEC_14
Generic error number Module specific errors range from -11 to -19 please read the error message a...
Definition: mbs_errors_names.h:190
mbs_close_geo
int mbs_close_geo(MbsData *s, MbsAux *mbs_aux)
compute a position of the multibody system which solves the constraints
Definition: mbs_close_loops.c:43
dmaxarg2
static double dmaxarg2
Definition: rosenbrock.c:102
_MBS_ERR_MOD_SPEC_18
#define _MBS_ERR_MOD_SPEC_18
Genericerror number Module specific errors range from -11 to -19 please read the error message an...
Definition: mbs_errors_names.h:214
MbsData
Definition: mbs_data.h:246
MbsDirdyn::mbs_aux
MbsAux * mbs_aux
Definition: mbs_dirdyn_struct.h:169
mbs_choldc_0
int mbs_choldc_0(double **A, int n)
Compute the Cholesky decomposition of A, i.e.
Definition: cholesky.c:25
A31
#define A31
Definition: rosenbrock.c:49
dirdynared
int dirdynared(MbsAux *mbs_aux, MbsData *s)
Compute the joint accelerations of the system in the current configuration.
Definition: mbs_dirdynared.c:26
ThetaSC
int ThetaSC(double y[], double dydx[], int n, double x, double h, double yout[], int(*derivs)(double, double[], double[], MbsData *, MbsDirdyn *), MbsData *s, MbsDirdyn *mbs_dd)
Unknown integrator.
Definition: thetaSC.c:25
dmaxarg1
static double dmaxarg1
Definition: rosenbrock.c:102
C2X
#define C2X
Definition: rosenbrock.c:66
integrator.h
This header defines specific integrators functions in C.
dminarg1
static double dminarg1
Definition: rosenbrock.c:103
mbs_over_under_determined
int mbs_over_under_determined(double **A, double *b, int x, int y)
Solve a linear system of equations, A*x=b, using dgelss lapack function.
Definition: svdcmp_lapack.c:18
A2X
#define A2X
Definition: rosenbrock.c:69
SHRNK
#define SHRNK
Definition: rosenbrock.c:41
mbs_schur_0
int mbs_schur_0(double **A, int n, double **T, double **Z, double *WR, double *WI, int reorder)
A : matrix for the Eigenvalue problem in row major n : size of the matrix WR : Result of the Eigenval...
Definition: schur_lapack.c:45
C41
#define C41
Definition: rosenbrock.c:54
copy_dvec_0
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
C42
#define C42
Definition: rosenbrock.c:55
MbsDirdyn
General structure of the direct dynamic module.
Definition: mbs_dirdyn_struct.h:166
mbs_rk4.h
This header defines global functions for Runge Kutta 4 integrator in C.
MbsData::qdd
double * qdd
Array with the current values of the generalized acceleration.
Definition: mbs_data.h:286
C21
#define C21
Definition: rosenbrock.c:51
mbs_rank_0
int mbs_rank_0(double **A, int m, int n)
Compute the rank of matrix_in.
Definition: rank_lapack.c:38
B4
#define B4
Definition: rosenbrock.c:60
MbsDirdyn::options
MbsDirdynOptions * options
structure defining the option of a direct dynamic
Definition: mbs_dirdyn_struct.h:168
dminarg2
static double dminarg2
Definition: rosenbrock.c:103
MbsData::nhu
int nhu
Number of independent constraints.
Definition: mbs_data.h:268
mbs_errors_names.h
PGROW
#define PGROW
Definition: rosenbrock.c:40