Robotran C Documentation
mbs_lqr.h
Go to the documentation of this file.
1 //---------------------------
2 // UCL-CEREM-MBS
3 //
4 // @version MBsysLab_s 1.7.a
5 //
6 // Creation : 2006
7 // Last update : 01/10/2008
8 //---------------------------
9 
10 #ifndef mbs_lqr_h
11 #define mbs_lqr_h
12 /*--------------------*/
13 
14 #include "mbs_lqr_struct.h"
15 #include "mbs_data.h"
16 
24 MbsLqr* mbs_new_lqr(int nx, int nu, int ny);
30 void mbs_delete_lqr(MbsLqr *lqr);
31 
38 int lqr_compute_gain(MbsSS *ss, MbsLqr *lqr);
39 
47 
48 
49 
50 
51 /*--------------------*/
52 #endif
MbsRiccati::BRm1Bt
double ** BRm1Bt
The BRm1Bt matrix of the Riccati equations.
Definition: riccati.h:21
MbsLqr::ric
MbsRiccati * ric
computation structure used to solve the Algebraic Riccation Equation
Definition: mbs_lqr_struct.h:19
useful_functions.h
mbs_delete_lqr
void mbs_delete_lqr(MbsLqr *lqr)
free memory of the lpk structure.
Definition: mbs_lqr.c:57
mbs_new_lqr
MbsLqr * mbs_new_lqr(int nx, int nu, int ny)
create a new lpk structure that is used to compute the linearized matrices Gr and Kr.
Definition: mbs_lqr.c:22
mbs_data.h
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
MbsLqr::R
double ** R
symmetric gain matrix for input
Definition: mbs_lqr_struct.h:16
copy_dmat_0
void copy_dmat_0(double **tab_src, double **tab_dest, int nb_r, int nb_c)
Copy the content of a [nb_r times nb_c] matrix of doubles to a second matrix, starting with index 0.
Definition: mbs_matrix.c:363
MbsLqr
Definition: mbs_lqr_struct.h:10
lqr_compute_gain
int lqr_compute_gain(MbsSS *ss, MbsLqr *lqr)
compute the augmented state space
Definition: mbs_lqr.c:74
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_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
MbsLqr::Q
double ** Q
symmetric gain matrix for regulation (tracking)
Definition: mbs_lqr_struct.h:15
lqr_compute_augmentedState
int lqr_compute_augmentedState(MbsSS *ss, MbsSS *ass)
compute the augmented state space
Definition: mbs_lqr.c:209
MbsLqr::K
double ** K
the gain matrix for the Linear Quadratic Regulator
Definition: mbs_lqr_struct.h:21
mbs_linalg.h
MbsSS::B
double ** B
input matrix [nx nu]
Definition: mbs_statespace_struct.h:20
mbs_lqr_struct.h
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
mbs_lqr.h
mbs_delete_riccati
void mbs_delete_riccati(MbsRiccati *ric)
Definition: riccati.c:143
MbsSS
The State-space representation starts at index 0.
Definition: mbs_statespace_struct.h:10
mbs_choldc_0
int mbs_choldc_0(double **A, int n)
Compute the Cholesky decomposition of A, i.e.
Definition: cholesky.c:25
mbs_msg
void mbs_msg(char *msg,...)
Send a message.
Definition: mbs_message.c:76
MbsSS::A
double ** A
state space matrix [nx nx]
Definition: mbs_statespace_struct.h:19
MbsRiccati::A
double ** A
The A matrix of the Riccati equation : Aric = A - B*Rm1*Nt.
Definition: riccati.h:19
MbsRiccati::X
double ** X
the Riccati solution
Definition: riccati.h:26
riccati.h
lqr_compute_augmentedState
int lqr_compute_augmentedState(MbsSS *ss, MbsSS *ass)
compute the augmented state space
Definition: mbs_lqr.c:209
mbs_delete_lqr
void mbs_delete_lqr(MbsLqr *lqr)
free memory of the lpk structure.
Definition: mbs_lqr.c:57
MbsSS::ny
int ny
number of output (limited to 2*nqu)
Definition: mbs_statespace_struct.h:17
mbs_solve_riccati
int mbs_solve_riccati(MbsRiccati *ric)
Definition: riccati.c:27
mult_dmat_0
void mult_dmat_0(double **A, double **B, double **C, int n1, int n2, int n3)
function to multiply two matrices: A * B = C [n1 n2] [n2 n3] = [n1 n3]
Definition: mbs_matrix.c:767
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
diff_dmat_0
void diff_dmat_0(double **A, double **B, double **C, int n1, int n2)
function to sum two matrices: A - B = C
Definition: mbs_matrix.c:797
mbs_message.h
mbs_new_lqr
MbsLqr * mbs_new_lqr(int nx, int nu, int ny)
create a new lpk structure that is used to compute the linearized matrices Gr and Kr.
Definition: mbs_lqr.c:22
MbsLqr::N
double ** N
gain matrix for cross terms
Definition: mbs_lqr_struct.h:17
MbsSS::C
double ** C
output matrix [ny nx]
Definition: mbs_statespace_struct.h:21
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
lqr_compute_gain
int lqr_compute_gain(MbsSS *ss, MbsLqr *lqr)
compute the augmented state space
Definition: mbs_lqr.c:74
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
MbsRiccati::Q
double ** Q
The Q matrix of the Riccati equation : Qric = Q - N*Rm1*Nt.
Definition: riccati.h:20
mbs_new_riccati
MbsRiccati * mbs_new_riccati(int n)
Definition: riccati.c:118
mbs_statespace.h
MbsSS::nu
int nu
number of input (limited to njoint for the moment as only joint forces are considered as input)
Definition: mbs_statespace_struct.h:16
MbsSS::nx
int nx
number of state, (normally nx=2*nqu)
Definition: mbs_statespace_struct.h:15