#+TITLE: Modal Analysis - Modal Parameter Extraction :DRAWER: #+STARTUP: overview #+LANGUAGE: en #+EMAIL: dehaeze.thomas@gmail.com #+AUTHOR: Dehaeze Thomas #+HTML_LINK_HOME: ../index.html #+HTML_LINK_UP: ./index.html #+HTML_HEAD: #+HTML_HEAD: #+HTML_HEAD: #+HTML_HEAD: #+HTML_HEAD: #+HTML_HEAD: #+HTML_HEAD: #+HTML_MATHJAX: align: center tagside: right font: TeX #+PROPERTY: header-args:matlab :session *MATLAB* #+PROPERTY: header-args:matlab+ :comments org #+PROPERTY: header-args:matlab+ :results none #+PROPERTY: header-args:matlab+ :exports both #+PROPERTY: header-args:matlab+ :eval no-export #+PROPERTY: header-args:matlab+ :output-dir figs #+PROPERTY: header-args:matlab+ :tangle matlab/modal_extraction.m #+PROPERTY: header-args:matlab+ :mkdirp yes #+PROPERTY: header-args:shell :eval no-export #+PROPERTY: header-args:latex :headers '("\\usepackage{tikz}" "\\usepackage{import}" "\\import{$HOME/Cloud/These/LaTeX/}{config.tex}") #+PROPERTY: header-args:latex+ :imagemagick t :fit yes #+PROPERTY: header-args:latex+ :iminoptions -scale 100% -density 150 #+PROPERTY: header-args:latex+ :imoutoptions -quality 100 #+PROPERTY: header-args:latex+ :results raw replace :buffer no #+PROPERTY: header-args:latex+ :eval no-export #+PROPERTY: header-args:latex+ :exports both #+PROPERTY: header-args:latex+ :mkdirp yes #+PROPERTY: header-args:latex+ :output-dir figs :END: * Introduction :ignore: The goal here is to extract the modal parameters describing the modes of station being studied, namely: - the eigen frequencies and the modal damping (eigen values) - the mode shapes (eigen vectors) This is done from the FRF matrix previously extracted from the measurements. In order to do the modal parameter extraction, we first have to estimate the order of the modal model we want to obtain. This corresponds to how many modes are present in the frequency band of interest. In section [[sec:number_of_modes]], we will use the Singular Value Decomposition and the Modal Indication Function to estimate the number of modes. The modal parameter extraction methods generally consists of *curve-fitting a theoretical expression for an individual FRF to the actual measured data*. However, there are multiple level of complexity: - works on a part of a single FRF curve - works on a complete curve encompassing several resonances - works on a set of many FRF plots all obtained from the same structure The third method is the most complex but gives better results. This is the one we will use in section [[sec:modal_extraction]]. From the modal model, it is possible to obtain a graphic display of the mode shapes (section [[sec:mode_shape_display]]). In order to validate the quality of the modal model, we will synthesize the FRF matrix from the modal model and compare it with the FRF measured (section [[sec:validity_measurement]]). The modes of the structure are expected to be complex, however real modes are easier to work with when it comes to obtain a spatial model from the modal parameters. We will thus study the complexity of those modes, in section [[sec:modal_complexity]], and see if we can estimate real modes from the complex modes. The mode obtained from the modal software describe the motion of the structure at the position of each accelerometer for all the modes. However, we would like to describe the motion of each stage (solid body) of the structure in its 6 DOFs. This in done in section [[sec:global_mode_shapes]]. Residues will have to be included. * ZIP file containing the data and matlab files :ignore: #+begin_src bash :exports none :results none if [ matlab/modal_extraction.m -nt data/modal_extraction.zip ]; then cp matlab/modal_extraction.m modal_extraction.m; zip data/modal_extraction \ mat/frf_coh_matrices.mat \ mat/frf_o.mat \ mat/mode_shapes.txt \ mat/mode_freqs.txt \ mat/mode_damps.txt \ mat/mode_modal_a.txt \ mat/mode_modal_b.txt \ modal_extraction.m rm modal_extraction.m; fi #+end_src #+begin_note All the files (data and Matlab scripts) are accessible [[file:data/modal_extraction.zip][here]]. #+end_note * Matlab Init :noexport:ignore: #+begin_src matlab :tangle no :exports none :results silent :noweb yes :var current_dir=(file-name-directory buffer-file-name) <> #+end_src #+begin_src matlab :exports none :results silent :noweb yes <> #+end_src * Load Data #+begin_src matlab load('mat/frf_coh_matrices.mat', 'FRFs', 'COHs', 'freqs'); load('mat/geometry.mat', 'solids', 'solid_names', 'acc_pos'); load('mat/frf_o.mat', 'FRFs_O'); #+end_src * Determine the number of modes <> ** Singular Value Decomposition - Modal Indication Function The Mode Indicator Functions are usually used on $n\times p$ FRF matrix where $n$ is a relatively large number of measurement DOFs and $p$ is the number of excitation DOFs, typically 3 or 4. In these methods, the frequency dependent FRF matrix is subjected to a singular value decomposition analysis which thus yields a small number (3 or 4) of singular values, these also being frequency dependent. These methods are used to *determine the number of modes* present in a given frequency range, to *identify repeated natural frequencies* and to pre process the FRF data prior to modal analysis. From the documentation of the modal software: #+begin_quote The MIF consist of the singular values of the Frequency response function matrix. The number of MIFs equals the number of excitations. By the powerful singular value decomposition, the real signal space is separated from the noise space. Therefore, the MIFs exhibit the modes effectively. A peak in the MIFs plot usually indicate the existence of a structural mode, and two peaks at the same frequency point means the existence of two repeated modes. Moreover, the magnitude of the MIFs implies the strength of the a mode. #+end_quote #+begin_important The *Complex Mode Indicator Function* is defined simply by the SVD of the FRF (sub) matrix: \begin{align*} [H(\omega)]_{n\times p} &= [U(\omega)]_{n\times n} [\Sigma(\omega)]_{n\times p} [V(\omega)]_{p\times p}^H\\ [CMIF(\omega)]_{p\times p} &= [\Sigma(\omega)]_{p\times n}^T [\Sigma(\omega)]_{n\times p} \end{align*} #+end_important We compute the Complex Mode Indicator Function. The result is shown on figure [[fig:cmif]]. The exact same curve is obtained when computed using the OROS software. #+begin_src matlab MIF = zeros(size(FRFs, 2), size(FRFs, 2), size(FRFs, 3)); for i = 1:length(freqs) [~,S,~] = svd(FRFs(:, :, i)); MIF(:, :, i) = S'*S; end #+end_src #+begin_src matlab :exports none figure; hold on; for i = 1:size(MIF, 1) plot(freqs, squeeze(MIF(i, i, :)), 'DisplayName', sprintf('MDIF - %i', i)); end hold off; set(gca, 'Yscale', 'log'); xlabel('Frequency [Hz]'); ylabel('CMIF Amplitude'); xlim([1, 200]); legend('location', 'southeast'); #+end_src #+HEADER: :tangle no :exports results :results none :noweb yes #+begin_src matlab :var filepath="figs/cmif.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png") <> #+end_src #+NAME: fig:cmif #+CAPTION: Complex Mode Indicator Function [[file:figs/cmif.png]] We can also compute the CMIF using the FRF matrix expressed in the same global frame. We compare the two CMIF on figure [[fig:cmif_compare]]. They do not indicate the same resonance frequencies, especially around 110Hz. #+begin_src matlab MIF_O = zeros(size(FRFs_O, 2), size(FRFs_O, 2), size(FRFs_O, 3)); for i = 1:length(freqs) [~,S,~] = svd(FRFs_O(:, :, i)); MIF_O(:, :, i) = S'*S; end #+end_src #+begin_src matlab :exports none figure; hold on; for i = 1:size(MIF, 1) set(gca,'ColorOrderIndex',i) plot(freqs, squeeze(MIF(i, i, :)), '-'); set(gca,'ColorOrderIndex',i) plot(freqs, squeeze(MIF_O(i, i, :)), '--'); end hold off; set(gca, 'Yscale', 'log'); xlabel('Frequency [Hz]'); ylabel('CMIF Amplitude'); xlim([1, 200]); #+end_src #+HEADER: :tangle no :exports results :results none :noweb yes #+begin_src matlab :var filepath="figs/cmif_compare.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png") <> #+end_src #+NAME: fig:cmif_compare #+CAPTION: Complex Mode Indicator Function - Original FRF: solid curves - Processed FRF: dashed curve [[file:figs/cmif_compare.png]] ** Composite Response Function An alternative is the Composite Response Function $HH(\omega)$ defined as the sum of all the measured FRF: \begin{equation} HH(\omega) = \sum_j\sum_kH_{jk}(\omega) \end{equation} Instead, we choose here to use the sum of the norms of the measured FRFs: \begin{equation} HH(\omega) = \sum_j\sum_k \left|H_{jk}(\omega) \right| \end{equation} The result is shown on figure [[fig:composite_response_function]]. #+begin_src matlab figure; hold on; plot(freqs, squeeze(sum(sum(abs(FRFs)))), '-k'); plot(freqs, squeeze(sum(sum(abs(FRFs_O)))), '--k'); hold off; xlabel('Frequency [Hz]'); ylabel('Amplitude'); xlim([1, 200]); #+end_src #+HEADER: :tangle no :exports results :results none :noweb yes #+begin_src matlab :var filepath="figs/composite_response_function.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png") <> #+end_src #+NAME: fig:composite_response_function #+CAPTION: Composite Response Function. Solid curve: computed from the original FRFs. Dashed curve: computed from the FRFs expressed in the global frame. [[file:figs/composite_response_function.png]] * Modal parameter extraction <> ** OROS - Modal software Modal identification are done within the [[https://www.oros.com/solutions/structural-dynamics/modal-analysis/][Modal software of OROS]]. The manual for the software is available [[file:data/oros_modal_manual.pdf][here]]. Several modal parameter extraction methods are available. We choose to use the "*broad band*" method as it permits to identify the modal parameters using all the FRF curves at the same time. It takes into account the fact the the properties of all the individual curves are related by being from the same structure: all FRF plots on a given structure should indicate the same values for the natural frequencies and damping factor of each mode. Such method also have the advantage of producing a *unique and consistent model* as direct output. In order to apply this method, we select the frequency range of interest and we give an estimate of how many modes are present. Then, it shows a stabilization charts, such as the one shown on figure [[fig:stabilization_chart]], where we have to manually select which modes to take into account in the modal model. #+name: fig:stabilization_chart #+caption: Stabilization Chart [[file:img/modal_software/stabilisation_chart.jpg]] We can then run the modal analysis, and the software will identify the modal damping and mode shapes at the selected frequency modes. ** Exported modal parameters The obtained modal parameters are: - resonance frequencies in Hertz - modal damping ratio in percentage - (complex) modes shapes for each measured DoF - modal A and modal B which are parameters important for further normalization They are all exported in a text file named =modes.asc=. Its first 20 lines as shown below. #+begin_src bash :results output :exports results :eval no-export sed 20q mat/modes_2019_07_16.asc | sed $'s/\r//' #+end_src #+RESULTS: #+begin_example Created by N-Modal Estimator: bbfd 16-Jul-19 09:35:42 Mode 1 freq = 11.86509Hz damp = 12.20318% modal A = 4.13559e+003+6.22828e+003i modal B = 4.98475e+005-2.49344e+005i Mode matrix of local coordinate [DOF: Re IM] 1X+: -1.08546e-001 3.17769e-002 1Y+: 2.32355e-001 1.71539e-003 1Z+: -1.98455e-002 5.79676e-003 2X+: -8.59861e-002 2.84442e-002 2Y+: 2.40594e-001 0.00000e+000 2Z+: -7.65144e-003 4.22952e-003 3Y+: 2.14274e-001 7.53040e-003 3X-: 1.22352e-001 -2.90328e-002 3Z+: -2.12103e-002 -3.81368e-003 #+end_example We split this big =modes.asc= file into sub text files using =bash=. The obtained files are described one table [[tab:modes_files]]. #+begin_src bash :results none sed '/^\s*[0-9]*[XYZ][+-]:/!d' mat/modes_2019_07_16.asc > mat/mode_shapes.txt sed '/freq/!d' mat/modes_2019_07_16.asc | sed 's/.* = \(.*\)Hz/\1/' > mat/mode_freqs.txt sed '/damp/!d' mat/modes_2019_07_16.asc | sed 's/.* = \(.*\)\%/\1/' > mat/mode_damps.txt sed '/modal A/!d' mat/modes_2019_07_16.asc | sed 's/.* =\s\+\([-0-9.e]\++[0-9]\+\)\([-+0-9.e]\+\)i/\1 \2/' > mat/mode_modal_a.txt sed '/modal B/!d' mat/modes_2019_07_16.asc | sed 's/.* =\s\+\([-0-9.e]\++[0-9]\+\)\([-+0-9.e]\+\)i/\1 \2/' > mat/mode_modal_b.txt #+end_src #+name: tab:modes_files #+caption: Split =modes.asc= file | Filename | Content | |------------------------+----------------------------| | =mat/mode_shapes.txt= | mode shapes | | =mat/mode_freqs.txt= | resonance frequencies [Hz] | | =mat/mode_damps.txt= | modal damping [per] | | =mat/mode_modal_a.txt= | Modal A | | =mat/mode_modal_b.txt= | Modal B | ** Importation of the modal parameters on Matlab Then we import the obtained =.txt= files on Matlab using =readtable= function. #+begin_src matlab shapes_m = readtable('mat/mode_shapes.txt', 'ReadVariableNames', false); % [Sign / Real / Imag] freqs_m = table2array(readtable('mat/mode_freqs.txt', 'ReadVariableNames', false)); % in [Hz] damps_m = table2array(readtable('mat/mode_damps.txt', 'ReadVariableNames', false)); % in [%] modal_a = table2array(readtable('mat/mode_modal_a.txt', 'ReadVariableNames', false)); % [Real / Imag] modal_b = table2array(readtable('mat/mode_modal_b.txt', 'ReadVariableNames', false)); % [Real / Imag] #+end_src We guess the number of modes identified from the length of the imported data. #+begin_src matlab acc_n = 23; % Number of accelerometers dir_n = 3; % Number of directions dirs = 'XYZ'; mod_n = size(shapes_m,1)/acc_n/dir_n; % Number of modes #+end_src As the mode shapes are split into 3 parts (direction plus sign, real part and imaginary part), we aggregate them into one array of complex numbers. #+begin_src matlab T_sign = table2array(shapes_m(:, 1)); T_real = table2array(shapes_m(:, 2)); T_imag = table2array(shapes_m(:, 3)); mode_shapes = zeros(mod_n, dir_n, acc_n); for mod_i = 1:mod_n for acc_i = 1:acc_n % Get the correct section of the signs T = T_sign(acc_n*dir_n*(mod_i-1)+1:acc_n*dir_n*mod_i); for dir_i = 1:dir_n % Get the line corresponding to the sensor i = find(contains(T, sprintf('%i%s',acc_i, dirs(dir_i))), 1, 'first')+acc_n*dir_n*(mod_i-1); mode_shapes(mod_i, dir_i, acc_i) = str2num([T_sign{i}(end-1), '1'])*complex(T_real(i),T_imag(i)); end end end #+end_src The obtained mode frequencies and damping are shown below. #+begin_src matlab :exports results :results value table replace :tangle no :post addhdr(*this*) data2orgtable([(1:length(freqs_m))', freqs_m, damps_m], {}, {'Mode number', 'Frequency [Hz]', 'Damping [%]'}, ' %.1f '); #+end_src #+RESULTS: | Mode number | Frequency [Hz] | Damping [%] | |-------------+----------------+-------------| | 1.0 | 11.9 | 12.2 | | 2.0 | 18.6 | 11.7 | | 3.0 | 37.8 | 6.2 | | 4.0 | 39.1 | 2.8 | | 5.0 | 56.3 | 2.8 | | 6.0 | 69.8 | 4.3 | | 7.0 | 72.5 | 1.3 | | 8.0 | 84.8 | 3.7 | | 9.0 | 91.3 | 2.9 | | 10.0 | 105.5 | 3.2 | | 11.0 | 106.6 | 1.6 | | 12.0 | 112.7 | 3.1 | | 13.0 | 124.2 | 2.8 | | 14.0 | 145.3 | 1.3 | | 15.0 | 150.5 | 2.4 | | 16.0 | 165.4 | 1.4 | #+name: tab:obtained_modes_freqs_damps #+caption: Obtained eigen frequencies and modal damping #+RESULTS: ** Theory It seems that the modal analysis software makes the *assumption* of viscous damping for the model with which it tries to fit the FRF measurements. If we note $N$ the number of modes identified, then there are $2N$ eigenvalues and eigenvectors given by the software: \begin{align} s_r &= \omega_r (-\xi_r + i \sqrt{1 - \xi_r^2}),\quad s_r^* \\ \{\psi_r\} &= \begin{Bmatrix} \psi_{1_x} & \psi_{2_x} & \dots & \psi_{23_x} & \psi_{1_y} & \dots & \psi_{1_z} & \dots & \psi_{23_z} \end{Bmatrix}^T, \quad \{\psi_r\}^* \end{align} for $r = 1, \dots, N$ where $\omega_r$ is the natural frequency and $\xi_r$ is the critical damping ratio for that mode. ** Modal Matrices We would like to arrange the obtained modal parameters into two modal matrices: \[ \Lambda = \begin{bmatrix} s_1 & & 0 \\ & \ddots & \\ 0 & & s_N \end{bmatrix}_{N \times N}; \quad \Psi = \begin{bmatrix} & & \\ \{\psi_1\} & \dots & \{\psi_N\} \\ & & \end{bmatrix}_{M \times N} \] \[ \{\psi_i\} = \begin{Bmatrix} \psi_{i, 1_x} & \psi_{i, 1_y} & \psi_{i, 1_z} & \psi_{i, 2_x} & \dots & \psi_{i, 23_z} \end{Bmatrix}^T \] $M$ is the number of DoF: here it is $23 \times 3 = 69$. $N$ is the number of mode #+begin_src matlab eigen_val_M = diag(2*pi*freqs_m.*(-damps_m/100 + j*sqrt(1 - (damps_m/100).^2))); eigen_vec_M = reshape(mode_shapes, [mod_n, acc_n*dir_n]).'; #+end_src Each eigen vector is normalized: $\| \{\psi_i\} \|_2 = 1$ However, the eigen values and eigen vectors appears as complex conjugates: \[ s_r, s_r^*, \{\psi\}_r, \{\psi\}_r^*, \quad r = 1, N \] In the end, they are $2N$ eigen values. We then build two extended eigen matrices as follow: \[ \mathcal{S} = \begin{bmatrix} s_1 & & & & & \\ & \ddots & & & 0 & \\ & & s_N & & & \\ & & & s_1^* & & \\ & 0 & & & \ddots & \\ & & & & & s_N^* \end{bmatrix}_{2N \times 2N}; \quad \Phi = \begin{bmatrix} & & & & &\\ \{\psi_1\} & \dots & \{\psi_N\} & \{\psi_1^*\} & \dots & \{\psi_N^*\} \\ & & & & & \end{bmatrix}_{M \times 2N} \] #+begin_src matlab eigen_val_ext_M = blkdiag(eigen_val_M, conj(eigen_val_M)); eigen_vec_ext_M = [eigen_vec_M, conj(eigen_vec_M)]; #+end_src We also build the Modal A and Modal B matrices: \begin{equation} A = \begin{bmatrix} a_1 & & 0 \\ & \ddots & \\ 0 & & a_N \end{bmatrix}_{N \times N}; \quad B = \begin{bmatrix} b_1 & & 0 \\ & \ddots & \\ 0 & & b_N \end{bmatrix}_{N \times N} \end{equation} With $a_i$ is the "Modal A" parameter linked to mode i. #+begin_src matlab modal_a_M = diag(complex(modal_a(:, 1), modal_a(:, 2))); modal_b_M = diag(complex(modal_b(:, 1), modal_b(:, 2))); modal_a_ext_M = blkdiag(modal_a_M, conj(modal_a_M)); modal_b_ext_M = blkdiag(modal_b_M, conj(modal_b_M)); #+end_src "Modal A" and "modal B" are linked through the following formula: \[ B = - A \Lambda \] * Obtained Mode Shapes animations <> From the modal parameters, it is possible to show the modal shapes with an animation. Examples are shown on figures [[fig:mode1]] and [[fig:mode6]]. Animations of all the other modes are accessible using the following links: [[file:img/modes/mode1.gif][mode 1]], [[file:img/modes/mode2.gif][mode 2]], [[file:img/modes/mode3.gif][mode 3]], [[file:img/modes/mode4.gif][mode 4]], [[file:img/modes/mode5.gif][mode 5]], [[file:img/modes/mode6.gif][mode 6]], [[file:img/modes/mode7.gif][mode 7]], [[file:img/modes/mode8.gif][mode 8]], [[file:img/modes/mode9.gif][mode 9]], [[file:img/modes/mode10.gif][mode 10]], [[file:img/modes/mode11.gif][mode 11]], [[file:img/modes/mode12.gif][mode 12]], [[file:img/modes/mode13.gif][mode 13]], [[file:img/modes/mode14.gif][mode 14]], [[file:img/modes/mode15.gif][mode 15]], [[file:img/modes/mode16.gif][mode 16]], [[file:img/modes/mode17.gif][mode 17]], [[file:img/modes/mode18.gif][mode 18]], [[file:img/modes/mode19.gif][mode 19]], [[file:img/modes/mode20.gif][mode 20]], [[file:img/modes/mode21.gif][mode 21]]. #+name: fig:mode1 #+caption: Mode 1 [[file:img/modes/mode1.gif]] #+name: fig:mode6 #+caption: Mode 6 [[file:img/modes/mode6.gif]] We can learn quite a lot from these mode shape animations. For instance, the mode shape of the first mode at 11Hz (figure [[fig:mode1]]) seems to indicate that this corresponds to a suspension mode. This could be due to the 4 Airloc Levelers that are used for the granite (figure [[fig:airloc]]). #+name: fig:airloc #+caption: AirLoc used for the granite (2120-KSKC) #+attr_html: :width 500px [[file:img/airloc/IMG_20190618_155522.jpg]] They are probably *not well leveled*, so the granite is supported only by two Airloc. * Verify the validity of the Modal Model <> There are two main ways to verify the validity of the modal model - Synthesize FRF measurements that has been used to generate the modal model and compare - Synthesize FRF that has not yet been measured. Then measure that FRF and compare ** Theory From the modal model, we want to synthesize the Frequency Response Functions that has been used to build the modal model. Let's recall that: - $M$ is the number of measured DOFs ($3 \times n_\text{acc}$) - $N$ is the number of modes identified We then have that the FRF matrix $[H_{\text{syn}}]$ can be synthesize using the following formula: #+begin_important \begin{equation} [H_{\text{syn}}(\omega)]_{M\times M} = [\Phi]_{M\times2N} \left[\frac{Q_r}{j\omega - s_r}\right]_{2N\times2N} [\Phi]_{2N\times M}^T \end{equation} with $Q_r = 1/M_{A_r}$ #+end_important An alternative formulation is: \[ H_{pq}(s_i) = \sum_{r=1}^N \frac{A_{pqr}}{s_i - \lambda_r} + \frac{A_{pqr}^*}{s_i - \lambda_r^*} \] with: - $A_{pqr} = \frac{\psi_{pr}\psi_{qr}}{M_{A_r}}$, $M_{A_r}$ is called "Modal A" - $\psi_{pr}$: scaled modal coefficient for output DOF $p$, mode $r$ - $\lambda_r$: complex modal frequency From the modal software documentation: #+begin_quote *Modal A* Scaling constant for a complex mode. It has the same properties as modal mass for normal modes (undamped or proportionally damped cases). Assuming - $\psi_{pr}$ = Modal coefficient for measured degree of freedom p and mode r - $\psi_{qr}$ = Modal coefficient for measured degree of freedom q and mode r - $A_{pqr}$ = Residue for measured degree of freedom p, measured degree of q and mode r - $M_{Ar}$ = Modal A of mode r Then \[ A_{pqr} = \frac{\psi_{pr}\psi_{qr}}{M_{Ar}} \] *Modal B* Scaling constant for a complex mode. It has the same properties as modal stiffness for normal modes (undamped or proportionally damped cases). Assuming - $M_{Ar}$ = Modal A of mode r - $\lambda_r$ = System pole of mode r Then \[ M_{Br} = - \lambda_r M_{Ar} \] #+end_quote ** Matlab Implementation #+begin_src matlab Hsyn = zeros(acc_n*dir_n, acc_n*dir_n, length(freqs)); for i = 1:length(freqs) Hsyn(:, :, i) = eigen_vec_ext_M*((j*2*pi*freqs(i)).^2*inv(modal_a_ext_M)/(diag(j*2*pi*freqs(i) - diag(eigen_val_ext_M))))*eigen_vec_ext_M.'; end #+end_src Because the synthesize frequency response functions are representing the displacement response in $[m/N]$, we multiply each element of the FRF matrix by $(j \omega)^2$ in order to obtain the acceleration response in $[m/s^2/N]$. #+begin_src matlab for i = 1:size(Hsyn, 1) Hsyn(i, :, :) = squeeze(Hsyn(i, :, :)).*(j*2*pi*freqs).^2; end #+end_src ** Original and Synthesize FRF matrix comparison #+begin_src matlab :exports none acc_o = 1; dir_o = 1; dir_i = 1; figure; ax1 = subplot(2, 1, 1); hold on; plot(freqs, abs(squeeze(FRFs(3*(acc_o-1)+dir_o, dir_i, :))), 'DisplayName', 'Original'); plot(freqs, abs(squeeze(Hsyn(3*(acc_o-1)+dir_o, 3*(11-1)+dir_i, :))), 'DisplayName', 'Synthesize'); hold off; set(gca, 'yscale', 'log'); set(gca, 'XTickLabel',[]); ylabel('Magnitude [$\frac{m/s^2}{N}$]'); title(sprintf('From acc %i %s to acc %i %s', 11, dirs(dir_i), acc_o, dirs(dir_o))) legend('location', 'northwest'); ax2 = subplot(2, 1, 2); hold on; plot(freqs, mod(180/pi*phase(squeeze(FRFs(3*(acc_o-1)+dir_o, dir_i, :)))+180, 360)-180); plot(freqs, mod(180/pi*phase(squeeze(Hsyn(3*(acc_o-1)+dir_o, 3*(11-1)+dir_i, :)))+180, 360)-180); hold off; yticks(-360:90:360); ylim([-180, 180]); xlabel('Frequency [Hz]'); ylabel('Phase [deg]'); linkaxes([ax1,ax2],'x'); xlim([1, 200]); #+end_src #+HEADER: :tangle no :exports results :results none :noweb yes #+begin_src matlab :var filepath="figs/compare_synthesize_original_frf.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png") <> #+end_src #+NAME: fig:compare_synthesize_original_frf #+CAPTION: Comparison of the Original and Synthesize FRF matrix element [[file:figs/compare_synthesize_original_frf.png]] #+name: fig:from11xto1x #+caption: Original FRF and synthesize FRF using the modal software. From force applied in the X direction to the acceleration of accelerometer 11 in the X direction [[file:img/modal_software/from11xto1x.jpg]] #+begin_warning The synthesize FRFs from the modal software do not match the synthesize FRFs computed here. It is possible that it uses residues that are not exported? Nothing is said about that in the documentation. #+end_warning ** Synthesize FRF that has not yet been measured #+begin_src matlab :exports none accs = [1]; dirs = [1:3]; figure; ax1 = subplot(2, 1, 1); hold on; for acc_i = accs for dir_i = dirs plot(freqs, abs((1./(j*2*pi*freqs').^2).*squeeze(Hsyn(3*(acc_i-1)+dir_i, 3*(acc_i-1)+dir_i, :))), 'DisplayName', sprintf('Acc %i - %s', acc_i, dirs(dir_i))); end end hold off; set(gca, 'xscale', 'log'); set(gca, 'yscale', 'log'); set(gca, 'XTickLabel',[]); ylabel('Magnitude [$\frac{m}{N}$]'); legend('location', 'southwest'); ax2 = subplot(2, 1, 2); hold on; for acc_i = accs for dir_i = dirs plot(freqs, mod(180/pi*phase((1./(j*2*pi*freqs').^2).*squeeze(Hsyn(3*(acc_i-1)+dir_i, 3*(acc_i-1)+dir_i, :)))+180, 360)-180); end end hold off; yticks(-360:90:360); ylim([-180, 180]); set(gca, 'xscale', 'log'); xlabel('Frequency [Hz]'); ylabel('Phase [deg]'); linkaxes([ax1,ax2],'x'); xlim([1, 200]); #+end_src #+HEADER: :tangle no :exports results :results none :noweb yes #+begin_src matlab :var filepath="figs/synthesize_frf_new_meas.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png") <> #+end_src #+NAME: fig:synthesize_frf_new_meas #+CAPTION: Synthesize FRF that has not been measured [[file:figs/synthesize_frf_new_meas.png]] * Modal Complexity <> A method of displaying *modal complexity* is by plotting the elements of the eigenvector on an *Argand diagram* (complex plane), such as the ones shown in figure [[fig:modal_complexity_small]]. To evaluate the complexity of the modes, we plot a polygon around the extremities of the individual vectors. The obtained area of this polygon is then compared with the area of the circle which is based on the length of the largest vector element. The resulting ratio is used as an *indication of the complexity of the mode*. A mode with small complexity is shown on figure [[fig:modal_complexity_small]] whereas an highly complex mode is shown on figure [[fig:modal_complexity_high]]. The complexity of all the modes are compared on figure [[fig:modal_complexities]]. #+begin_src matlab :exports none figure; mod_i = 1; i_max = convhull(real(eigen_vector_M(:, mod_i)), imag(eigen_vector_M(:, mod_i))); radius = max(abs(eigen_vector_M(:, mod_i))); theta = linspace(0, 2*pi, 100); hold on; plot(radius*cos(theta), radius*sin(theta), '-'); plot(real(eigen_vector_M(i_max, mod_i)), imag(eigen_vector_M(i_max, mod_i)), '-'); plot(real(eigen_vector_M(:, mod_i)), imag(eigen_vector_M(:, mod_i)), 'ko'); hold off; xlabel('Real Part'); ylabel('Imaginary Part'); title(sprintf('Mode %i', mod_i)); axis manual equal #+end_src #+HEADER: :tangle no :exports results :results none :noweb yes #+begin_src matlab :var filepath="figs/modal_complexity_small.pdf" :var figsize="normal-normal" :post pdf2svg(file=*this*, ext="png") <> #+end_src #+NAME: fig:modal_complexity_small #+CAPTION: Modal Complexity of one mode with small complexity [[file:figs/modal_complexity_small.png]] #+begin_src matlab :exports none mod_i = 8; i_max = convhull(real(eigen_vector_M(:, mod_i)), imag(eigen_vector_M(:, mod_i))); radius = max(abs(eigen_vector_M(:, mod_i))); theta = linspace(0, 2*pi, 100); figure; hold on; plot(radius*cos(theta), radius*sin(theta), '-'); plot(real(eigen_vector_M(i_max, mod_i)), imag(eigen_vector_M(i_max, mod_i)), '-'); plot(real(eigen_vector_M(:, mod_i)), imag(eigen_vector_M(:, mod_i)), 'ko'); hold off; xlabel('Real Part'); ylabel('Imaginary Part'); title(sprintf('Mode %i', mod_i)); axis manual equal #+end_src #+HEADER: :tangle no :exports results :results none :noweb yes #+begin_src matlab :var filepath="figs/modal_complexity_high.pdf" :var figsize="normal-normal" :post pdf2svg(file=*this*, ext="png") <> #+end_src #+NAME: fig:modal_complexity_high #+CAPTION: Modal Complexity of one higly complex mode [[file:figs/modal_complexity_high.png]] #+begin_src matlab :exports none modes_complexity = zeros(mod_n, 1); for mod_i = 1:mod_n i = convhull(real(eigen_vector_M(:, mod_i)), imag(eigen_vector_M(:, mod_i))); area_complex = polyarea(real(eigen_vector_M(i, mod_i)), imag(eigen_vector_M(i, mod_i))); area_circle = pi*max(abs(eigen_vector_M(:, mod_i)))^2; modes_complexity(mod_i) = area_complex/area_circle; end figure; plot(1:mod_n, modes_complexity, 'ok'); ylim([0, 1]); xlabel('Mode Number'); ylabel('Modal Complexity'); #+end_src #+HEADER: :tangle no :exports results :results none :noweb yes #+begin_src matlab :var filepath="figs/modal_complexities.pdf" :var figsize="wide-normal" :post pdf2svg(file=*this*, ext="png") <> #+end_src #+NAME: fig:modal_complexities #+CAPTION: Modal complexity for each mode [[file:figs/modal_complexities.png]] * Modal Assurance Criterion (MAC) The MAC is calculated as the normalized scalar product of the two sets of vectors $\{\psi_A\}$ and $\{\psi_X\}$. The resulting scalars are arranged into the MAC matrix cite:pastor12_modal_assur_criter: \begin{equation} \text{MAC}(r, q) = \frac{\left| \{\psi_A\}_r^T \{\psi_X\}_q^* \right|^2}{\left( \{\psi_A\}_r^T \{\psi_A\}_r^* \right) \left( \{\psi_X\}_q^T \{\psi_X\}_q^* \right)} \end{equation} An equivalent formulation is: \begin{equation} \text{MAC}(r, q) = \frac{\left| \sum_{j=1}^n \{\psi_A\}_j \{\psi_X\}_j^* \right|^2}{\left( \sum_{j=1}^n |\{\psi_A\}_j|^2 \right) \left( \sum_{j=1}^n |\{\psi_X\}_j|^2 \right)} \end{equation} The MAC takes value between 0 (representing no consistent correspondence) and 1 (representing a consistent correspondence). We compute the autoMAC matrix that compares all the possible combinations of mode shape pairs for only one set of mode shapes. The result is shown on figure [[fig:automac]]. #+begin_src matlab autoMAC = eye(size(eigen_vec_M, 2)); for r = 1:size(eigen_vec_M, 2) for q = r+1:size(eigen_vec_M, 2) autoMAC(r, q) = abs(eigen_vec_M(r, :)*eigen_vec_M(q, :)')^2/((eigen_vec_M(r, :)*eigen_vec_M(r, :)')*(eigen_vec_M(q, :)*eigen_vec_M(q, :)')); autoMAC(q, r) = autoMAC(r, q); end end #+end_src #+begin_src matlab :exports none figure; imagesc(autoMAC); colormap('parula'); colorbar; xticks(1:1:size(eigen_val_M, 1)); yticks(1:1:size(eigen_val_M, 1)); xticklabels(num2str(round(imag(diag(eigen_val_M))/2/pi, 1))); xtickangle(90); yticklabels(num2str(round(imag(diag(eigen_val_M))/2/pi, 1))); set(gca,'YDir','normal'); #+end_src #+HEADER: :tangle no :exports results :results none :noweb yes #+begin_src matlab :var filepath="figs/automac.pdf" :var figsize="wide-tall" :post pdf2svg(file=*this*, ext="png") <> #+end_src #+NAME: fig:automac #+CAPTION: AutoMAC [[file:figs/automac.png]] * From accelerometer coordinates to global coordinates for the mode shapes <> ** Mathematical description #+begin_src latex :file local_to_global_coordinates_modes.pdf :post pdf2svg(file=*this*, ext="png") :exports results \newcommand\irregularcircle[2]{% radius, irregularity \pgfextra {\pgfmathsetmacro\len{(#1)+rand*(#2)}} +(0:\len pt) \foreach \a in {10,20,...,350}{ \pgfextra {\pgfmathsetmacro\len{(#1)+rand*(#2)}} -- +(\a:\len pt) } -- cycle } \begin{tikzpicture} \draw[rounded corners=1mm, fill=blue!30!white] (0, 0) \irregularcircle{3cm}{1mm}; \node[] (origin) at (4, -1) {$\bullet$}; \begin{scope}[shift={(origin)}] \def\axissize{0.8cm} \draw[->] (0, 0) -- ++(\axissize, 0) node[above left]{$x$}; \draw[->] (0, 0) -- ++(0, \axissize) node[below right]{$y$}; \draw[fill, color=black] (0, 0) circle (0.05*\axissize); \node[draw, circle, inner sep=0pt, minimum size=0.4*\axissize, label=left:$z$] (yaxis) at (0, 0){}; \node[below right] at (0, 0){$\{O\}$}; \end{scope} \coordinate[] (p1) at (-1.5, -1.5); \coordinate[] (p2) at (-1.5, 1.5); \coordinate[] (p3) at ( 1.5, 1.5); \coordinate[] (p4) at ( 1.5, -1.5); \draw[->] (p1)node[]{$\bullet$}node[above]{$p_1$} -- ++( 1, 0.5)node[right]{$\xi_1$}; \draw[->] (p2)node[]{$\bullet$}node[above]{$p_2$} -- ++(-0.5, 1)node[right]{$\xi_2$}; \draw[->] (p3)node[]{$\bullet$}node[above]{$p_3$} -- ++( 1, 0.5)node[right]{$\xi_3$}; \draw[->] (p4)node[]{$\bullet$}node[above]{$p_4$} -- ++( 0.5, 1)node[right]{$\xi_4$}; \end{tikzpicture} #+end_src #+RESULTS: [[file:figs/local_to_global_coordinates_modes.png]] If we note $\xi_i = \{ \xi_{i,x}\ \xi_{i,y}\ \xi_{i,z} \}^T$ the mode shape corresponding to the accelerometer $i$. From the figure above, we can write: \begin{align*} \xi_1 &= \xi + \Omega p_1\\ \xi_2 &= \xi + \Omega p_2\\ \xi_3 &= \xi + \Omega p_3\\ \xi_4 &= \xi + \Omega p_4 \end{align*} With \begin{equation} \Omega = \begin{bmatrix} 0 & -\Omega_z & \Omega_y \\ \Omega_z & 0 & -\Omega_x \\ -\Omega_y & \Omega_x & 0 \end{bmatrix} \end{equation} $\xi$ and $\Omega$ represent to mode shapes in translation and rotation of the solid expressed in the frame $\{O\}$. We can rearrange the equations in a matrix form, and then we obtain the mode shape of the solid in the wanted frame $\{O\}$: \begin{equation} \begin{bmatrix} \xi_x \\ \xi_y \\ \xi_z \\ \hline \Omega_x \\ \Omega_y \\ \Omega_z \end{bmatrix} = \left[\begin{array}{ccc|ccc} 1 & 0 & 0 & 0 & p_{1z} & -p_{1y} \\ 0 & 1 & 0 & -p_{1z} & 0 & p_{1x} \\ 0 & 0 & 1 & p_{1y} & -p_{1x} & 0 \\ \hline & \vdots & & & \vdots & \\ \hline 1 & 0 & 0 & 0 & p_{4z} & -p_{4y} \\ 0 & 1 & 0 & -p_{4z} & 0 & p_{4x} \\ 0 & 0 & 1 & p_{4y} & -p_{4x} & 0 \end{array}\right]^{-1} \begin{bmatrix} \xi_{1,x} \\ \xi_{1,y} \\ \xi_{1,z} \\\hline \vdots \\\hline \xi_{4,x} \\ \xi_{4,y} \\ \xi_{4,z} \end{bmatrix} \end{equation} This inversion is equivalent to a mean square problem. ** Matlab Implementation The obtained mode shapes matrix that gives the mode shapes of each solid bodies with respect to the fixed frame $\{O\}$, =mode_shapes_O=, is an $n \times p \times q$ with: - $n$ is the number of identified modes - $p$ is the number of DOFs for each solid body (6) - $q$ is the number of solid bodies #+begin_src matlab mode_shapes_O = zeros(mod_n, 6, length(solid_names)); for mod_i = 1:mod_n for solid_i = 1:length(solid_names) acc_i = solids.(solid_names{solid_i}); Y = mode_shapes(mod_i, :, acc_i); Y = Y(:); A = zeros(3*length(acc_i), 6); for i = 1:length(acc_i) A(3*(i-1)+1:3*i, 1:3) = eye(3); A(3*(i-1)+1:3*i, 4:6) = [ 0 acc_pos(i, 3) -acc_pos(i, 2) ; -acc_pos(i, 3) 0 acc_pos(i, 1) ; acc_pos(i, 2) -acc_pos(i, 1) 0]; end mode_shapes_O(mod_i, :, solid_i) = A\Y; end end #+end_src We then rearrange the eigen vectors in another way: \[ \Psi_O = \begin{bmatrix} & & \\ \{\psi_1\} & \dots & \{\psi_N\} \\ & & \end{bmatrix}_{M \times N} \] with \[ \{\psi\}_r = \begin{Bmatrix} \psi_{1, x} & \psi_{1, y} & \psi_{1, z} & \psi_{1, \theta_x} & \psi_{1, \theta_y} & \psi_{1, \theta_z} & \psi_{2, x} & \dots & \psi_{6, \theta_z} \end{Bmatrix}^T \] With $M = 6 \times n_\text{solid}$ is the new number of DOFs and $N$ is the number of modes. #+begin_src matlab eigen_vec_O = reshape(mode_shapes_O, [mod_n, 6*length(solid_names)]).'; eigen_vec_ext_O = [eigen_vec_O, conj(eigen_vec_O)]; #+end_src ** FRF matrix synthesis *** Mathematical description The synthesize FRF matrix =Hsyn_O= is an $n \times n \times q$ with: - $n$ is the number of DOFs of the considered 6 solid-bodies: $6 \times 6 = 36$ - $q$ is the number of frequency points $\omega_i$ For each frequency point $\omega_i$, the FRF matrix =Hsyn_O= is a $n\times n$ matrix: \begin{equation} \text{H}_{\text{syn, O}}(\omega_i) = \begin{bmatrix} \frac{D_{1,T_x}}{F_{1, T_x}}(\omega_i) & \frac{D_{1,T_x}}{F_{1, T_y}}(\omega_i) & \dots & \frac{D_{1,T_x}}{F_{6, R_z}}(\omega_i) \\ \frac{D_{1,T_y}}{F_{1, T_x}}(\omega_i) & \frac{D_{1,T_y}}{F_{1, T_y}}(\omega_i) & & \frac{D_{1,T_y}}{F_{6, R_z}}(\omega_i) \\ \frac{D_{1,T_z}}{F_{1, T_x}}(\omega_i) & \frac{D_{1,T_z}}{F_{1, T_y}}(\omega_i) & & \frac{D_{1,T_z}}{F_{6, R_z}}(\omega_i) \\ \frac{D_{1,R_x}}{F_{1, T_x}}(\omega_i) & \frac{D_{1,R_x}}{F_{1, T_y}}(\omega_i) & & \frac{D_{1,R_x}}{F_{6, R_z}}(\omega_i) \\ \frac{D_{1,R_y}}{F_{1, T_x}}(\omega_i) & \frac{D_{1,R_y}}{F_{1, T_y}}(\omega_i) & & \frac{D_{1,R_y}}{F_{6, R_z}}(\omega_i) \\ \frac{D_{1,R_z}}{F_{1, T_x}}(\omega_i) & \frac{D_{1,R_z}}{F_{1, T_y}}(\omega_i) & & \frac{D_{1,R_z}}{F_{6, R_z}}(\omega_i) \\ \frac{D_{2,T_x}}{F_{1, T_x}}(\omega_i) & \frac{D_{2,T_x}}{F_{1, T_y}}(\omega_i) & & \frac{D_{2,T_x}}{F_{6, R_z}}(\omega_i) \\ \vdots & \vdots & & \vdots \\ \frac{D_{6,R_z}}{F_{1, T_x}}(\omega_i) & \frac{D_{6,R_z}}{F_{1, T_y}}(\omega_i) & & \frac{D_{6,R_z}}{F_{6, R_z}}(\omega_i) \end{bmatrix} \end{equation} where $D_i$ corresponds to the solid body number i, $F_i$ is a force/torque applied on the solid body number i at the center of the frame $\{O\}$. #+begin_warning As the mode shapes are expressed with respect to the frame $\{O\}$, the obtain FRF matrix are the responses of the system from forces and torques applied to the solid bodies at the origin of $\{O\}$ to the displacement of the solid bodies with respect to the frame $\{O\}$. #+end_warning *** Matlab Implementation #+begin_src matlab Hsyn_O = zeros(36, 36, 801); for i = 1:length(freqs) Hsyn_O(:, :, i) = eigen_vec_ext_O*(inv(modal_a_ext_M)/(diag(j*2*pi*freqs(i) - diag(eigen_val_ext_M))))*eigen_vec_ext_O.'; end #+end_src Because the synthesize frequency response functions are representing the displacement response in $[m/N]$, we multiply each element of the FRF matrix by $(j \omega)^2$ in order to obtain the acceleration response in $[m/s^2/N]$. #+begin_src matlab for i = 1:size(Hsyn_O, 1) Hsyn_O(i, :, :) = -squeeze(Hsyn_O(i, :, :)).*(j*2*pi*freqs).^2; end #+end_src *** TODO Test to have the original inputs #+begin_src matlab Hsyn_O = zeros(36, 3, 801); for i = 1:length(freqs) Hsyn_O(:, :, i) = eigen_vec_ext_O*(inv(modal_a_ext_M)/(diag(j*2*pi*freqs(i) - diag(eigen_val_ext_M))))*eigen_vec_ext_M(10*3+1:11*3, :).'; end for i = 1:size(Hsyn_O, 1) Hsyn_O(i, :, :) = -squeeze(Hsyn_O(i, :, :)).*(j*2*pi*freqs).^2; end #+end_src ** TODO Verification #+begin_src matlab :exports none solid_o = 6; dir_o = 3; solid_i = 3; dir_i = 3; figure; ax1 = subplot(2, 1, 1); hold on; plot(freqs, abs(squeeze(FRFs_O((solid_o-1)*6+dir_o, dir_i, :))), 'DisplayName', 'Original'); plot(freqs, abs(squeeze(Hsyn_O((solid_o-1)*6+dir_o, dir_i, :))), 'DisplayName', 'Synthesize'); hold off; set(gca, 'xscale', 'log'); set(gca, 'yscale', 'log'); set(gca, 'XTickLabel',[]); ylabel('Magnitude [$\frac{m/s^2}{N}$]'); legend('location', 'northwest'); ax2 = subplot(2, 1, 2); hold on; plot(freqs, mod(180/pi*phase(squeeze(FRFs_O((solid_o-1)*6+dir_o, dir_i, :)))+180, 360)-180); plot(freqs, mod(180/pi*phase(squeeze(Hsyn_O((solid_o-1)*6+dir_o, dir_i, :)))+180, 360)-180); hold off; yticks(-360:90:360); set(gca, 'xscale', 'log'); xlabel('Frequency [Hz]'); ylabel('Phase [deg]'); linkaxes([ax1,ax2],'x'); xlim([1, 200]); #+end_src ** New FRFs #+begin_src matlab :exports none dof_names = {'X', 'Y', 'Z', '\theta_X', '\theta_Y', '\theta_Z'}; solid_i = 6; dirs = [1:3]; figure; ax1 = subplot(2, 1, 1); hold on; for dir_i = dirs plot(freqs, abs(squeeze(Hsyn_O((solid_i-1)*6+dir_i, (solid_i-1)*6+dir_i, :))), 'DisplayName', sprintf('Solid %s - %s', solid_names{solid_i}, dof_names{dir_i})); end hold off; set(gca, 'xscale', 'log'); set(gca, 'yscale', 'log'); set(gca, 'XTickLabel',[]); ylabel('Magnitude [$\frac{m/s^2}{N}$]'); legend('location', 'northwest'); ax2 = subplot(2, 1, 2); hold on; for dir_i = dirs plot(freqs, mod(180/pi*phase(squeeze(Hsyn_O((solid_i-1)*6+dir_i, (solid_i-1)*6+dir_i, :)))+180, 360)-180); end hold off; yticks(-360:90:360); set(gca, 'xscale', 'log'); xlabel('Frequency [Hz]'); ylabel('Phase [deg]'); linkaxes([ax1,ax2],'x'); xlim([1, 200]); #+end_src * Some notes about constraining the number of degrees of freedom We want to have the two eigen matrices. They should have the same size $n \times n$ where $n$ is the number of mode_shapes as well as the number of degrees of freedom. Thus, if we consider $N$ modes, we should restrict our system to have only $N$ DOFs. Actually, we are measured 6 DOFs of 6 solids, thus we have 36 DOFs. From the mode shapes animations, it seems that in the frequency range of interest, the two marbles can be considered as one solid. We thus have 5 solids and 30 DOFs. In order to determine which DOF can be neglected, two solutions seems possible: - compare the mode shapes - compare the FRFs The question is: in which base (frame) should be express the modes shapes and FRFs? Is it meaningful to compare mode shapes as they give no information about the amplitudes of vibration? | Stage | Motion DOFs | Parasitic DOF | Total DOF | Description of DOF | |---------+-------------+---------------+-----------+--------------------| | Granite | 0 | 3 | 3 | | | Ty | 1 | 2 | 3 | Ty, Rz | | Ry | 1 | 2 | 3 | Ry, | | Rz | 1 | 2 | 3 | Rz, Rx, Ry | | Hexapod | 6 | 0 | 6 | Txyz, Rxyz | |---------+-------------+---------------+-----------+--------------------| | | 9 | 9 | 18 | | #+TBLFM: $4=vsum($2..$3) #+TBLFM: @>$2..$>=vsum(@I..@II) * Compare Mode Shapes Let's say we want to see for the first mode which DOFs can be neglected. In order to do so, we should estimate the motion of each stage in particular directions. If we look at the z motion for instance, we will find that we cannot neglect that motion (because of the tilt causing z motion). #+begin_src matlab mode_i = 3; dof_i = 6; mode = eigen_vector_M(dof_i:6:end, mode_i); figure; hold on; for i=1:length(mode) plot([0, real(mode(i))], [0, imag(mode(i))], '-', 'DisplayName', solid_names{i}); end hold off; legend(); #+end_src #+begin_src matlab figure; subplot(2, 1, 1); hold on; for i=1:length(mode) plot(1, norm(mode(i)), 'o'); end hold off; ylabel('Amplitude'); subplot(2, 1, 2); hold on; for i=1:length(mode) plot(1, 180/pi*angle(mode(i)), 'o', 'DisplayName', solid_names{i}); end hold off; ylim([-180, 180]); yticks([-180:90:180]); ylabel('Phase [deg]'); legend(); #+end_src #+begin_src matlab test = mode_shapes_O(10, 1, :)/norm(squeeze(mode_shapes_O(10, 1, :))); test = mode_shapes_O(10, 2, :)/norm(squeeze(mode_shapes_O(10, 2, :))); #+end_src * TODO Mode shapes expressed in a frame at the CoM of the solid bodies #+begin_warning Maybe the mass-normalized eigen vectors can only be obtained for undamped systems (real eigen values and vectors). #+end_warning ** Modes shapes transformation First, we load the position of the Center of Mass of each solid body with respect to the point of interest. #+begin_src matlab model_com = table2array(readtable('mat/model_solidworks_com.txt', 'ReadVariableNames', false)); #+end_src Then, we reshape the data. #+begin_src matlab model_com = reshape(model_com , [3, 6]); #+end_src Now we convert the mode shapes expressed in the DOF of the accelerometers to the DoF of each solid body (translations and rotations) with respect to their own CoM. #+begin_src matlab mode_shapes_CoM = zeros(mod_n, 6, length(solid_names)); for mod_i = 1:mod_n for solid_i = 1:length(solid_names) acc_i = solids.(solid_names{solid_i}); Y = mode_shapes(mod_i, :, acc_i); Y = Y(:); A = zeros(3*length(acc_i), 6); for i = 1:length(acc_i) acc_pos_com = acc_pos(i, :).' - model_com(:, i); A(3*(i-1)+1:3*i, 1:3) = eye(3); A(3*(i-1)+1:3*i, 4:6) = [ 0 acc_pos_com(3) -acc_pos_com(2) ; -acc_pos_com(3) 0 acc_pos_com(1) ; acc_pos_com(2) -acc_pos_com(1) 0]; end mode_shapes_CoM(mod_i, :, solid_i) = A\Y; end end #+end_src We then rearrange the eigen vectors in another way: \[ \Psi_{\text{CoM}} = \begin{bmatrix} & & \\ \{\psi_1\} & \dots & \{\psi_N\} \\ & & \end{bmatrix}_{M \times N} \] with \[ \{\psi\}_r = \begin{Bmatrix} \psi_{1, x} & \psi_{1, y} & \psi_{1, z} & \psi_{1, \theta_x} & \psi_{1, \theta_y} & \psi_{1, \theta_z} & \psi_{2, x} & \dots & \psi_{6, \theta_z} \end{Bmatrix}^T \] With $M = 6 \times n_\text{solids}$ is the new number of DOFs and $N$ is the number of modes. Each eigen vector is normalized. #+begin_src matlab eigen_vec_CoM = reshape(mode_shapes_CoM, [mod_n, 6*length(solid_names)]).'; % eigen_vec_CoM = eigen_vec_CoM./vecnorm(eigen_vec_CoM); eigen_vec_ext_CoM = [eigen_vec_CoM, conj(eigen_vec_CoM)]; #+end_src ** Mass matrix from solidworks model #+begin_src bash :results none sed '/Mass = /!d' mat/1_granite_bot.txt | sed 's/^\s*\t*Mass = //' | sed 's/\([0-9.]*\) kilograms\r/\1/' > mat/model_solidworks_mass.txt sed '/Mass = /!d' mat/2_granite_top.txt | sed 's/^\s*\t*Mass = //' | sed 's/\([0-9.]*\) kilograms\r/\1/' >> mat/model_solidworks_mass.txt sed '/Mass = /!d' mat/3_ty.txt | sed 's/^\s*\t*Mass = //' | sed 's/\([0-9.]*\) kilograms\r/\1/' >> mat/model_solidworks_mass.txt sed '/Mass = /!d' mat/4_ry.txt | sed 's/^\s*\t*Mass = //' | sed 's/\([0-9.]*\) kilograms\r/\1/' >> mat/model_solidworks_mass.txt sed '/Mass = /!d' mat/5_rz.txt | sed 's/^\s*\t*Mass = //' | sed 's/\([0-9.]*\) kilograms\r/\1/' >> mat/model_solidworks_mass.txt sed '/Mass = /!d' mat/6_hexa.txt | sed 's/^\s*\t*Mass = //' | sed 's/\([0-9.]*\) kilograms\r/\1/' >> mat/model_solidworks_mass.txt #+end_src #+begin_src bash :results none sed '/I[xyz][xyz]/!d' mat/1_granite_bot.txt | sed 's/^\s*\t*//' | sed 's/I[xyz][xyz] = //g' | sed $'s/\r//' > mat/model_solidworks_inertia.txt sed '/I[xyz][xyz]/!d' mat/2_granite_top.txt | sed 's/^\s*\t*//' | sed 's/I[xyz][xyz] = //g' | sed $'s/\r//' >> mat/model_solidworks_inertia.txt sed '/I[xyz][xyz]/!d' mat/3_ty.txt | sed 's/^\s*\t*//' | sed 's/I[xyz][xyz] = //g' | sed $'s/\r//' >> mat/model_solidworks_inertia.txt sed '/I[xyz][xyz]/!d' mat/4_ry.txt | sed 's/^\s*\t*//' | sed 's/I[xyz][xyz] = //g' | sed $'s/\r//' >> mat/model_solidworks_inertia.txt sed '/I[xyz][xyz]/!d' mat/5_rz.txt | sed 's/^\s*\t*//' | sed 's/I[xyz][xyz] = //g' | sed $'s/\r//' >> mat/model_solidworks_inertia.txt sed '/I[xyz][xyz]/!d' mat/6_hexa.txt | sed 's/^\s*\t*//' | sed 's/I[xyz][xyz] = //g' | sed $'s/\r//' >> mat/model_solidworks_inertia.txt #+end_src #+begin_src matlab model_mass = table2array(readtable('mat/model_solidworks_mass.txt', 'ReadVariableNames', false)); model_inertia = table2array(readtable('mat/model_solidworks_inertia.txt', 'ReadVariableNames', false)); #+end_src \[ M = \begin{bmatrix} M_1 & & & & & \\ & M_2 & & & & \\ & & M_3 & & & \\ & & & M_4 & & \\ & & & & M_5 & \\ & & & & & M_6 \\ \end{bmatrix}, \text{ with } M_i = \begin{bmatrix} m_i & & & & & \\ & m_i & & & & \\ & & m_i & & & \\ & & & I_{i,xx} & I_{i,yx} & I_{i,zx} \\ & & & I_{i,xy} & I_{i,yy} & I_{i,zy} \\ & & & I_{i,xz} & I_{i,yz} & I_{i,zz} \\ \end{bmatrix} \] #+begin_src matlab M = zeros(6*6, 6*6); for i = 1:6 M((i-1)*6+1:i*6, (i-1)*6+1:i*6) = blkdiag(model_mass(i)*eye(3), model_inertia((i-1)*3+1:i*3, 1:3)); end #+end_src ** Mass-normalized Eigen Vectors To do so, it seems that we need to know the mass matrix $[M]$. Then: \[ \{\phi\}_r = \frac{1}{\sqrt{m_r}} \{\psi\}_r \text{ where } m_r = \{\psi\}_r^T [M] \{\psi\}_r \] Mass-normalized eigen vectors are very important for the synthesis and spatial model extraction. Mass Matrix could be estimated from the SolidWorks model. We compute the modal masses that will be used for normalization. #+begin_src matlab mr = zeros(size(eigen_vector_matrix_CoM, 2), 1); for i = 1:length(mr) mr(i) = real(eigen_vector_matrix_CoM(:, i).' * M * eigen_vector_matrix_CoM(:, i)); end #+end_src #+begin_src matlab figure; plot(freqs_m, mr, 'ko'); xlabel('Mode Frequency [Hz]'); ylabel('Modal mass [kg]'); #+end_src #+HEADER: :tangle no :exports results :results none :noweb yes #+begin_src matlab :var filepath="figs/modal_mass.pdf" :var figsize="full-normal" :post pdf2svg(file=*this*, ext="png") <> #+end_src #+NAME: fig:modal_mass #+CAPTION: Modal masses [[file:figs/modal_mass.png]] And finally, we compute the mass-normalized eigen vectors. #+begin_src matlab eigen_vector_mass_CoM = zeros(size(eigen_vector_matrix_CoM)); for i = 1:size(eigen_vector_matrix_CoM, 2) eigen_vector_mass_CoM(:, i) = 1/sqrt(mr(i)) * eigen_vector_matrix_CoM(:, i); end #+end_src Verification that \[ [\Phi]^T [M] [\Phi] = [I] \] #+begin_src matlab eigen_vector_matrix_CoM.'*M*eigen_vector_matrix_CoM #+end_src #+begin_src matlab eigen_vector_mass_CoM*M*eigen_vector_mass_CoM.' #+end_src Other test for normalized eigen vectors #+begin_src matlab eigen_vector_mass_CoM = (eigen_vector_matrix_CoM.'*diag(diag(M))*eigen_vector_matrix_CoM)^(-0.5) * eigen_vector_matrix_CoM'; eigen_vector_mass_CoM = eigen_vector_mass_CoM.'; #+end_src ** Full Response Model from modal model (synthesis) In general, the form of response model with which we are concerned is an *FRF matrix* whose order is dictated by the number of coordinates $n$ included in the test. Also, as explained, it is normal in practice to measured and to analyze just a *subset of the FRF matrix* but rather to measure the full FRF matrix. Usually *one column* or *one row* with a few additional elements are measured. Thus, if we are to construct an acceptable response model, it will be necessary to synthesize those elements which have not been directly measured. However, in principle, this need present no major problem as it is possible to compute the full FRF matrix from a modal model using: \begin{equation} [H]_{n\times n} = [\Phi]_{n\times m} [\lambda_r^2 - \omega^2]_{m\times m}^{-1} [\Phi]_{m\times n}^T \end{equation} $\{\Phi\}$ is a *mass-normalized* eigen vector. #+begin_src matlab FRF_matrix_CoM = zeros(size(eigen_vector_mass_CoM, 1), size(eigen_vector_mass_CoM, 1), length(freqs)); for i = 1:length(freqs) FRF_matrix_CoM(:, :, i) = eigen_vector_mass_CoM*inv(eigen_value_M^2 - (2*pi*freqs(i)*eye(size(eigen_value_M, 1)))^2)*eigen_vector_mass_CoM.'; end #+end_src #+begin_src matlab exc_dir = 3; meas_mass = 6; meas_dir = 3; figure; hold on; plot(freqs, abs(squeeze(FRF_matrix_CoM((meas_mass-1)*6 + meas_dir, 6*2+exc_dir, :)))); plot(freqs, abs(squeeze(FRFs_CoM((meas_mass-1)*6 + meas_dir, exc_dir, :)))); hold off; set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); xlabel('Frequency [Hz]'); ylabel('Amplitude'); xlim([1, 200]); #+end_src #+begin_src matlab FRF_matrix = zeros(size(eigen_vector_mass, 1), size(eigen_vector_mass, 1), length(freqs)); for i = 1:length(freqs) FRF_matrix(:, :, i) = eigen_vector_mass*inv(eigen_value_M - (freqs(i)*eye(size(eigen_value_M, 1)))^2)*eigen_vector_mass.'; end #+end_src #+begin_src matlab figure; hold on; plot(freqs, abs(squeeze(FRFs_O(1, 1, :)))); plot(freqs, abs(squeeze(FRF_matrix(1, 1, :)))); hold off; set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); xlabel('Frequency [Hz]'); ylabel('Amplitude'); xlim([1, 200]); #+end_src * TODO Residues * Bibliography :ignore: bibliographystyle:unsrt bibliography:ref.bib