-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathplotCase39delta.m
110 lines (92 loc) · 3.07 KB
/
plotCase39delta.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
%% delta plots
DeltayMax=max(max(radians2degrees([LqrOpf.deltaVec-repmat(LqrOpf.deltaS,1,length(t)),...
ALqrOpf.deltaVec-repmat(ALqrOpf.deltaS,1,length(t)), Opf.deltaVec-repmat(Opf.deltaS,1,length(t))])));
DeltayMin=min(min(radians2degrees([LqrOpf.deltaVec-repmat(LqrOpf.deltaS,1,length(t)),...
ALqrOpf.deltaVec-repmat(ALqrOpf.deltaS,1,length(t)), Opf.deltaVec-repmat(Opf.deltaS,1,length(t))])));
DeltayOffSet=0.01;
x0=0;
y0=1;
width=8;
height=5;
Figure2=figure('Units','inches',...
'Position',[x0 y0 width height],...
'PaperPositionMode','auto');
set(Figure2, 'Name', 'GenAngle');
plot(t,radians2degrees(LqrOpf.deltaVec)-radians2degrees(repmat(LqrOpf.deltaS,1,length(t))),'lineWidth',2);
xlabel('Time (sec)', 'FontWeight','bold');
ylabel('$\mathbf{\delta}-\mathbf{\delta}^{\mathrm{eq}}$ (deg)');
FigHandle=gca;
set(FigHandle,'box','on');
set(FigHandle,'fontSize',20);
set(FigHandle,'defaulttextinterpreter','latex');
FigHandle.TickLabelInterpreter='latex';
ytickformat(FigHandle,'%.2f');
axis([0 TFinal DeltayMin-DeltayOffSet DeltayMax+DeltayOffSet]);
grid on;
title('Generator angle dev.');
if exist('Figures')~=7
mkdir('Figures');
end
cd('Figures');
print -dpdf Case39_LQROPF_alphapoint6_LQR_delta.pdf
print -depsc2 Case39_LQROPF_alphapoint6_LQR_delta
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', 'GenAngle');
plot(t,radians2degrees(ALqrOpf.deltaVec)-radians2degrees(repmat(ALqrOpf.deltaS,1,length(t))),'lineWidth',2);
xlabel('Time (sec)', 'FontWeight','bold');
ylabel('$\boldmath{\delta}-\boldmath{\delta}^{\mathrm{eq}}$ (deg)');
FigHandle=gca;
set(FigHandle,'box','on');
set(FigHandle,'fontSize',20);
set(FigHandle,'defaulttextinterpreter','latex');
FigHandle.TickLabelInterpreter='latex';
ytickformat(FigHandle,'%.2f');
axis([0 TFinal DeltayMin-DeltayOffSet DeltayMax+DeltayOffSet]);
grid on;
title('Generator angle dev.');
if exist('Figures')~=7
mkdir('Figures');
end
cd('Figures');
print -dpdf Case39_ALQROPF_alphapoint6_LQR_delta.pdf
print -depsc2 Case39_ALQROPF_alphapoint6_LQR_delta
cd('..');
%% OPF
x0=0;
y0=1;
width=8;
height=5;
Figure2=figure('Units','inches',...
'Position',[x0 y0 width height],...
'PaperPositionMode','auto');
set(Figure2, 'Name', 'GenAngle');
plot(t,radians2degrees(Opf.deltaVec)-radians2degrees(repmat(Opf.deltaS,1,length(t))),'lineWidth',2);
xlabel('Time (sec)', 'FontWeight','bold');
ylabel('$\boldmath{\delta}-\boldmath{\delta}^{\mathrm{eq}}$ (deg)');
FigHandle=gca;
set(FigHandle,'box','on');
set(FigHandle,'fontSize',20);
set(FigHandle,'defaulttextinterpreter','latex');
FigHandle.TickLabelInterpreter='latex';
ytickformat(FigHandle,'%.2f');
axis([0 TFinal DeltayMin-DeltayOffSet DeltayMax+DeltayOffSet]);
set(gca,'box','on');
set(gca,'fontSize',22);
set(0,'defaulttextinterpreter','latex')
grid on;
title('Generator angle dev.');
if exist('Figures')~=7
mkdir('Figures');
end
cd('Figures');
print -dpdf Case39_OPF_alphapoint6_LQR_delta.pdf
print -depsc2 Case39_OPF_alphapoint6_LQR_delta
cd('..');