Compare analytical model and simscape model

This commit is contained in:
Thomas Dehaeze 2020-05-25 10:25:13 +02:00
parent bcda23acf7
commit 5a157db8a1
4 changed files with 2914 additions and 0 deletions

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 KiB

Binary file not shown.

View File

@ -200,6 +200,98 @@ exportFig('figs/amplified_piezo_root_locus.pdf', 'width', 'wide', 'height', 'tal
#+RESULTS:
[[file:figs/amplified_piezo_root_locus.png]]
** Analytical Results
If we apply the Newton's second law of motion on the top mass, we obtain:
\[ ms^2 x_1 = F + k_1 (w - x_1) + k_e (x_e - x_1) \]
Then, we can write that the measured force $F_s$ is equal to:
\[ F_s = k_a(w - x_e) + f = -k_e (x_1 - x_e) \]
which gives:
\[ x_e = \frac{k_a}{k_e + k_a} w + \frac{1}{k_e + k_a} f + \frac{k_e}{k_e + k_a} x_1 \]
Re-injecting that into the previous equations gives:
\[ x_1 = F \frac{1}{ms^2 + k_1 + \frac{k_e k_a}{k_e + k_a}} + w \frac{k_1 + \frac{k_e k_a}{k_e + k_a}}{ms^2 + k_1 + \frac{k_e k_a}{k_e + k_a}} + f \frac{\frac{k_e}{k_e + k_a}}{ms^2 + k_1 + \frac{k_e k_a}{k_e + k_a}} \]
\[ F_s = - F \frac{\frac{k_e k_a}{k_e + k_a}}{ms^2 + k_1 + \frac{k_e k_a}{k_e + k_a}} + w \frac{k_e k_a}{k_e + k_a} \Big( \frac{ms^2}{ms^2 + k_1 + \frac{k_e k_a}{k_e + k_a}} \Big) - f \frac{k_e}{k_e + k_a} \Big( \frac{ms^2 + k_1}{ms^2 + k_1 + \frac{k_e k_a}{k_e + k_a}} \Big) \]
#+begin_src matlab
Ga = 1/(m*s^2 + k1 + ke*ka/(ke + ka)) * ...
[ 1 , k1 + ke*ka/(ke + ka) , ke/(ke + ka) ;
-ke*ka/(ke + ka), ke*ka/(ke + ka)*m*s^2 , -ke/(ke+ka)*(m*s^2 + k1)];
Ga.InputName = {'F', 'w', 'f'};
Ga.OutputName = {'x1', 'Fs'};
#+end_src
#+begin_src matlab :exports none
freqs = logspace(1, 4, 1000);
figure;
ax1 = subplot(2, 3, 1);
title('$\displaystyle \frac{x_1}{w}$')
hold on;
plot(freqs, abs(squeeze(freqresp(G('x1', 'w'), freqs, 'Hz'))));
plot(freqs, abs(squeeze(freqresp(Ga('x1', 'w'), freqs, 'Hz'))), 'k--');
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [m/m]');xlabel('Frequency [Hz]');
ax2 = subplot(2, 3, 2);
title('$\displaystyle \frac{x_1}{f}$')
hold on;
plot(freqs, abs(squeeze(freqresp(G('x1', 'f'), freqs, 'Hz'))));
plot(freqs, abs(squeeze(freqresp(Ga('x1', 'f'), freqs, 'Hz'))), 'k--');
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [m/N]');xlabel('Frequency [Hz]');
ax3 = subplot(2, 3, 3);
title('$\displaystyle \frac{x_1}{F}$')
hold on;
plot(freqs, abs(squeeze(freqresp(G('x1', 'F'), freqs, 'Hz'))));
plot(freqs, abs(squeeze(freqresp(Ga('x1', 'F'), freqs, 'Hz'))), 'k--');
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [m/N]');xlabel('Frequency [Hz]');
ax4 = subplot(2, 3, 4);
title('$\displaystyle \frac{F_s}{w}$')
hold on;
plot(freqs, abs(squeeze(freqresp(G('Fs', 'w'), freqs, 'Hz'))));
plot(freqs, abs(squeeze(freqresp(Ga('Fs', 'w'), freqs, 'Hz'))), 'k--');
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [m/m]');xlabel('Frequency [Hz]');
ax5 = subplot(2, 3, 5);
title('$\displaystyle \frac{F_s}{f}$')
hold on;
plot(freqs, abs(squeeze(freqresp(G('Fs', 'f'), freqs, 'Hz'))));
plot(freqs, abs(squeeze(freqresp(Ga('Fs', 'f'), freqs, 'Hz'))), 'k--');
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [m/N]');xlabel('Frequency [Hz]');
ax6 = subplot(2, 3, 6);
title('$\displaystyle \frac{F_s}{F}$')
hold on;
plot(freqs, abs(squeeze(freqresp(G('Fs', 'F'), freqs, 'Hz'))));
plot(freqs, abs(squeeze(freqresp(Ga('Fs', 'F'), freqs, 'Hz'))), 'k--');
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [m/N]'); xlabel('Frequency [Hz]');
linkaxes([ax1,ax2,ax3,ax4,ax5,ax6],'x');
#+end_src
#+begin_src matlab :tangle no :exports results :results file replace
exportFig('figs/comp_simscape_analytical.pdf', 'width', 'full', 'height', 'full');
#+end_src
#+name: fig:comp_simscape_analytical
#+caption: Comparison of the Identified Simscape Dynamics (solid) and the Analytical Model (dashed)
#+RESULTS:
[[file:figs/comp_simscape_analytical.png]]
* Rotating X-Y platform
** Matlab Init :noexport:ignore:
#+begin_src matlab :tangle no :exports none :results silent :noweb yes :var current_dir=(file-name-directory buffer-file-name)