-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathcode_SA_Utilities.m
46 lines (36 loc) · 1.7 KB
/
code_SA_Utilities.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
% --------------------------------------------------------------------------
% Reinforcement Learning for Valve Control. V.5.4: 11-Mar. 11pm
% Author: Rajesh Siraskar
% e-mail: [email protected]; [email protected]
% University: Coventry University, UK, MTech Automotive Engineering
%
% Code: Visualization plot for Stability Analysis
% -------------------------------------------------------------------------
warning ('off','all');
display ("Transfer Function data loaded");
load('data\data_SA_TransferFunctions.mat');
figure(1);
step(TF_ClosedLoop_TD); title ('Closed Loop: Step Response');
saveas(gcf, 'results/Closed_Loop_Step_Response.png');
figure(2);
bode(TF_OpenLoop_TD); title ('Open Loop: Bode plot');
saveas(gcf, 'results/Open_Loop_Bode_Plot.png');
figure(3);
margin(TF_OpenLoop_TD);
saveas(gcf, 'results/Open_Loop_Stability_Margin_Plot.png');
figure(4);
pzmap(TF_OpenLoop_TD); title ('Open Loop: Pole-Zero map');
saveas(gcf, 'results/Open_Loop_Pole_Zero_Map.png');
figure(5);
nyquist(TF_OpenLoop_TD); title ('Open Loop: Nyquist plot');
saveas(gcf, 'results/Open_Loop_Nyquist_Plot.png');
figure(6);
margin(TF_ClosedLoop_TD);
saveas(gcf, 'results/Closed_Loop_Stability_Margin_Plot.png');
display ("Open Loop and Closed Loop Stability Analysis plots saved in Results folder");
% figure(1); step(TF_ClosedLoop_TD); title ('Closed Loop: Step Response');
% figure(2); bode(TF_OpenLoop_TD); title ('Open Loop: Bode plot');
% figure(3); margin(TF_OpenLoop_TD);
% figure(4); pzmap(TF_OpenLoop_TD); title ('Open Loop: Pole-Zero map');
% figure(5); nyquist(TF_OpenLoop_TD); title ('Open Loop: Nyquist plot');
% figure(6); margin(TF_ClosedLoop_TD);