-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathplotCase39v.m
134 lines (95 loc) · 2.65 KB
/
plotCase39v.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
%% mech plots
MyMax=max(max([LqrOpf.vVec,ALqrOpf.vVec,...
Opf.vVec]));
MyMin=min(min([LqrOpf.vVec,ALqrOpf.vVec,...
Opf.vVec]));
MyOffSet=0.02;
x0=0;
y0=1;
width=8;
height=5;
Figure4=figure('Units','inches',...
'Position',[x0 y0 width height],...
'PaperPositionMode','auto');
set(Figure4, 'Name', 'LQR-OPF:v');
plot(t,(LqrOpf.vVec).','lineWidth',2);
FigHandle=gca;
set(FigHandle,'box','on');
set(FigHandle,'fontSize',20);
set(FigHandle,'defaulttextinterpreter','latex');
ytickformat(FigHandle,'%.2f');
grid on;
xlabel('Time (sec)', 'FontWeight','bold');
ylabel('$\mathbf{v}-\mathbf{v}^\mathrm{eq}$ (pu)');
title('Nodal voltages');
FigHandle.TickLabelInterpreter='latex';
axis(FigHandle,[0 TFinal MyMin-MyOffSet MyMax+MyOffSet]);
set(FigHandle,'YTick',floor(MyMin):0.05:ceil(MyMax));
grid on;
if exist('Figures')~=7
mkdir('Figures');
end
cd('Figures');
print -dpdf Case39_LQROPF_alphapoint6_LQR_v.pdf
print -depsc2 Case39_LQROPF_alphapoint6_LQR_v
cd('..');
%% ALQR-OPF
x0=0;
y0=1;
width=8;
height=5;
Figure4=figure('Units','inches',...
'Position',[x0 y0 width height],...
'PaperPositionMode','auto');
set(Figure4, 'Name', 'LQR-OPF:f');
plot(t,(ALqrOpf.vVec).','lineWidth',2);
FigHandle=gca;
set(FigHandle,'box','on');
set(FigHandle,'fontSize',20);
set(FigHandle,'defaulttextinterpreter','latex');
ytickformat(FigHandle,'%.2f');
grid on;
xlabel('Time (sec)', 'FontWeight','bold');
ylabel('$\mathbf{v}-\mathbf{v}^\mathrm{eq}$ (pu)');
title('Nodal voltages');
FigHandle.TickLabelInterpreter='latex';
axis(FigHandle,[0 TFinal MyMin-MyOffSet MyMax+MyOffSet]);
set(FigHandle,'YTick',floor(MyMin):0.05:ceil(MyMax));
grid on;
if exist('Figures')~=7
mkdir('Figures');
end
cd('Figures');
print -dpdf Case39_ALQROPF_alphapoint6_LQR_v.pdf
print -depsc2 Case39_ALQROPF_alphapoint6_LQR_v
cd('..');
%% mech plots
x0=0;
y0=1;
width=8;
height=5;
Figure4=figure('Units','inches',...
'Position',[x0 y0 width height],...
'PaperPositionMode','auto');
set(Figure4, 'Name', 'LQR-OPF:v');
plot(t,(Opf.vVec).','lineWidth',2);
FigHandle=gca;
set(FigHandle,'box','on');
set(FigHandle,'fontSize',20);
set(FigHandle,'defaulttextinterpreter','latex');
ytickformat(FigHandle,'%.2f');
grid on;
xlabel('Time (sec)', 'FontWeight','bold');
ylabel('$\mathbf{v}-\mathbf{v}^\mathrm{eq}$ (pu)');
title('Nodal voltages');
FigHandle.TickLabelInterpreter='latex';
axis(FigHandle,[0 TFinal MyMin-MyOffSet MyMax+MyOffSet]);
set(FigHandle,'YTick',floor(MyMin):0.05:ceil(MyMax));
grid on;
if exist('Figures')~=7
mkdir('Figures');
end
cd('Figures');
print -dpdf Case39_OPF_alphapoint6_LQR_v.pdf
print -depsc2 Case39_OPF_alphapoint6_LQR_v
cd('..');