#include "mbs_modal.h"
#include "mbs_linalg.h"
#include "mbs_path.h"
#include "mbs_errors_names.h"
#include "math.h"
#include "mbs_statespace.h"
#include "mbs_message.h"
#include "mbs_check.h"
#include "mbs_trigo.h"
#include "mbs_define.h"
Macros | |
#define | _USE_MATH_DEFINES |
Functions | |
MbsModal * | mbs_new_modal (MbsData *s) |
Create a new modal structure. More... | |
MbsModal * | mbs_new_modal_aux (MbsData *s, MbsAux *mbs_aux) |
Create a new modal structure. More... | |
int | mbs_run_modal (MbsModal *mo, MbsData *s) |
Run the Modal Analysis. More... | |
int | mbs_modal_init (MbsModal *mo, MbsData *s) |
Initialize the Modal structure variables. More... | |
int | mbs_modal_loop (MbsModal *mo, MbsData *s) |
Perform the Modal analysis. More... | |
int | mbs_modal_finish (MbsModal *mo, MbsData *s) |
Set Modal flag to done in MbsData structure and save the modal analysis. More... | |
void | mbs_delete_modal (MbsModal *mo, MbsData *s) |
Free the MbsModal structure (pointers table, ...) More... | |
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. More... | |
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. More... | |
int | mbs_modal_save_anim (MbsModal *mo, MbsData *s, char *filepath) |
Save the modes animations in the MbSysPad format. More... | |
This file implements the functions of the modal module in C.
Creation date: 26/11/2015
(c) Universite catholique de Louvain
#define _USE_MATH_DEFINES |
Free the MbsModal structure (pointers table, ...)
The MbsModalOptions (MbsModal::options), the MbsLpk (MbsModal::lpk) and MbsAux (MbsModal::aux) structures are also freed.
Set Modal flag to done in MbsData structure and save the modal analysis.
The Modal analysis results are saved in .txt file:
[in,out] | mo | the MbsModal to be saved. |
[in] | s | the MbsData structure related to the parameter mo . |
Initialize the Modal structure variables.
It allocates the memory based on the number of independant (nqu) variables in the MBS system
[in,out] | mo | the MbsModal to be run |
[in] | s | the MbsData structure of the model for which the modal analysis is computed |
Perform the Modal analysis.
The modal analysis requires the following operations:
Based on the solvepk algorithm (see Numerics)
[in,out] | mo | the MbsModal to be run |
[in] | s | the MbsData structure of the model for which the modal analysis is computed |
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.
It allows to normalize the position nqu part of the eigenvector based on the position part of the vector (vel is ommited). To avoid complication this features is only available when Nux=0 (because for multiphysics, order of magnitude can be different depending on the units chosen...).
[in] | mat_r | norm of the eigen vectors. |
[in] | mat_phi | phase of the eigen vectors. |
[in] | nqu | number of independant joints. |
[in] | Nux | number of extra ODE variables. |
[in] | ind | index of the eigen value processed. |
[out] | evec_r | Norm of the eigen vector associated to the mode. |
[out] | evec_phi | Phase of the eigen vector associated to the mode. |
Write the modal analysis results (eigenmode, eigenfrequencies, mode type, ...) into a ASCII text file.
The modes are not sorted.
[in] | mbs_modal | the MbsModal to be run |
[in] | s | the MbsData structure of the model for which the modal analysis is computed |
[in] | filename | the path and full name of the file to write. |
Create a new modal structure.
This function also initialize the options structures and the MbsAux for storing computational info during simulation.
mbs_data
the data structure of the model for which the modal analysis will be computed
Create a new modal structure.
This function also initialize the options structures. A pointer to the given MbsAux structure is kept by the returned structure.
mbs_data
the data structure of the model for which the modal analysis will be computed
Run the Modal Analysis.
The modal analysis consists in the following function
The MbsData structure associated should not be modified if the process success.
[in,out] | mo | the MbsModal to be run |
[in] | s | the MbsData structure of the model for which the modal analysis is computed |