Robotran C Documentation
mbs_equil.h
Go to the documentation of this file.
1 
2 #ifndef EQUIL_h
3 #define EQUIL_h
4 
5 
6 #include "mbs_data.h"
7 #include "mbs_equil_struct.h"
8 
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 
20 MbsEquil* mbs_new_equil(MbsData* mbs_data);
21 MbsEquil* mbs_new_equil_aux(MbsData* mbs_data, MbsAux* mbs_aux);
22 
31 void mbs_delete_equil(MbsEquil* eq, MbsData* mbs_data);
32 
49 int mbs_run_equil(MbsEquil* mbs_equil,MbsData* mbs_data);
50 
69 int mbs_equil_init(MbsEquil* mbs_equil,MbsData* mbs_data);
70 
80 int mbs_equil_loop(MbsEquil* mbs_equil,MbsData* mbs_data);
81 
89 int mbs_equil_finish(MbsEquil* mbs_equil,MbsData* mbs_data);
90 
91 
97 void mbs_equil_exchange(MbsEquilOptions *options);
98 
109 void mbs_equil_set_variable(MbsEquilOptions *options, double *address,
110  int id_exchanged, int replaced_variable_id);
111 
119 void mbs_equil_add_variable(MbsEquilOptions *options, double *address, int id_added);
120 
126 void mbs_equil_addition(MbsEquilOptions *options);
127 
133 void mbs_equil_ignorance(MbsEquilOptions *options);
134 
135 
139 int mbs_equil_save(MbsEquil* eq, MbsData *mbs_data, int n);
140 
154 int mbs_equil_fct(double x[], int nx, double fx[], MbsEquil *eq, MbsAux *aux, MbsData *s);
155 
161 void mbs_print_equil(MbsEquil* eq);
162 
163 
164 #ifdef __cplusplus
165 }
166 #endif
167 
168 //-----------------------------------------------------------------
169 //---> COULD BE MOVE TO NUMERICS THOUGH MBS_DATA,AUX ARE STILL THERE...
170 //-----------------------------------------------------------------
171 
186 int mbs_equil_fsolvepk(int (*fun_ptr)(double*, int, double*, MbsEquil*, MbsAux*, MbsData*), MbsEquil *eq, MbsAux *aux, MbsData *s );
187 
197 int mbs_equil_grad_lpk(MbsEquil *eq, MbsData *s);
198 
208 int mbs_equil_grad_dev(MbsEquil *eq, MbsData *s);
209 
210 #endif
pick_and_place_dvec_0
void pick_and_place_dvec_0(double *src, int *index, int n, double *dest)
Pick the values from an array and set them in the destination array at the specified index.
Definition: mbs_1D_array.c:1239
mbs_Rred
int mbs_Rred(MbsAux *mbs_aux, MbsData *s)
compute Rred, the reduced equations of motions on a residual form [nqu x 1] obtained after the 2 cons...
Definition: mbs_Rred.c:20
mbs_equil_init
int mbs_equil_init(MbsEquil *mbs_equil, MbsData *mbs_data)
Initialize the Equilibrium structure variables.
Definition: mbs_equil.c:271
MbsEquil::x
double * x
variables for the equilibrium
Definition: mbs_equil_struct.h:77
mbs_linearipk.h
slct_dvec_0
int slct_dvec_0(double *vec_src, int l_v1, int *vec_ind_src, int l_v2, double *vec_dest)
fill the third (l_v2 sized) vector by slicing the first (l_v1 sized) vector of doubles at the indexes...
Definition: mbs_1D_array.c:1258
MbsEquilOptions::respath
const char * respath
Path in which result file are saved. [default:resultsR folder].
Definition: mbs_equil_struct.h:29
mbs_equil_add_variable
void mbs_equil_add_variable(MbsEquilOptions *options, double *address, int id_added)
set the given pointer to the additionnal variable table.
Definition: mbs_equil.c:814
BUFFER_OTHER
@ BUFFER_OTHER
Definition: mbs_buffer.h:23
MbsEquilOptions::grad_lpk
int grad_lpk
options to compute the gradient through the lpk parabolic fitting method. If not activated,...
Definition: mbs_equil_struct.h:20
print_dvec_0
void print_dvec_0(double *vec, int l_v)
print a (x sized) vector of doubles in console, starting with index 0
Definition: mbs_1D_array.c:1018
get_char_cpy
char * get_char_cpy(const char *fmt,...)
Copy the provided formatted string into a newly allocated memory.
Definition: useful_functions.c:191
MbsData::Ncons
int Ncons
Number of algebraic constraints.
Definition: mbs_data.h:218
mbs_equil_exchange
void mbs_equil_exchange(MbsEquilOptions *options)
Allocate the memory for the changed equilibrium variables through a table of pointers.
Definition: mbs_equil.c:794
MbsEquil::nxe
int nxe
number of added variables for the equilibrium
Definition: mbs_equil_struct.h:85
MbsData::qd
double * qd
Array with the current values of the generalized velocities.
Definition: mbs_data.h:188
MbsEquilOptions::clearmbsglobal
int clearmbsglobal
Q? inout = 1, out = 2, none = 3, all = 4, default = 1 ???
Definition: mbs_equil_struct.h:44
MbsEquil::xe
int * xe
index of the added variables in the vector of equilibrium variables
Definition: mbs_equil_struct.h:86
MbsData::DonePart
int DonePart
Flag that indicates if the coordinate partitioning module has been executed (default: 0=not done; 1=d...
Definition: mbs_data.h:293
useful_functions.h
MbsEquilOptions::lpk_absincr_max
double lpk_absincr_max
options for the lpk gradient [default = 0]
Definition: mbs_equil_struct.h:24
norm_dvec_0
double norm_dvec_0(double *vec, int l_v)
compute the norm of a [l_v sized] vector of doubles, starting with index 0
Definition: mbs_1D_array.c:1293
lubksb_0
void lubksb_0(double **a, int n, int *indx, double b[])
Definition: lubksb.c:31
mbs_dirdyn.h
_MBS_ERR_MID_DIRDYNARED
#define _MBS_ERR_MID_DIRDYNARED
Mid Level error number Related to the reduced direct dynamics (dirdynared) computation.
Definition: mbs_errors_names.h:97
mbs_equil_grad_lpk
int mbs_equil_grad_lpk(MbsEquil *eq, MbsData *s)
Compute the gradient of f(x) for a given configuration based on the lpk parabolic fitting method.
Definition: mbs_equil.c:1405
MbsData::tsim
double tsim
The time value.
Definition: mbs_data.h:208
MbsData::nqrot
int nqrot
Number of rotational joint (R1, R2 or R3)
Definition: mbs_data.h:172
MbsEquilOptions::compute_uxd
int compute_uxd
no = 0, yes = 1, flag to compute the extra constitutive differential equations as equil equations [de...
Definition: mbs_equil_struct.h:18
mbs_error_msg
void mbs_error_msg(char *msg,...)
Send an error message.
Definition: mbs_message.c:102
MbsEquilOptions::visualize
int visualize
Q? no = 0, yes = 1, default = 0.
Definition: mbs_equil_struct.h:43
BUFFER_X
@ BUFFER_X
Definition: mbs_buffer.h:23
MbsData::nqv
int nqv
Number of dependent articulations.
Definition: mbs_data.h:170
MbsData::DoneEquil
int DoneEquil
Flag that indicates if the equilibrium module has been executed (default: 0=not done; 1=done).
Definition: mbs_data.h:294
MbsEquilOptions::buffer_format
char * buffer_format
if NULL, "%e" is used
Definition: mbs_equil_struct.h:31
MbsLpk::relincr
double relincr
options for the lpk linearization [default = 1e-2]
Definition: mbs_linearipk_struct.h:50
mbs_data.h
MbsData::qc
int * qc
Array with the indices of driven (locked and driven) articulations.
Definition: mbs_data.h:175
MbsData::ux0
double * ux0
Array with the initial values of the user variables.
Definition: mbs_data.h:287
MbsEquilOptions::lpk_relincr
double lpk_relincr
options for the lpk gradient [default = 1e-2]
Definition: mbs_equil_struct.h:22
MbsEquil::buffers
MbsBuffer ** buffers
buffer to store generalized coordinates, velocities, acceleration, joint forces...
Definition: mbs_equil_struct.h:107
mbs_dirdyn_struct.h
mbs_new_equil_aux
MbsEquil * mbs_new_equil_aux(MbsData *mbs_data, MbsAux *mbs_aux)
Definition: mbs_equil.c:44
MbsData::nqu
int nqu
Number of independent articulations.
Definition: mbs_data.h:165
MbsEquilOptions::lpk_absincr
double lpk_absincr
options for the lpk gradient [default = 1e-3]
Definition: mbs_equil_struct.h:23
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
MbsEquil::qd_saved
double * qd_saved
initial generalized velocities as defined in the mbsysPad
Definition: mbs_equil_struct.h:73
_MBS_ERR_LOW_FILES
#define _MBS_ERR_LOW_FILES
Low Level error number Error during opening/writing files = -9.
Definition: mbs_errors_names.h:147
lubksb
void lubksb(double **a, int n, int *indx, double b[])
Definition: lubksb.c:10
mbs_equil_init
int mbs_equil_init(MbsEquil *eq, MbsData *s)
Initialize the Equilibrium structure variables.
Definition: mbs_equil.c:271
MbsEquilOptions::verbose
int verbose
no = 0, yes = 1, extra outputs = 2 [default = 1]
Definition: mbs_equil_struct.h:16
MbsData::njoint
int njoint
Number of joints in the system.
Definition: mbs_data.h:162
MbsEquilOptions::quch
int * quch
index of changed independant variables
Definition: mbs_equil_struct.h:50
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
mbs_buffer_write
int mbs_buffer_write(MbsBuffer *b)
Write the content of the buffer to disk.
Definition: mbs_buffer.c:347
mbs_equil_fsolvepk
int mbs_equil_fsolvepk(int(*fun_ptr)(double *, int, double *, MbsEquil *, MbsAux *, MbsData *), MbsEquil *eq, MbsAux *aux, MbsData *s)
Solve equation f(x)=0 based on given initial values.
Definition: mbs_equil.c:887
MbsEquilOptions::method
int method
fsolvepk = 1, other method to be added. [default = 1]
Definition: mbs_equil_struct.h:14
MbsEquil::x_ptr
double ** x_ptr
vector of pointers pointing to the equilibrium variables
Definition: mbs_equil_struct.h:78
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_new_lpk
MbsLpk * mbs_new_lpk(MbsData *s, int nx, int nF)
create a new lpk structure that is used to compute the linearized matrices Gr and Kr.
Definition: mbs_linearipk.c:344
MbsEquilOptions::resfilename
char * resfilename
The keyword used for determining the name of result files [default:equil].
Definition: mbs_equil_struct.h:28
free_set_output
void free_set_output()
release memory of auto_output
Definition: set_output.c:56
MbsEquil::F
double * F
Definition: mbs_equil_struct.h:102
mbs_buffer_save
int mbs_buffer_save(MbsBuffer *b, double t, double *x)
Save the given array to the specified buffer with the specified time.
Definition: mbs_buffer.c:212
MbsEquil::xns
int * xns
index of non sensitive variables in the vector of equilibrium variables
Definition: mbs_equil_struct.h:91
MbsEquil::nxns
int nxns
number of non sensitive variables for the equilibrium
Definition: mbs_equil_struct.h:90
mbs_equil_add_variable
void mbs_equil_add_variable(MbsEquilOptions *options, double *address, int id_added)
set the given pointer to the additionnal variable table.
Definition: mbs_equil.c:814
MbsEquilOptions::devjac
double devjac
deviate state for Gradient calculation [default = 1e-6]
Definition: mbs_equil_struct.h:40
MbsEquilOptions::equitol
double equitol
equilibrium acceptation tolerance [default = 1e-6]
Definition: mbs_equil_struct.h:15
zeros_dmat_0
void zeros_dmat_0(double **mat, int nb_r, int nb_c)
set all the element of a [nb_r times nb_c] matrix of doubles to zero, starting with index 0
Definition: mbs_matrix.c:754
mbs_equil_grad_dev
int mbs_equil_grad_dev(MbsEquil *eq, MbsData *s)
Compute the gradient of f(x) for a given configuration based on a deviation computation.
Definition: mbs_equil.c:1489
MbsData::Nux
int Nux
Number of user variable.
Definition: mbs_data.h:288
mbs_print_equil
void mbs_print_equil(MbsEquil *eq)
Print the equilibrium structure and its options.
Definition: mbs_equil.c:1598
MbsData::flag_jac_position
int flag_jac_position
Flag to compute the Jacobian of the constraint for position or velocity solution.
Definition: mbs_data.h:299
mbs_equil_loop
int mbs_equil_loop(MbsEquil *mbs_equil, MbsData *mbs_data)
Process the equibrium : find the equilibrium variables, x that satisfy f(x)= [Fruc ; fxe] = 0 Based o...
Definition: mbs_equil.c:655
mbs_growing_buffer_write
int mbs_growing_buffer_write(MbsGrowingBuffer *b)
write the content of the growing buffer to disk
Definition: mbs_buffer.c:557
mbs_equil_set_variable
void mbs_equil_set_variable(MbsEquilOptions *options, double *address, int id_exchanged, int replaced_variable_id)
set the given pointer to the exchange variable table.
Definition: mbs_equil.c:808
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
BUFFER_Q
@ BUFFER_Q
Definition: mbs_buffer.h:21
mbs_equil_exchange
void mbs_equil_exchange(MbsEquilOptions *options)
Allocate the memory for the changed equilibrium variables through a table of pointers.
Definition: mbs_equil.c:794
user_Derivative
void user_Derivative(MbsData *mbs_data)
Definition: user_Derivative.c:15
mbs_equil_fct
int mbs_equil_fct(double x[], int nx, double fx[], MbsEquil *eq, MbsAux *aux, MbsData *s)
Update the equilibrium variables (qu, xsub and xe) through the pointers eq->x_ptr Compute the equilib...
Definition: mbs_equil.c:844
MbsEquilOptions::framerate
int framerate
number of frame per second for the .anim file
Definition: mbs_equil_struct.h:61
_MBS_ERR_LOW_NAN
#define _MBS_ERR_LOW_NAN
Low Level error number Number is NaN (not a number) = -7.
Definition: mbs_errors_names.h:142
mbs_linalg.h
MbsData::flag_optim_symb_sin_cos
int flag_optim_symb_sin_cos
allow the "optimisation" of the computation of the sine/cosine in the symbolic files....
Definition: mbs_data.h:198
MbsLpk::x_ptr
double ** x_ptr
vector of pointers pointing to the linearized variables
Definition: mbs_linearipk_struct.h:34
_MBS_ERR_INIT
#define _MBS_ERR_INIT
Generic error number Check user options at initialization = -10.
Definition: mbs_errors_names.h:156
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:140
mbs_equil_finish
int mbs_equil_finish(MbsEquil *eq, MbsData *s)
Set equilibrum flag to done in MbsData structure Put the MBSysPAD initial velocities and acceleration...
Definition: mbs_equil.c:682
mbs_check_nhu_nqv
int mbs_check_nhu_nqv(MbsData *mbs_data)
Check the coherence between the number of (independant) constraints and the number of dependant varia...
Definition: mbs_check.c:19
MbsData::hu
int * hu
Array with the indices of independent constraints.
Definition: mbs_data.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
mbs_dirdyna
void mbs_dirdyna(double **M, double *c, MbsData *s, double tsim)
Definition: mbs_project_fct_ptr.c:40
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
MbsEquil::options
MbsEquilOptions * options
structure defining the option of a equilibrium
Definition: mbs_equil_struct.h:70
mbs_equil_save
int mbs_equil_save(MbsEquil *eq, MbsData *s, int iter)
Q?? is that necessary.
Definition: mbs_equil.c:254
mbs_linearipk
int mbs_linearipk(double **GK, MbsLpk *lpk, MbsAux *aux, MbsData *s, int EqChoice)
compute the linearized damping matrix Gr or stiffness matrix Kr for a given configuration (q,...
Definition: mbs_linearipk.c:20
MbsEquil::nxs
int nxs
number of sensitive variables for the equilibrium
Definition: mbs_equil_struct.h:88
MbsEquilOptions::animpath
const char * animpath
Path in which animation file are saved. [default:animationR folder].
Definition: mbs_equil_struct.h:30
MbsEquil
Definition: mbs_equil_struct.h:68
MbsEquilOptions::itermax
int itermax
maximum number of iteration for solvepk [default = 30]
Definition: mbs_equil_struct.h:41
mbs_run_equil
int mbs_run_equil(MbsEquil *mbs_equil, MbsData *mbs_data)
Run the Equilibrium process.
Definition: mbs_equil.c:214
MbsEquil::grad
double ** grad
Linear Tangent matrix: delta Fx / delta x (obtained numerically)
Definition: mbs_equil_struct.h:96
MbsLpk::absincr
double absincr
Minimum increment value of variables [default = 1e-3].
Definition: mbs_linearipk_struct.h:51
MbsEquil::qdd_saved
double * qdd_saved
initial generalized accelerations as defined in the mbsysPad
Definition: mbs_equil_struct.h:74
MbsData::flag_safety_checks
int flag_safety_checks
Flag to activate safety checks everywhere in mbsysc core. Faster computation if this flag is put to 0...
Definition: mbs_data.h:307
mbs_msg
void mbs_msg(char *msg,...)
Send a message.
Definition: mbs_message.c:76
user_equil_finish
void user_equil_finish(MbsData *mbs_data, MbsEquil *mbs_equil)
user own finishing functions
Definition: user_equil.c:53
MbsBuffer
Definition: mbs_buffer.h:46
MbsEquil::Nux_saved
int Nux_saved
copy of mbs_data Nux
Definition: mbs_equil_struct.h:80
mbs_growing_buffer_save
int mbs_growing_buffer_save(MbsGrowingBuffer *b, double t)
Save the given values of auto_output to the specified buffer with the specified time.
Definition: mbs_buffer.c:253
mbs_delete_buffer
void mbs_delete_buffer(MbsBuffer *b)
Free memory of the specified MbsBuffer.
Definition: mbs_buffer.c:164
user_equil_loop
void user_equil_loop(MbsData *mbs_data, MbsEquil *mbs_equil)
user own loop functions
Definition: user_equil.c:40
MbsEquil::iter
int iter
current iteration in the equilibrium computation
Definition: mbs_equil_struct.h:104
mbs_delete_growing_buffer
void mbs_delete_growing_buffer(MbsGrowingBuffer *b)
release memory for growing buffer
Definition: mbs_buffer.c:188
MbsData::qu
int * qu
Array with the indices of the independent articulations (free)
Definition: mbs_data.h:174
mbs_equil_loop
int mbs_equil_loop(MbsEquil *eq, MbsData *s)
Process the equibrium : find the equilibrium variables, x that satisfy f(x)= [Fruc ; fxe] = 0 Based o...
Definition: mbs_equil.c:655
MbsEquil::lpk
MbsLpk * lpk
working structure to compute the linearized matrices (one by one)
Definition: mbs_equil_struct.h:100
mbs_equil_addition
void mbs_equil_addition(MbsEquilOptions *options)
Allocate the memory for the addition equilibrium variables through a table of pointers.
Definition: mbs_equil.c:819
MbsData::qv
int * qv
Array with the indices of the dependent articulations .
Definition: mbs_data.h:182
MbsData::Qc
double * Qc
Array with the value of joint force introduced in driven joint to respect the user function.
Definition: mbs_data.h:233
MbsEquilOptions::nxe
int nxe
number of extra equilibrium variables
Definition: mbs_equil_struct.h:53
mbs_new_equil
MbsEquil * mbs_new_equil(MbsData *mbs_data)
Allocate the memory for the Equilibrium Options (but not for all the Equilibrium structure) Initializ...
Definition: mbs_equil.c:34
MbsEquilOptions::fxe_ptr
void(* fxe_ptr)(MbsData *, double *)
pointer pointing on the .c function calculating the added equilibrum functions
Definition: mbs_equil_struct.h:64
MbsEquilOptions::relaxcoeff
double relaxcoeff
relaxation coefficient [default = 0.9]
Definition: mbs_equil_struct.h:36
freeMbsAux
void freeMbsAux(MbsAux *mbs_aux, MbsData *s)
Definition: mbs_aux.c:174
mbs_equil.h
mbs_delete_equil
void mbs_delete_equil(MbsEquil *eq, MbsData *s)
Free the Equilibrium structure (pointers table, Equibrium options, ...)
Definition: mbs_equil.c:146
mbs_equil_ignorance
void mbs_equil_ignorance(MbsEquilOptions *options)
Allocate the memory for the int table containing the index of the qu variables to ignore !
Definition: mbs_equil.c:830
MbsLpk::itermax
int itermax
options for the lpk linearization [default = 10]
Definition: mbs_linearipk_struct.h:49
mbs_equil_struct.h
mbs_print_equil
void mbs_print_equil(MbsEquil *eq)
Print the equilibrium structure and its options.
Definition: mbs_equil.c:1598
mbs_delete_equil
void mbs_delete_equil(MbsEquil *eq, MbsData *mbs_data)
Free the Equilibrium structure (pointers table, Equibrium options, ...)
Definition: mbs_equil.c:146
MbsData::Qq
double * Qq
Array with the values of the joint forces.
Definition: mbs_data.h:204
_MBS_ERR_MOD_EQUIL
#define _MBS_ERR_MOD_EQUIL
Module error number module: Equilibrium = 2-00.
Definition: mbs_errors_names.h:48
mbs_equil_set_variable
void mbs_equil_set_variable(MbsEquilOptions *options, double *address, int id_exchanged, int replaced_variable_id)
set the given pointer to the exchange variable table.
Definition: mbs_equil.c:808
MbsEquil::grad_Rr
double ** grad_Rr
mbs Linear Tangent matrix: delta Rr / delta x (obtained numerically)
Definition: mbs_equil_struct.h:97
MbsEquilOptions::soft
int soft
softing in pk algorithm no = 0, yes = 1 [default = 0]
Definition: mbs_equil_struct.h:38
MbsData::q
double * q
Array with the current values of the generalized coordinates.
Definition: mbs_data.h:187
mbs_equil_fct
int mbs_equil_fct(double x[], int nx, double fx[], MbsEquil *eq, MbsAux *aux, MbsData *s)
Update the equilibrium variables (qu, xsub and xe) through the pointers eq->x_ptr Compute the equilib...
Definition: mbs_equil.c:844
MbsData::project_path
char * project_path
Path to the mbs project folder.
Definition: mbs_data.h:312
MbsEquilOptions::save_anim
int save_anim
1 to save the anim file, 0 otherwise (only valid if 'save2file' is set to 1)
Definition: mbs_equil_struct.h:60
_MBS_ERR_MOD_SPEC_12
#define _MBS_ERR_MOD_SPEC_12
Generic error number Module specific errors range from -11 to -19 please read the error message a...
Definition: mbs_errors_names.h:168
mbs_init_sin_cos_q_vecs
int mbs_init_sin_cos_q_vecs(MbsData *s, int *qrot_qu_indvec, int *qrot_qc_indvec, int *qrot_qv_indvec)
Initialize the three vectors of indices (they are usually contained in the mbs_aux structure)
Definition: mbs_trigo.c:23
mbs_check_mbs_data_values
int mbs_check_mbs_data_values(MbsAux *module_mbs_aux, MbsData *mbs_data)
Check the coherence between the mbs_data used before module initialization and module run.
Definition: mbs_check.c:87
mbs_trigo.h
This header defines the functions for trigonometric handling in MBsysC integrator in C.
nrfct.h
mbs_comp_LUdcmp_mJv
int mbs_comp_LUdcmp_mJv(MbsData *s, MbsAux *mbs_aux)
compute and update (!) the mJv matrix, decomposing it to the LU format mbs_aux->mJv[i][j] = -mbs_aux-...
Definition: mbs_close_loops.c:25
mbs_new_growing_buffer
MbsGrowingBuffer * mbs_new_growing_buffer(int max_nx, int size, const char *respath)
create a new growing buffer for the user inputs to save
Definition: mbs_buffer.c:120
mbs_new_equil
MbsEquil * mbs_new_equil(MbsData *s)
Allocate the memory for the Equilibrium Options (but not for all the Equilibrium structure) Initializ...
Definition: mbs_equil.c:34
mbs_calc_force
int mbs_calc_force(MbsData *s)
compute the force and torques applied on the multibody system.
Definition: mbs_calc_force.c:13
MbsData::nqc
int nqc
Number of driven articulations, it includes qlocked and qdriven.
Definition: mbs_data.h:166
set_output.h
set_output function called by the user to output his own variables
mbs_message.h
_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:180
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
MbsEquilOptions::relax
int relax
relaxation in pk algorithm no = 0, yes = 1 [default = 0]
Definition: mbs_equil_struct.h:35
mbs_calc_jdqd
void mbs_calc_jdqd(MbsData *s, MbsAux *mbs_aux)
compute the quadratic term of the constraints at acceleration level:
Definition: mbs_close_loops.c:216
initMbsAux
MbsAux * initMbsAux(MbsData *s)
Definition: mbs_aux.c:18
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
MbsEquil::xch
int * xch
index of the exchange variables in the vector of equilibrium variables
Definition: mbs_equil_struct.h:83
MbsEquil::bufferNb
int bufferNb
Definition: mbs_equil_struct.h:106
mbs_equil_addition
void mbs_equil_addition(MbsEquilOptions *options)
Allocate the memory for the addition equilibrium variables through a table of pointers.
Definition: mbs_equil.c:819
MbsEquilOptions::saveperiod
int saveperiod
The number of iteration between two buffer records [default = 1] (every iteration are recorded)
Definition: mbs_equil_struct.h:59
mbs_equil_grad_lpk
int mbs_equil_grad_lpk(MbsEquil *eq, MbsData *s)
Compute the gradient of f(x) for a given configuration based on the lpk parabolic fitting method.
Definition: mbs_equil.c:1405
MbsData
Definition: mbs_data.h:149
mbs_calc_hJ
void mbs_calc_hJ(MbsData *s, MbsAux *mbs_aux)
compute the current value of the constraints ( ) and the constraint Jacobian matrix ( ).
Definition: mbs_close_loops.c:188
MbsEquil::success
int success
1 if the equilibrium process were successful (0 if none -1 if failed)
Definition: mbs_equil_struct.h:111
mbs_new_equil_aux
MbsEquil * mbs_new_equil_aux(MbsData *s, MbsAux *mbs_aux)
Definition: mbs_equil.c:44
MbsEquilOptions::xe_index
int * xe_index
vector containing the index of the added variables inside the equilibrium variables vector
Definition: mbs_equil_struct.h:56
_MBS_ERR_MOD_SPEC_11
#define _MBS_ERR_MOD_SPEC_11
Mid Level error number Module specific errors range from -11 to -19 please read the error message...
Definition: mbs_errors_names.h:162
MbsEquilOptions
Definition: mbs_equil_struct.h:12
MbsEquilOptions::lpk_equitol
double lpk_equitol
options for the lpk gradient [default = 1e-6]
Definition: mbs_equil_struct.h:25
mbs_compute_sin_cos_quc
void mbs_compute_sin_cos_quc(MbsData *s, int *qrot_qu_indvec, int *qrot_qc_indvec)
Compute the sine and cosine of the q_sin and q_cos, only for the rotational joints that are independe...
Definition: mbs_trigo.c:65
MbsEquil::grad_uxd
double ** grad_uxd
uxd Linear Tangent matrix: delta uxd / delta x (obtained numerically)
Definition: mbs_equil_struct.h:98
get_output_vector_size
int get_output_vector_size(int index)
get the output vector size corresponding to the requested index
Definition: set_output.c:222
dirdynared
int dirdynared(MbsAux *mbs_aux, MbsData *s)
Definition: mbs_dirdynared.c:25
MbsEquilOptions::senstol
double senstol
tolerance for testing a variable non-sensitivity [default = 1e-6]
Definition: mbs_equil_struct.h:39
MbsEquilOptions::buffersize
int buffersize
The number of time step that can be recorded in the buffer [default = -1].
Definition: mbs_equil_struct.h:62
mbs_run_equil
int mbs_run_equil(MbsEquil *eq, MbsData *s)
Run the Equilibrium process.
Definition: mbs_equil.c:214
get_output_vector_nb
int get_output_vector_nb()
get the number of user vector inputs
Definition: set_output.c:240
user_equil_init
void user_equil_init(MbsData *mbs_data, MbsEquil *mbs_equil)
user own initialization functions
Definition: user_equil.c:27
MbsEquil::user_buffer
MbsGrowingBuffer * user_buffer
growing buffer to store user values
Definition: mbs_equil_struct.h:108
init_set_output
void init_set_output(int max_nb_curves)
initialize the static auto_output structure
Definition: set_output.c:23
mbs_equil_fsolvepk
int mbs_equil_fsolvepk(int(*fun_ptr)(double *, int, double *, MbsEquil *, MbsAux *, MbsData *), MbsEquil *eq, MbsAux *aux, MbsData *s)
Solve equation f(x)=0 based on given initial values.
Definition: mbs_equil.c:887
mbs_delete_lpk
void mbs_delete_lpk(MbsLpk *lpk)
free memory of the lpk structure.
Definition: mbs_linearipk.c:393
MbsEquilOptions::lpk_lintol
double lpk_lintol
options for the lpk gradient [default = 1e-3]
Definition: mbs_equil_struct.h:26
mbs_equil_finish
int mbs_equil_finish(MbsEquil *mbs_equil, MbsData *mbs_data)
Set equilibrum flag to done in MbsData structure Put the MBSysPAD initial velocities and acceleration...
Definition: mbs_equil.c:682
MbsLpk::equitol
double equitol
options for the lpk linearization [default = 1e-6]
Definition: mbs_linearipk_struct.h:53
BUFFER_R
@ BUFFER_R
Definition: mbs_buffer.h:23
MbsData::flag_stop
int flag_stop
stop the simulation. For dirdyn, equil, invdyn and solvekin only.
Definition: mbs_data.h:298
MbsEquil::nx
int nx
number of variables for the equilibrium
Definition: mbs_equil_struct.h:76
cholsl
void cholsl(double **a, int n, double p[], double b[], double x[])
Definition: cholsl.c:10
MbsEquil::aux
MbsAux * aux
Definition: mbs_equil_struct.h:71
choldc
int choldc(double **a, int n, double p[])
Compute the Cholesky decomposition of a, i.e.
Definition: choldc.c:25
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:906
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
MbsEquil::xs
int * xs
index of sensitive variables in the vector of equilibrium variables
Definition: mbs_equil_struct.h:89
MbsEquil::grad_fxe
double ** grad_fxe
fxe Linear Tangent matrix: delta fxe / delta x (obtained numerically)
Definition: mbs_equil_struct.h:99
BUFFER_F
@ BUFFER_F
Definition: mbs_buffer.h:23
pick_and_place_dvec_1
void pick_and_place_dvec_1(double *src, int *index, int n, double *dest)
Pick the values from an array and set them in the destination array at the specified index.
Definition: mbs_1D_array.c:1230
MbsData::lambda
double * lambda
Array with the values of the Lagrange Multipliers related to the constraints.
Definition: mbs_data.h:222
MbsEquil::savePeriodCounter
int savePeriodCounter
counter for checking whether results must be saved
Definition: mbs_equil_struct.h:105
MbsEquilOptions::xe_ptr
double ** xe_ptr
vector of pointers pointing to the extra variables
Definition: mbs_equil_struct.h:54
find_ivec_1
int find_ivec_1(int *vec, int l_v, int f)
return the index of the value f in the (x sized) vector vec of integers, starting with index 1....
Definition: mbs_1D_array.c:832
MbsData::uxd
double * uxd
Array with the values of the time derivatives of the user variables.
Definition: mbs_data.h:286
reset_flag_output
void reset_flag_output()
reset the flag_output to 0. Useful when running several simulation in a row with different save2file ...
Definition: set_output.c:15
mbs_equil_grad_dev
int mbs_equil_grad_dev(MbsEquil *eq, MbsData *s)
Compute the gradient of f(x) for a given configuration based on a deviation computation.
Definition: mbs_equil.c:1489
MbsEquilOptions::max_save_user
int max_save_user
The maximal number of user variables saved [default = 12].
Definition: mbs_equil_struct.h:63
MbsLpk::lintol
double lintol
options for the lpk linearization [default = 1e-3]
Definition: mbs_linearipk_struct.h:54
user_equil_fxe
void user_equil_fxe(MbsData *mbs_data, double *f)
user own implementation of added equilibrium equations Fxe Necessary to express equilibrium f(x)=0
Definition: user_equil.c:65
MAX
#define MAX(a, b)
Definition: useful_functions.h:14
MbsData::qdd
double * qdd
Array with the current values of the generalized acceleration.
Definition: mbs_data.h:189
get_output_vector_label
char * get_output_vector_label(int index)
get the output vector label corresponding to the requested index
Definition: set_output.c:211
mbs_check.h
mbs_equil_ignorance
void mbs_equil_ignorance(MbsEquilOptions *options)
Allocate the memory for the int table containing the index of the qu variables to ignore !
Definition: mbs_equil.c:830
mbs_rank_0
int mbs_rank_0(double **A, int m, int n)
Compute the rank of matrix_in.
Definition: rank_lapack.c:38
mbs_new_buffer
MbsBuffer * mbs_new_buffer(char *filename, char *anim_name, int nx, int size, int id, char *buf_format, int save_anim, int save_visu, double anim_period)
Allocate and initialize a MbsBuffer structure.
Definition: mbs_buffer.c:27
MbsEquil::norm_pk
double norm_pk
norm of the equlibrium variables vector x (parameter to minimize in the solvepk algorithm)
Definition: mbs_equil_struct.h:94
mbs_equil_save
int mbs_equil_save(MbsEquil *eq, MbsData *mbs_data, int n)
Q?? is that necessary.
Definition: mbs_equil.c:254
print_ivec_0
void print_ivec_0(int *vec, int l_v)
print a (l_v sized) vector of integers in console, starting with index 0
Definition: mbs_1D_array.c:494
MbsEquilOptions::save2file
int save2file
1: results saved 0: not saved [default = 1]
Definition: mbs_equil_struct.h:17
MbsLpk::nF
int nF
nF=nqu or nF=nqu+nux (working variable)
Definition: mbs_linearipk_struct.h:32
MbsData::udd
double * udd
For axelle red: array with the values of the acceleration of independent coordinate.
Definition: mbs_data.h:291
MbsEquil::nxch
int nxch
number of exchange variables for the equilibrium
Definition: mbs_equil_struct.h:82
MbsData::ux
double * ux
Array with the values of the user variables.
Definition: mbs_data.h:285
MbsEquilOptions::nquch
int nquch
number of changed independant variables
Definition: mbs_equil_struct.h:49
MbsEquil::savedArrays
double ** savedArrays
pointer to the array that must be saved to buffers
Definition: mbs_equil_struct.h:109
mbs_warning_msg
void mbs_warning_msg(char *msg,...)
Send a warning message.
Definition: mbs_message.c:89
MbsEquil::R
double R
Definition: mbs_equil_struct.h:103
MbsEquilOptions::relaxIterMax
double relaxIterMax
maximum number of relaxation iterations [default = 10]
Definition: mbs_equil_struct.h:37
MbsData::nhu
int nhu
Number of independent constraints.
Definition: mbs_data.h:171
MbsEquilOptions::mode
int mode
1=static / 2=quasistatic / 3=dynamic [default = 1]
Definition: mbs_equil_struct.h:34
MbsLpk::nx
int nx
nx=nqu or nux (working variable)
Definition: mbs_linearipk_struct.h:31
MbsEquilOptions::xch_ptr
double ** xch_ptr
vector of pointers pointing to the exchange variables (the ones that replaces the changed qu)
Definition: mbs_equil_struct.h:51
get_output_vector_ptr
double * get_output_vector_ptr(int index)
get the pointer to the output vector at the requested index
Definition: set_output.c:259
MbsEquilOptions::lpk_itermax
int lpk_itermax
options for the lpk gradient [default = 10]
Definition: mbs_equil_struct.h:21
user_DrivenJoints
void user_DrivenJoints(MbsData *mbs_data, double tsim)
Compute the positions, velocities and acceleration of driven joint.
Definition: user_DrivenJoints.c:15
mbs_errors_names.h