|
Robotran C Documentation
|
Go to the documentation of this file.
138 int mbs_modal_norm_evec(
double** mat_r,
double** mat_phi,
int nqu,
int Nux,
int ind,
double *evec_r,
double *evec_phi);
int mbs_modal_finish(MbsModal *mo, MbsData *s)
Set Modal flag to done in MbsData structure and save the modal analysis.
Definition: mbs_modal.c:520
double lpk_absincr_max
See MbsLpk::absincr_max [default = 1e-3].
Definition: mbs_modal_struct.h:36
double ** Lr
Linearized stiff state matrix : d Rr / d ux.
Definition: mbs_statespace_struct.h:28
int Nux_saved
copy of mbs_data Nux
Definition: mbs_modal_struct.h:97
double ** evec_a
Result of the Eigenvalue problem: real part of the eigen vectors (each column is a eigenvector) [nx X...
Definition: mbs_modal_struct.h:104
double * eval_b
Result of the Eigenvalue problem: imaginary part of the nx eigen values [nx].
Definition: mbs_modal_struct.h:102
int mbs_modal_loop(MbsModal *mo, MbsData *s)
Perform the Modal analysis.
Definition: mbs_modal.c:291
void mbs_msg(const char *msg,...)
Send a message.
Definition: mbs_message.c:87
char * respath
Path in which result file are saved.
Definition: mbs_modal_struct.h:51
char * get_char_cpy(const char *fmt,...)
Copy the provided formatted string into a newly allocated memory.
Definition: useful_functions.c:196
Definition: mbs_modal_struct.h:12
double absincr_max
Maximum increment value of variables, set to 0.0 to disable it [default = 0.0].
Definition: mbs_linearipk_struct.h:52
double * qd
Array with the current values of the generalized velocities.
Definition: mbs_data.h:285
int save_dmat_0(double **mat, int nb_r, int nb_c, char *name)
save a [nb_r times nb_c] matrix of doubles to a second matrix, starting with index 0
Definition: mbs_matrix.c:611
int * iModeSorted
Definition: mbs_modal_struct.h:112
double lpk_absincr
See MbsLpk::absincr [default = 1e-3].
Definition: mbs_modal_struct.h:35
char * mbs_filename
Path to mbs file including the file with the extension (.mbs)
Definition: mbs_data.h:409
int nqv
Number of dependent articulations.
Definition: mbs_data.h:267
void mbs_delete_modal(MbsModal *mo, MbsData *s)
Free the MbsModal structure (pointers table, ...)
Definition: mbs_modal.c:714
int DoneEquil
Flag that indicates if the equilibrium module has been executed (default: 0=not done; 1=done).
Definition: mbs_data.h:393
double relincr
options for the lpk linearization [default = 1e-2]
Definition: mbs_linearipk_struct.h:50
double mode_ampl
amplification factor for the animation of the modes, application dependent [default = 0....
Definition: mbs_modal_struct.h:26
int mbs_modal_save_result(MbsModal *mo, MbsData *s, char *filename)
Write the modal analysis results (eigenmode, eigenfrequencies, mode type, ...) into a ASCII text file...
Definition: mbs_modal.c:824
int save_result
no = 0, yes = 1, flag to save the modal results summary [default = 1]
Definition: mbs_modal_struct.h:18
int mbs_compute_statespace(MbsSS *ss, MbsData *mbs_data)
Compute the matrices (A,B,C,D) for a mbs configuration (q,qd,qdd).
Definition: mbs_statespace.c:403
int nqu
Number of independent articulations.
Definition: mbs_data.h:262
double ** Mr
unused for the moment
Definition: mbs_statespace_struct.h:25
void mbs_error_msg(int err, const char *msg,...)
Send an error message.
Definition: mbs_message.c:131
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
#define _MBS_ERR_LOW_FILES
Low Level error number Error during opening/writing files = -9.
Definition: mbs_errors_names.h:157
int lpk_itermax
See MbsLpk::itermax [default = 10].
Definition: mbs_modal_struct.h:33
int njoint
Number of joints in the system.
Definition: mbs_data.h:259
double * q_phi
Phase of the generalized position corresponding to the mode motion (computed from evec_r and evec_phi...
Definition: mbs_modal_struct.h:73
int save_eval
no = 0, yes = 1, flag to save the eigen values in two separate files: "_a" for Real part and "_b" for...
Definition: mbs_modal_struct.h:16
void free_dmat_0(double **mat)
release memory for a matrix of doubles, starting at index 0
Definition: mbs_matrix.c:332
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:350
int mbs_modal_finish(MbsModal *mo, MbsData *s)
Set Modal flag to done in MbsData structure and save the modal analysis.
Definition: mbs_modal.c:520
int compute_uxd
no = 0, yes = 1, flag to compute the modes associated with the extra constitutive differential equati...
Definition: mbs_modal_struct.h:27
Definition: mbs_modal_struct.h:56
int mbs_modal_norm_evec(double **mat_r, double **mat_phi, int nqu, int Nux, int ind, double *evec_r, double *evec_phi)
Additional function necessary for modal analysis post-process.
Definition: mbs_modal.c:772
double nu_0
Undamped frequency [Hz].
Definition: mbs_modal_struct.h:64
MbsLpk * lpk
working structure to compute the linearized matrices (one by one)
Definition: mbs_modal_struct.h:87
void mbs_warning_msg(const char *msg,...)
Send a warning message.
Definition: mbs_message.c:100
int verbose
Verbosity level propagated to other compatible module:
Definition: mbs_modal_struct.h:20
int Nux
Number of user variable.
Definition: mbs_data.h:387
int norm_evec
no = 0, yes = 1, flag to normalize the eigenvectors [default = 1]
Definition: mbs_modal_struct.h:29
#define _MBS_ERR_MOD_SPEC_13
Generic error number Module specific errors range from -11 to -19 please read the error message a...
Definition: mbs_errors_names.h:184
int DoneModal
Flag that indicates if the modal module has been executed (default: 0=not done; 1=done).
Definition: mbs_data.h:394
MbsModalOptions * options
Definition: mbs_modal_struct.h:84
#define _MBS_ERR_INIT
Generic error number Check user options at initialization = -10.
Definition: mbs_errors_names.h:166
MbsModalMode ** modeList
List of model object.
Definition: mbs_modal_struct.h:111
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:20
char * mbs_dirname(const char *path, int verbose)
mbs_dirname returns the leading part of the path (UNIX and MAC).
Definition: mbs_path.c:407
double lpk_lintol
See MbsLpk::lintol [default = 1e-3].
Definition: mbs_modal_struct.h:38
void save_dvec_0(double *vec, int l_v, char *name)
save a (x sized) vector of doubles in the specified file, starting with index 0 The file is open with...
Definition: mbs_1D_array.c:1280
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
int anim_speed
flag to decide whether the independent speeds have to be integrated while generating the animation fi...
Definition: mbs_modal_struct.h:41
int mbs_run_modal(MbsModal *mo, MbsData *s)
Run the Modal Analysis.
Definition: mbs_modal.c:111
int type
1=unoscillating stable; 2=rigid; 3=unoscillating unstable; 4=oscillating damped; 5=oscillating undamp...
Definition: mbs_modal_struct.h:58
MbsModal * mbs_new_modal(MbsData *mbs_data)
Create a new modal structure.
Definition: mbs_modal.c:30
int mbs_modal_save_anim(MbsModal *mbs_modal, MbsData *s, char *filepath)
Save the modes animations in the MbSysPad format.
Definition: mbs_modal.c:946
double absincr
Minimum increment value of variables [default = 1e-3].
Definition: mbs_linearipk_struct.h:51
#define DBL_MAX
Definition: useful_functions.h:26
#define _MBS_ERR_MOD_MODAL
Module error number module: Modal = -300.
Definition: mbs_errors_names.h:53
double ** A
state space matrix [nx nx]
Definition: mbs_statespace_struct.h:19
double * q_r
Norm of the generalized position corresponding to the mode motion (computed from evec_r and evec_phi)
Definition: mbs_modal_struct.h:72
int * qu
Array with the indices of the independent articulations (free)
Definition: mbs_data.h:271
double nu
Frequency of the -damped- mode [Hz].
Definition: mbs_modal_struct.h:65
Definition: mbs_modal_struct.h:82
int save_anim
no = 0, yes = 1, flag to save and generate the animation for the modes [default = 0]
Definition: mbs_modal_struct.h:19
int * qv
Array with the indices of the dependent articulations .
Definition: mbs_data.h:279
void freeMbsAux(MbsAux *mbs_aux, MbsData *s)
Definition: mbs_aux.c:174
int itermax
options for the lpk linearization [default = 10]
Definition: mbs_linearipk_struct.h:49
double * Qq
Array with the values of the joint forces.
Definition: mbs_data.h:301
double * q_b
Img part of the generalized position corresponding to the mode motion (computed from q_phi)
Definition: mbs_modal_struct.h:68
double anim_t
time for the animation generation [default = 2]
Definition: mbs_modal_struct.h:43
double * q_a
Real part of the generalized position corresponding to the mode motion (computed from q_r)
Definition: mbs_modal_struct.h:67
double * q
Array with the current values of the generalized coordinates.
Definition: mbs_data.h:284
int save_mat
no = 0, yes = 1, flag to save the linearized matrix A,Mr,Gr,Kr [default = 0]
Definition: mbs_modal_struct.h:15
int save_evec
no = 0, yes = 1, flag to save the eigen vector in two separate files: "_a" for Real part,...
Definition: mbs_modal_struct.h:17
double ** Lx
Linearized ODE stiff state matrix : d uxd / d ux.
Definition: mbs_statespace_struct.h:34
double * q_saved
copy of vector q before the modal process.
Definition: mbs_modal_struct.h:92
MbsModal * mbs_new_modal_aux(MbsData *s, MbsAux *mbs_aux)
Create a new modal structure.
Definition: mbs_modal.c:40
MbsModal * mbs_new_modal(MbsData *s)
Create a new modal structure.
Definition: mbs_modal.c:30
void mbs_delete_modal(MbsModal *mo, MbsData *s)
Free the MbsModal structure (pointers table, ...)
Definition: mbs_modal.c:714
char * project_path
Path to the mbs project folder.
Definition: mbs_data.h:411
double * qd_saved
copy of vector qd before the modal process.
Definition: mbs_modal_struct.h:93
double * eval_a
Result of the Eigenvalue problem: real part of the nx eigen values [nx].
Definition: mbs_modal_struct.h:101
double lpk_relincr
See MbsLpk::relincr [default = 1e-2].
Definition: mbs_modal_struct.h:34
double ** evec_b
Result of the Eigenvalue problem: img part of the eigen vectors (each column is a eigenvector) [nx X ...
Definition: mbs_modal_struct.h:105
double ** Kx
Linearized ODE stiffness matrix : d uxd / d qu.
Definition: mbs_statespace_struct.h:33
double * evec_phi
Phase of the eigen vector associated to the mode [nx].
Definition: mbs_modal_struct.h:78
double eval_b
Imaginary part of the mode eigenvalue.
Definition: mbs_modal_struct.h:61
#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:178
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
int nx
number of 1st order equations, nx = 2*nqu (+Nux)
Definition: mbs_modal_struct.h:99
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:88
This header defines the functions for trigonometric handling in MBsysC integrator in C.
double ** Kr
Linearized stiffness matrix : d Rr / d qu.
Definition: mbs_statespace_struct.h:27
double zeroEigenPrecision
Define the limit at which the eigen value will be considered as null [default = 1e-6].
Definition: mbs_modal_struct.h:30
double ** Bvuc
copy of the Bvuc matrix (index 1)
Definition: mbs_modal_struct.h:90
int mbs_modal_loop(MbsModal *mo, MbsData *s)
Perform the Modal analysis.
Definition: mbs_modal.c:291
double * ux_b
Img part of the extra ODE states corresponding to the mode motion (computed from ux_phi)
Definition: mbs_modal_struct.h:70
int nqc
Number of driven articulations, it includes qlocked and qdriven.
Definition: mbs_data.h:263
int mbs_modal_save_anim(MbsModal *mo, MbsData *s, char *filepath)
Save the modes animations in the MbSysPad format.
Definition: mbs_modal.c:946
int mbs_modal_norm_evec(double **mat_r, double **mat_phi, int nqu, int Nux, int ind, double *evec_r, double *evec_phi)
Additional function necessary for modal analysis post-process.
Definition: mbs_modal.c:772
int compute_JS
no = 0, yes = 1, flag to compute the non diagonal terms [default = 0] TO IMPLEMENT !
Definition: mbs_modal_struct.h:28
double lpk_equitol
See MbsLpk::equitol [default = 1e-6].
Definition: mbs_modal_struct.h:37
double * Qq_saved
copy of vector Qq before the modal process.
Definition: mbs_modal_struct.h:95
double * qdd_saved
copy of vector qdd before the modal process.
Definition: mbs_modal_struct.h:94
MbsAux * initMbsAux(MbsData *s)
Definition: mbs_aux.c:18
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
char * get_time_machine()
returns the current time as a String
Definition: useful_functions.c:136
MbsSS * mbs_new_statespace(MbsData *s, int nu, int ny, int compute_uxd, int compute_JS)
Create a new structure state-space that contains the matrices (A,B,C,D).
Definition: mbs_statespace.c:19
int mbs_modal_init(MbsModal *mo, MbsData *s)
Initialize the Modal structure variables.
Definition: mbs_modal.c:142
Definition: mbs_data.h:246
double * ux_a
Real part of the extra ODE states corresponding to the mode motion (computed from ux_r)
Definition: mbs_modal_struct.h:69
double ksi
Damping factor [%].
Definition: mbs_modal_struct.h:63
#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:172
int mbs_modal_save_result(MbsModal *mbs_modal, MbsData *s, char *filename)
Write the modal analysis results (eigenmode, eigenfrequencies, mode type, ...) into a ASCII text file...
Definition: mbs_modal.c:824
double * evec_r
Norm of the eigen vector associated to the mode [nx].
Definition: mbs_modal_struct.h:77
int verbose
Definition: mbs_linearipk_struct.h:47
char * resfilename
Definition: mbs_modal_struct.h:46
double * ux_phi
Phase of the extra ODE states corresponding to the mode motion (computed from evec_r and evec_phi)
Definition: mbs_modal_struct.h:75
int save2file
no = 0, yes = 1, flag to save any results or animations [default = 1]
Definition: mbs_modal_struct.h:14
int mbs_run_modal(MbsModal *mo, MbsData *s)
Run the Modal Analysis.
Definition: mbs_modal.c:111
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
int nMode
Number of modes (nx duplication)
Definition: mbs_modal_struct.h:110
double eval_a
Real part of the mode eigenvalue.
Definition: mbs_modal_struct.h:60
void mbs_delete_lpk(MbsLpk *lpk)
free memory of the lpk structure.
Definition: mbs_linearipk.c:399
double ** Gx
Linearized ODE damping matrix : d uxd / d qdu.
Definition: mbs_statespace_struct.h:32
double equitol
Minimum gradient to be considered as sensitive [default = 1e-6].
Definition: mbs_linearipk_struct.h:53
int flag_stop
stop the simulation. For dirdyn, equil, invdyn and solvekin only.
Definition: mbs_data.h:397
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:960
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
void free_dvec_0(double *vec)
release memory for a vector of doubles, starting at index 0
Definition: mbs_1D_array.c:971
MbsAux * aux
Definition: mbs_modal_struct.h:85
double ** evec_r
Result of the Eigenvalue problem: norm of the eigen vectors (each column is a eigenvector) [nx X nx].
Definition: mbs_modal_struct.h:106
char * animpath
Definition: mbs_modal_struct.h:52
int find_ivec_0(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 0....
Definition: mbs_1D_array.c:877
double ** evec_phi
Result of the Eigenvalue problem: phase of the eigen vectors (each column is a eigenvector) [nx X nx]...
Definition: mbs_modal_struct.h:107
MbsSS * ss
working structure containing a state space representation (with the matrix A)
Definition: mbs_modal_struct.h:88
double lintol
Relative convergence criteria of the gradient [default = 1e-3].
Definition: mbs_linearipk_struct.h:54
double * ux_r
Norm of the extra ODE states corresponding to the mode motion (computed from evec_r and evec_phi)
Definition: mbs_modal_struct.h:74
#define MAX(a, b)
Definition: useful_functions.h:14
double ** Gr
Linearized damping matrix : d Rr / d qdu.
Definition: mbs_statespace_struct.h:26
int mbs_makedirs(char *path)
Create (recursively) the specified directory.
Definition: mbs_path.c:586
int mbs_compute_linearMatrices(MbsSS *ss, MbsData *mbs_data, MbsLpk *lpk, MbsAux *aux)
Compute the linearized matrices necessary to obtain the (A,B,C) state-space representation.
Definition: mbs_statespace.c:208
int mbs_modal_init(MbsModal *mo, MbsData *s)
Initialize the Modal structure variables.
Definition: mbs_modal.c:142
MbsModal * mbs_new_modal_aux(MbsData *s, MbsAux *mbs_aux)
Create a new modal structure.
Definition: mbs_modal.c:40
void mbs_delete_statespace(MbsSS *ss)
Free memory of the state-space structure.
Definition: mbs_statespace.c:543
#define MBS_VERBOSE_ALL
Definition: mbs_define.h:46
double anim_dt
delta t for the animation generation [default = 1e-2]
Definition: mbs_modal_struct.h:42