Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
bpoolla committed Jul 4, 2018
0 parents commit 353c5f2
Show file tree
Hide file tree
Showing 13 changed files with 1,094 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
Binary file added Australian14gen_following_inertia.slx
Binary file not shown.
Binary file added Australian14gen_forming_inertia.slx
Binary file not shown.
Binary file added Australian14gen_original.slx
Binary file not shown.
Binary file added Library.slx
Binary file not shown.
33 changes: 33 additions & 0 deletions ReadMe.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

This repository contains the SIMULINK models and MATLAB codes used as a benchmark system in the paper:
B.K.Poolla, D. Groß, and F. Dörfler, "Placement and Implementation of Grid-Forming and Grid-Following Virtual Inertia"

dataaustralian14gen.m generates the underlying data, load model, for the grid-following and grid-forming Virtual Inertia (VI) implementations.
Australian14gen_original.slx contains the low-inertia model without any VI devices.
Library.slx contains the custom models for the VI devices in the different implementations.

Australian14gen_following_inertia.slx contains the low-inertia model of the South-East Australian grid along with grid-following VI devices.
main_following.m contains the relevant code for the non-linear simulation of the grid-following VI implementation.

Australian14gen_forming_inertia.slx contains the low-inertia model of the South-East Australian grid along with grid-forming VI devices.
main_forming.m contains the relevant code for the non-linear simulation of the grid-following VI implementation.

The scripts 'main_following.m' and 'main_forming.m' call the following functions:
linearizesystem.m generates the linearized system models (A,B,C,D,G matrices) for analysis in either implementation.
modelreduction.m removes the zero eigenvalue due to the system Laplacian.
tdsim.m simulates the linearized models for the VI implementations.
plotvi.m generates the relevant time-domain plots for the metrics of interest.


The models are based original SIMULINK model available at https://ch.mathworks.com/matlabcentral/fileexchange/51177-australian-simplified-14-generators-ieee-benchmark

% This source code is distributed in the hope that it will be useful, but without any warranty.
% We do request that publications in which this testbed is adopted, explicitly acknowledge that fact by citing the above mentioned paper.








333 changes: 333 additions & 0 deletions dataaustralian14gen.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,333 @@
PSSMODEL=1;
%bus p(MW) q (MVar)
load_case4=[...
102 270 30
205 235 25
206 80 10
207 1130 120
208 125 15
211 1060 110
212 1000 110
215 290 30
216 1105 120
217 750 80
306 900 90
307 470 50
308 620 100
309 140 15
312 92 10
313 1625 165
314 180 20
405 730 75
406 540 55
407 0 0
408 110 10
409 190 20
410 390 40
411 420 45
412 922 100
504 180 20
507 640 65
508 490 50
509 122 15];
load_case4(20,2)=1;
load_mag=load_case4;

%bus MW(each unit) KV H Xa Xd Xq Xd' Tdo' Xd" Tdo" Xq' Tqo' Xq" Tqo" r
%1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
G_data=[...
101 333.3 15 3.6 0.14 1.1 0.65 0.25 8.5 0.25 0.05 0 0 0.25 0.2 0
201 666.7 20 3.2 0.2 1.8 1.75 0.3 8.5 0.21 0.04 0.7 2 0.21 0.25 0
202 555.6 20 2.8 0.17 2.2 2.1 0.3 4.5 0.2 0.04 0.5 1.5 0.21 0.06 0
203 555.6 20 2.6 0.2 2.3 1.7 0.3 5 0.25 0.03 0.4 2 0.25 0.25 0
204 666.7 20 3.2 0.2 1.8 1.75 0.3 8.5 0.21 0.04 0.7 2 0.21 0.25 0
301 666.7 20 2.8 0.2 2.7 1.5 0.3 7.5 0.25 0.04 0.85 0.85 0.25 0.12 0
302 444.4 20 3.5 0.15 2 1.8 0.25 7.5 0.2 0.04 0 0 0.2 0.25 0
401 444.4 20 2.6 0.2 2.3 1.7 0.3 5 0.25 0.03 0.4 2 0.25 0.25 0
402 333.3 20 3 0.2 1.9 1.8 0.3 6.5 0.26 0.035 0.55 1.4 0.26 0.04 0
403 444.4 20 2.6 0.2 2.3 1.7 0.3 5 0.25 0.03 0.4 2 0.25 0.25 0
404 333.3 20 4 0.18 2.2 1.4 0.32 9 0.24 0.04 0.75 1.4 0.24 0.13 0
501 333.3 20 3.5 0.15 2.2 1.7 0.3 7.5 0.24 0.025 0.8 1.5 0.24 0.1 0
502 250 15 4 0.2 2 1.5 0.3 7.5 0.22 0.04 0.8 3 0.22 0.2 0
503 166.7 15 7.5 0.15 2.3 2 0.25 5 0.17 0.022 0.35 1 0.17 0.035 0];
G_data(1,13)=1;
G_data(7,13)=1;
active_gen_case4=[2 4 3 3 4 6 2 3 2 3 3 2 3 1];
G_data(:,2)=G_data(:,2).*active_gen_case4';

gentestcase=[2:8,11,12,14];
genrem=setdiff(1:14,gentestcase);
Hinv=1/2*diag(G_data(gentestcase,4))^-1;


% 1 2 3 4 5 6 7 8 9 10 11 12
% bus Tr KA TA TB TC KE TE KF TF TB1(s) TC1(s)
Exc=[...
101 0 200 0.1 13.25 2.5 0 0 0 0 0 0
%201 0 300 0.01 0.7 0.35 0 0 0 0 0 0
201 0 400 0.02 1.12 0.5 0 0 0 0 0 0
202 0 400 0.02 0 0 1 1 0.029 1 0 0
203 0 300 0.01 0.7 0.35 0 0 0 0 0 0
%204 0 300 0.01 0.7 0.35 0 0 0 0 0 0
204 0 400 0.02 1.12 0.5 0 0 0 0 0 0
301 0 400 0.05 6.42 1.14 0 0 0 0 0 0
302 0 200 0.05 0 0 1 1.333 0.02 0.8 0 0
401 0 300 0.1 40 4 0 0 0 0 0 0
402 0.02 300 0.05 9.8 1.52 0 0 0 0 0 0
403 0 300 0.01 0.7 0.35 0 0 0 0 0 0
404 0 250 0.2 0.0232 0.136 0 0 0 0 0 0
501 0 1000 0.04 0 0 1 0.87 0.004 0.27 0 0
502 0 400 0.5 16 1.4 0 0 0 0 0.05 0.6
503 0 300 0.01 0.8 0.2 0 0 0 0 0 0
];
Exc(:,2)=0.02;
Exc(13,9)=.001;
Exc(13,10)=1;
% bus rating pg (MW) Heavy load case


% bus MVA(per unit) p(per unit) q(per unit) active units
p_case4=[...
101 333.3 .001 -97.4 2
201 666.7 540 -30.8 4
202 555.6 460 -2.5 3
203 555.6 470 9.4 3
204 666.7 399.3 -43.6 4
301 666.7 555 16.6 6
302 444.4 380 -9.3 2
401 444.4 320 -21.9 3
402 333.3 290 -2.4 2
403 444.4 320 14.2 3
404 333.3 217 -3.5 3
501 333.3 280 -52.5 2
502 250 180 -1.8 3
503 166.7 150 2.2 1];
p=p_case4;
p(:,3)=p(:,3).*p(:,5);
p(:,4)=p(:,4).*p(:,5);
pref=p(:,3)./(p(:,2).*p(:,5));

bus_v=[...
101 15
102 330
201 20
202 20
203 20
204 20
205 330
206 330
207 330
208 330
209 330
210 500
211 330
212 330
213 500
214 330
215 330
216 330
217 330
301 20
302 20
303 500
304 500
305 500
306 500
307 500
308 500
309 330
310 330
311 330
312 220
313 220
314 220
315 275
401 20
402 20
403 20
404 20
405 275
406 275
407 275
408 275
409 275
410 275
411 275
412 275
413 275
414 330
415 330
416 330
501 20
502 15
503 15
504 275
505 275
506 275
507 275
508 275
509 275];
% No from To v1(kv) v2(kv) rating x%(on rating) total number of units
%1 2 3 4 5 6 7 8
trans=[...
1 101 102 15 330 333.3 12 12
2 201 206 20 330 666.7 16 6
3 202 209 20 330 555.6 16 5
4 203 208 20 330 555.6 17 4
5 204 215 20 330 666.7 16 6
6 209 210 330 500 625 17 4
7 213 214 500 330 625 17 4
8 301 303 20 500 666.7 16 8
9 302 312 20 220 444.4 15 4
10 304 313 500 220 500 16 2
11 305 311 500 330 500 12 2
12 305 314 500 220 700 17 2
13 308 315 500 275 370 10 2
14 401 410 20 275 444.4 15 4
15 402 408 20 275 333.3 17 3
16 403 407 20 275 444.4 15 4
17 404 405 20 275 333.3 17 6
18 413 414 275 330 750 6 3
19 501 504 20 275 333.3 17 2
20 502 505 15 275 166.7 16 4
21 503 506 15 275 250 16.7 6];
active_trans_case4=[2,4,3,3,4,4,4,6,2,2,2,2,2,3,2,3,3,3,2,3,1];

trans(:,6)=trans(:,6).*active_trans_case4';
trans(:,7)=trans(:,7)/100;

%from to r X b(pu) v(kv) No
line=[...
102 217 0.0084 0.0667 0.817 330 1
102 217 0.0078 0.062 0.76 330 2
102 309 0.0045 0.0356 0.437 330 3
102 309 0.0109 0.0868 0.76 330 4
205 206 0.0096 0.076 0.931 330 5
205 416 0.0037 0.046 0.73 330 6
206 207 0.0045 0.0356 0.437 330 7
206 212 0.0066 0.0527 0.646 330 8
206 215 0.0066 0.0527 0.646 330 9
207 208 0.0018 0.014 0.171 330 10
207 209 0.0008 0.0062 0.076 330 11
208 211 0.0031 0.0248 0.304 330 12
209 212 0.0045 0.0356 0.437 330 13
210 213 0.001 0.0145 1.54 500 14
211 212 0.0014 0.0108 0.133 330 15
211 214 0.0019 0.0155 0.19 330 16
212 217 0.007 0.0558 0.684 330 17
214 216 0.001 0.0077 0.095 330 18
214 217 0.0049 0.0388 0.475 330 19
215 216 0.0051 0.0403 0.494 330 20
215 217 0.0072 0.0574 0.703 330 21
216 217 0.0051 0.0403 0.494 330 22
303 304 0.001 0.014 1.48 500 23
303 305 0.0011 0.016 1.7 500 24
304 305 0.0003 0.004 0.424 500 25
305 306 0.0002 0.003 0.32 500 26
305 307 0.0003 0.0045 0.447 500 27
306 307 0.0001 0.0012 0.127 500 28
307 308 0.0023 0.0325 3.445 500 29
309 310 0.009 0.0713 0.874 330 30
310 311 0 -0.0337 0 330 31
312 313 0.002 0.015 0.9 220 32
313 314 0.0005 0.005 0.52 220 33
315 509 0.007 0.05 0.19 275 34
405 406 0.0039 0.0475 0.381 275 35
405 408 0.0054 0.05 0.189 275 36
405 409 0.018 0.122 0.79 275 37
406 407 0.0006 0.0076 0.062 275 38
407 408 0.0042 0.0513 0.412 275 39
408 410 0.011 0.128 1.01 275 40
409 411 0.0103 0.0709 0.46 275 41
410 411 0.0043 0.0532 0.427 275 42
410 412 0.0043 0.0532 0.427 275 43
410 413 0.004 0.0494 0.4 275 44
411 412 0.0012 0.0152 0.122 275 45
414 415 0.002 0.025 0.39 330 46
415 416 0.0037 0.046 0.73 330 47
504 507 0.023 0.15 0.56 275 48
504 508 0.026 0.019 0.87 275 49
505 507 0.0008 0.0085 0.06 275 50
505 508 0.0025 0.028 0.17 275 51
506 507 0.0008 0.0085 0.06 275 52
506 508 0.003 0.028 0.14 275 53
507 508 0.002 0.019 0.09 275 54
507 509 0.03 0.22 0.9 275 55
];
zbase=(line(:,6).^2)/100;
line(:,3)=line(:,3).*zbase;
line(:,4)=line(:,4).*zbase/(2*pi*50);
line(:,5)=line(:,5)./zbase/(2*pi*50);

% No bus QL Qc
comp=[...
1 211 0 0
2 212 0 400
3 216 0 300
4 409 0 60
5 411 0 30
6 414 30 0
7 415 60 0
8 416 60 0
9 504 0 0
];
SVC=[...
1 205 1.045 -39.3
2 313 1.015 86.7
3 412 1 -52.2
4 507 1.01 -4
5 509 1.03 -109.3];

PSSMODEL=1;
G=1; FL=.1; KL=10; FI=1; KI=10; FH=13; KH=120;
Tr=.001;
Ka=200; Ta=.001;
Ke=1; Te=0;
Tb=0; Tc=0;
Kf=0; Tf=0;
Efmin=-5; Efmax=5;

alpha(1:15)=0*1e11*ones(15,1);
alpha(16:30)=0*1e8*ones(15,1);
nred=90;

%PLL parameters
% Kp=.01; %original 180
% Ki=.007; %original 3200
PLL_Ki=2;
PLL_Kp=500;
visat=40*1e6;% original 100 MW
Isel=eye(2*15);
Isel_forming=eye(3*15);

thetavsc0(1)=6.6166;
thetavsc0(2)=21.2703;
thetavsc0(3)=15.5222;
thetavsc0(4)=28.8703;
thetavsc0(5)=14.0249;
thetavsc0(6)=-6.3379;
thetavsc0(7)=4.7928;
thetavsc0(8)=3.6837;
thetavsc0(9)=-1.0986;
thetavsc0(10)=23.5812;
thetavsc0(11)=10.5944;
thetavsc0(12)=2.8249;
thetavsc0(13)=-12.7055;
thetavsc0(14)=-12.4459;
thetavsc0(15)=-14.7643;

Kvsc(1,:)=1*ones(1,15);
Kvsc(2,:)=1*ones(1,15);
Kvsc=0*Kvsc;

dist.inp=zeros(6,1);
dist.sc=ones(6,1);
dist.time=50;


r_fil=5e-1*ones(15,1); % 5e-1
l_fil=5e-3*ones(15,1); % 5e-3
c_fil=1e-5*ones(15,1); % 1e-5

% Grid forming
Pinit=[0.405553120017514,0.262363656270440,0.245287066765904,0.511573619715646,0.238910511748616,0.266289198874107,0.405451933295266,0.301363467877759,0.299904641553078,0.238601214125575,0.201576196829353,0.166515071179716,0.281316548159335,0.249279775700722,0.436119451429005];
Loading

0 comments on commit 353c5f2

Please sign in to comment.