-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathplotCase39e.m
107 lines (89 loc) · 2.68 KB
/
plotCase39e.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
%% e plots
eyMax=max(max([LqrOpf.eVec-repmat(LqrOpf.eS,1,length(t)),...
ALqrOpf.eVec-repmat(ALqrOpf.eS,1,length(t)), Opf.eVec-repmat(Opf.eS,1,length(t))]));
eyMin=min(min([LqrOpf.eVec-repmat(LqrOpf.eS,1,length(t)),...
ALqrOpf.eVec-repmat(ALqrOpf.eS,1,length(t)), Opf.eVec-repmat(Opf.eS,1,length(t))]));
eyOffSet=0.01;
x0=0;
y0=1;
width=8;
height=5;
Figure2=figure('Units','inches',...
'Position',[x0 y0 width height],...
'PaperPositionMode','auto');
set(Figure2, 'Name', 'GenEMF');
plot(t,LqrOpf.eVec-repmat(LqrOpf.eS,1,length(t)),'lineWidth',2);
FigHandle=gca;
set(FigHandle,'box','on');
set(FigHandle,'fontSize',20);
set(FigHandle,'defaulttextinterpreter','latex');
FigHandle.TickLabelInterpreter='latex';
ytickformat(FigHandle,'%.2f');
xlabel('Time (sec)', 'FontWeight','bold');
ylabel('$\mathbf{e}-\mathbf{e}^{\mathrm{eq}}$ (pu)');
axis(FigHandle,[0 TFinal eyMin-eyOffSet eyMax+eyOffSet]);
grid on;
title('Generator EMF dev.');
if exist('Figures')~=7
mkdir('Figures');
end
cd('Figures');
print -dpdf Case39_LQROPF_alphapoint6_LQR_e.pdf
print -depsc2 Case39_LQROPF_alphapoint6_LQR_e
cd('..');
%% ALQR-OPF
x0=0;
y0=1;
width=8;
height=5;
Figure2=figure('Units','inches',...
'Position',[x0 y0 width height],...
'PaperPositionMode','auto');
set(Figure2, 'Name', 'GenEMF');
plot(t,ALqrOpf.eVec-repmat(ALqrOpf.eS,1,length(t)),'lineWidth',2);
FigHandle=gca;
set(FigHandle,'box','on');
set(FigHandle,'fontSize',20);
set(FigHandle,'defaulttextinterpreter','latex');
FigHandle.TickLabelInterpreter='latex';
ytickformat(FigHandle,'%.2f');
xlabel('Time (sec)', 'FontWeight','bold');
ylabel('$\mathbf{e}-\mathbf{e}^{\mathrm{eq}}$ (pu)');
axis(FigHandle,[0 TFinal eyMin-eyOffSet eyMax+eyOffSet]);
grid on;
title('Generator EMF dev.');
if exist('Figures')~=7
mkdir('Figures');
end
cd('Figures');
print -dpdf Case39_ALQROPF_alphapoint6_LQR_e.pdf
print -depsc2 Case39_ALQROPF_alphapoint6_LQR_e
cd('..');
%% OPF
x0=0;
y0=1;
width=8;
height=5;
Figure2=figure('Units','inches',...
'Position',[x0 y0 width height],...
'PaperPositionMode','auto');
set(Figure2, 'Name', 'GenEMF');
plot(t,Opf.eVec-repmat(Opf.eS,1,length(t)),'lineWidth',2);
FigHandle=gca;
set(FigHandle,'box','on');
set(FigHandle,'fontSize',20);
set(FigHandle,'defaulttextinterpreter','latex');
FigHandle.TickLabelInterpreter='latex';
ytickformat(FigHandle,'%.2f');
xlabel('Time (sec)', 'FontWeight','bold');
ylabel('$\mathbf{e}-\mathbf{e}^{\mathrm{eq}}$ (pu)');
axis(FigHandle,[0 TFinal eyMin-eyOffSet eyMax+eyOffSet]);
grid on;
title('Generator EMF dev.');
if exist('Figures')~=7
mkdir('Figures');
end
cd('Figures');
print -dpdf Case39_OPF_alphapoint6_LQR_e.pdf
print -depsc2 Case39_OPF_alphapoint6_LQR_e
cd('..');