Add some simscape plots

This commit is contained in:
Thomas Dehaeze 2019-01-21 23:44:33 +01:00
parent 3025c68a29
commit 909b4de60a
20 changed files with 47 additions and 9 deletions

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 148 KiB

After

Width:  |  Height:  |  Size: 162 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 199 KiB

After

Width:  |  Height:  |  Size: 211 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 259 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 251 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 245 KiB

Binary file not shown.

View File

@ -310,17 +310,18 @@ We plot on the same graph $\frac{|-m \omega^2 + (k - m {\omega_0}^2)|}{|2 m \ome
#+HEADER: :exports none :results silent
#+begin_src matlab
f = logspace(-1, 2, 1000);
f = logspace(-1, 3, 1000);
figure;
hold on;
plot(f, abs(-mlight*(2*pi*f).^2 + kvc - mlight * wlight^2)./abs(2*mlight*wlight*2*pi*f), 'DisplayName', 'Voice Coil')
plot(f, abs(-mlight*(2*pi*f).^2 + kpz - mlight * wlight^2)./abs(2*mlight*wlight*2*pi*f), 'DisplayName', 'Piezo')
plot(f, ones(1, length(f)), 'k--', 'HandleVisibility', 'off')
hold off;
xlim([f(1), f(end)]);
set(gca, 'xscale', 'log'); set(gca, 'yscale', 'log');
xlabel('Frequency [Hz]');
legend('Location', 'northeast');
hold off;
#+end_src
#+HEADER: :tangle no :exports results :results file :noweb yes
@ -336,17 +337,16 @@ We plot on the same graph $\frac{|-m \omega^2 + (k - m {\omega_0}^2)|}{|2 m \ome
#+HEADER: :exports none :results silent
#+begin_src matlab
f = logspace(-1, 2, 1000);
figure;
hold on;
plot(f, abs(-mheavy*(2*pi*f).^2 + kvc - mheavy * wheavy^2)./abs(2*mheavy*wheavy*2*pi*f), 'DisplayName', 'Voice Coil')
plot(f, abs(-mheavy*(2*pi*f).^2 + kpz - mheavy * wheavy^2)./abs(2*mheavy*wheavy*2*pi*f), 'DisplayName', 'Piezo')
plot(f, ones(1, length(f)), 'k--', 'HandleVisibility', 'off')
hold off;
xlim([f(1), f(end)]);
set(gca, 'xscale', 'log'); set(gca, 'yscale', 'log');
xlabel('Frequency [Hz]');
legend('Location', 'northeast');
hold off;
#+end_src
#+HEADER: :tangle no :exports results :results file :noweb yes
@ -498,6 +498,15 @@ We start we identify the transfer functions at high speed with the light sample.
bode(Gpz_light, Gvc_light);
#+end_src
#+HEADER: :tangle no :exports results :results file :noweb yes
#+HEADER: :var filepath="Figures/coupling_simscape_light.png" :var figsize="wide-tall"
#+begin_src matlab
<<plt-matlab>>
#+end_src
#+RESULTS:
[[file:Figures/coupling_simscape_light.png]]
And then with the heavy sample.
#+begin_src matlab :exports code :results silent
rot_speed = wheavy;
@ -523,33 +532,62 @@ And then with the heavy sample.
bode(Gpz_heavy, Gvc_heavy);
#+end_src
#+HEADER: :tangle no :exports results :results file :noweb yes
#+HEADER: :var filepath="Figures/coupling_simscape_heavy.png" :var figsize="wide-tall"
#+begin_src matlab
<<plt-matlab>>
#+end_src
#+RESULTS:
[[file:Figures/coupling_simscape_heavy.png]]
Plot the ratio between the main transfer function and the coupling term:
#+begin_src matlab :results silent :exports none
freqs = logspace(-2, 3, 1000);
figure;
hold on;
plot(freqs, abs(squeeze(freqresp(Gvc_light('Du', 'Fu'), freqs, 'Hz'))))./abs(squeeze(freqresp(Gvc_light('Dv', 'Fu'), freqs, 'Hz')));
plot(freqs, abs(squeeze(freqresp(Gpz_light('Du', 'Fu'), freqs, 'Hz'))))./abs(squeeze(freqresp(Gpz_light('Dv', 'Fu'), freqs, 'Hz')));
plot(freqs, abs(squeeze(freqresp(Gvc_light('Du', 'Fu'), freqs, 'Hz')))./abs(squeeze(freqresp(Gvc_light('Dv', 'Fu'), freqs, 'Hz'))));
plot(freqs, abs(squeeze(freqresp(Gpz_light('Du', 'Fu'), freqs, 'Hz')))./abs(squeeze(freqresp(Gpz_light('Dv', 'Fu'), freqs, 'Hz'))));
hold off;
xlim([freqs(1), freqs(end)]);
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
xlabel('Frequency [Hz]'); ylabel('Coupling ratio');
legend({'Voice Coil', 'Piezoelectric'})
#+end_src
#+HEADER: :tangle no :exports results :results file :noweb yes
#+HEADER: :var filepath="Figures/coupling_ration_simscape_light.png" :var figsize="wide-tall"
#+begin_src matlab
<<plt-matlab>>
#+end_src
#+RESULTS:
[[file:Figures/coupling_ration_simscape_light.png]]
#+begin_src matlab :results silent :exports none
freqs = logspace(-2, 3, 1000);
figure;
hold on;
plot(freqs, abs(squeeze(freqresp(Gvc_heavy('Du', 'Fu'), freqs, 'Hz'))))./abs(squeeze(freqresp(Gvc_heavy('Dv', 'Fu'), freqs, 'Hz')));
plot(freqs, abs(squeeze(freqresp(Gpz_heavy('Du', 'Fu'), freqs, 'Hz'))))./abs(squeeze(freqresp(Gpz_heavy('Dv', 'Fu'), freqs, 'Hz')));
plot(freqs, abs(squeeze(freqresp(Gvc_heavy('Du', 'Fu'), freqs, 'Hz')))./abs(squeeze(freqresp(Gvc_heavy('Dv', 'Fu'), freqs, 'Hz'))));
plot(freqs, abs(squeeze(freqresp(Gpz_heavy('Du', 'Fu'), freqs, 'Hz')))./abs(squeeze(freqresp(Gpz_heavy('Dv', 'Fu'), freqs, 'Hz'))));
hold off;
xlim([freqs(1), freqs(end)]);
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
xlabel('Frequency [Hz]'); ylabel('Coupling ratio');
legend({'Voice Coil', 'Piezoelectric'})
#+end_src
#+HEADER: :tangle no :exports results :results file :noweb yes
#+HEADER: :var filepath="Figures/coupling_ration_simscape_heavy.png" :var figsize="wide-tall"
#+begin_src matlab
<<plt-matlab>>
#+end_src
#+RESULTS:
[[file:Figures/coupling_ration_simscape_heavy.png]]
*** Low rotation speed and High rotation speed
#+begin_src matlab :exports code :results silent
rot_speed = 2*pi/60; angle_e = 0;