|
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:519
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:115
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:122
double * eval_b
Result of the Eigenvalue problem: imaginary part of the nx eigen values [nx].
Definition: mbs_modal_struct.h:120
int mbs_modal_loop(MbsModal *mo, MbsData *s)
Perform the Modal analysis.
Definition: mbs_modal.c:290
void mbs_msg(const char *msg,...)
Send a message.
Definition: mbs_message.c:87
int freeMbsAux(MbsAux *mbs_aux, MbsData *s)
Free the structure and its content.
Definition: mbs_aux.c:178
char * respath
Path in which results file are saved.
Definition: mbs_modal_struct.h:62
char * get_char_cpy(const char *fmt,...)
Copy the provided formatted string into a newly allocated memory.
Definition: useful_functions.c:235
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:286
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:653
int * iModeSorted
Definition: mbs_modal_struct.h:130
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:421
int nqv
Number of dependent articulations.
Definition: mbs_data.h:268
void mbs_delete_modal(MbsModal *mo, MbsData *s)
Free the MbsModal structure (pointers table, ...)
Definition: mbs_modal.c:698
int DoneEquil
Flag that indicates if the equilibrium module has been executed (default: 0=not done; 1=done).
Definition: mbs_data.h:404
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:827
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:263
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:1055
#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:260
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:91
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:374
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:519
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:74
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:775
double nu_0
Undamped frequency [Hz].
Definition: mbs_modal_struct.h:82
MbsLpk * lpk
working structure to compute the linearized matrices (one by one)
Definition: mbs_modal_struct.h:105
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:398
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:405
MbsModalOptions * options
Definition: mbs_modal_struct.h:102
#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:129
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:1399
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 The functi...
Definition: mbs_matrix.c:294
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:108
int type
1=unoscillating stable; 2=rigid; 3=unoscillating unstable; 4=oscillating damped; 5=oscillating undamp...
Definition: mbs_modal_struct.h:76
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:949
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:90
int * qu
Array with the indices of the independent articulations (free)
Definition: mbs_data.h:272
double nu
Frequency of the -damped- mode [Hz].
Definition: mbs_modal_struct.h:83
Definition: mbs_modal_struct.h:100
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:280
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:302
double * q_b
Img part of the generalized position corresponding to the mode motion (computed from q_phi)
Definition: mbs_modal_struct.h:86
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:85
double * q
Array with the current values of the generalized coordinates.
Definition: mbs_data.h:285
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:110
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:698
char * project_path
Path to the mbs project folder.
Definition: mbs_data.h:423
double * qd_saved
copy of vector qd before the modal process.
Definition: mbs_modal_struct.h:111
double * eval_a
Result of the Eigenvalue problem: real part of the nx eigen values [nx].
Definition: mbs_modal_struct.h:119
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:123
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:96
double eval_b
Imaginary part of the mode eigenvalue.
Definition: mbs_modal_struct.h:79
#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:117
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:108
int mbs_modal_loop(MbsModal *mo, MbsData *s)
Perform the Modal analysis.
Definition: mbs_modal.c:290
double * ux_b
Img part of the extra ODE states corresponding to the mode motion (computed from ux_phi)
Definition: mbs_modal_struct.h:88
int nqc
Number of driven articulations, it includes qlocked and qdriven.
Definition: mbs_data.h:264
int mbs_modal_save_anim(MbsModal *mo, MbsData *s, char *filepath)
Save the modes animations in the MbSysPad format.
Definition: mbs_modal.c:949
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:775
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:113
double * qdd_saved
copy of vector qdd before the modal process.
Definition: mbs_modal_struct.h:112
int set_char_cpy(char **dest, const char *fmt,...)
Set a copy the provided formatted string into a newly allocated memory.
Definition: useful_functions.c:250
MbsAux * initMbsAux(MbsData *s)
Definition: mbs_aux.c:22
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:555
char * get_time_machine()
returns the current time as a String
Definition: useful_functions.c:139
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:141
Definition: mbs_data.h:247
double * ux_a
Real part of the extra ODE states corresponding to the mode motion (computed from ux_r)
Definition: mbs_modal_struct.h:87
double ksi
Damping factor [%].
Definition: mbs_modal_struct.h:81
#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:827
double * evec_r
Norm of the eigen vector associated to the mode [nx].
Definition: mbs_modal_struct.h:95
int verbose
Definition: mbs_linearipk_struct.h:47
char * resfilename
Basename of the results files, suffixes and extension added automatically.
Definition: mbs_modal_struct.h:54
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:93
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:108
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:22
int nMode
Number of modes (nx duplication)
Definition: mbs_modal_struct.h:128
double eval_a
Real part of the mode eigenvalue.
Definition: mbs_modal_struct.h:78
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 in case of non zero value. Negative for error, positive for user_wanted behavior.
Definition: mbs_data.h:409
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:1071
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:1100
void free_dvec_0(double *vec)
release memory for a vector of doubles, starting at index 0
Definition: mbs_1D_array.c:1090
MbsAux * aux
Definition: mbs_modal_struct.h:103
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:124
char * animpath
Path in which animation file is saved.
Definition: mbs_modal_struct.h:70
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:977
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:125
MbsSS * ss
working structure containing a state space representation (with the matrix A)
Definition: mbs_modal_struct.h:106
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:92
#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:141
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:47
double anim_dt
delta t for the animation generation [default = 1e-2]
Definition: mbs_modal_struct.h:42