%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Graficazione simulazioni
% Modello motore elettrico DC base
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

lw=1.5;

figure(1)
clf
h=plot (t,Cr,'b');
set(h,'linewidth',lw)
hold on
h=plot (t,Cm,'r');
set(h,'linewidth',lw)
title ('Coppia motrice (r) e Coppia di carico (b)')
xlabel ('Tempo [s]')
ylabel ('[Nm]')
grid on
zoom on

figure(2)
clf
h=plot (t,Vcem,'b');
set(h,'linewidth',lw)
hold on
h=plot (t,Vi,'r');
set(h,'linewidth',lw)
title ('Tensione di ingresso (r) e tensione Vcem (b)')
xlabel ('Tempo [s]')
ylabel ('[V]')
grid on
zoom on

figure(3)
clf
plot (t,Wme/rpm,'g')
title ('Velocità albero motore')
xlabel ('Tempo [s]')
ylabel ('[rpm]')
grid on
zoom on

figure(4)
clf
subplot(211)
plot (t,Vi,'g')
title ('Tensione (g) e Corrente motore (r)')
ylabel ('[V]')
grid on
subplot(212)
plot (t,Ime,'r')
ylabel ('[A]')
xlabel ('Tempo [s]')
grid on
zoom on

figure(5)
clf
h=plot (t,Vi.*Ime,'g');
set(h,'linewidth',lw)
hold on
h=plot (t,Cr.*Wme,'r');
set(h,'linewidth',lw)
title ('Potenza elettrica (g) e potenza sul carico (r)')
xlabel ('Tempo [s]')
ylabel ('[W]')
grid on
zoom on

