Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %===========================================%
- %Power Electronics in Distribution Networks %
- %Coursework Task 2 Optimisation %
- %===========================================%
- clear
- clc
- %Define all variables as global variables
- global V1;
- global G12;global B12;
- global G13;global B13;
- global G14;global B14;
- global G22;global B22;
- global G23;global B23;
- global G33;global B33;
- global G24;global B24;
- global G34;global B34;
- global G44;global B44;
- global PG;global PSOP;
- global QSOP;global QSOP4;
- % System Parameters
- V1=1.01;
- ZL12=0.05+1i*0.01;
- ZL13=0.04;
- ZL34=0.01;
- Zload3=2.21;
- Zload4=2.08+1i*0.52;
- PG=0.6;
- PSOP=0;
- QSOP=0;
- QSOP4=0;
- % Y matrix
- YL12=1/ZL12;
- YL13=1/ZL13;
- YL34=1/ZL34;
- Yload3=1/Zload3;
- Yload4=1/Zload4;
- Y=[YL12+YL13,-YL12,-YL13,0;-YL12,YL12,0,0; -YL13,0,YL13+YL34+Yload3,-YL34; 0,0,-YL34,YL34+Yload4];
- G12=real(Y(1,2));
- B12=imag(Y(1,2));
- G13=real(Y(1,3));
- B13=imag(Y(1,3));
- G14=real(Y(1,4));
- B14=imag(Y(1,4));
- G22=real(Y(2,2));
- B22=imag(Y(2,2));
- G23=real(Y(2,3));
- B23=imag(Y(2,3));
- G24=real(Y(2,4));
- B24=imag(Y(2,4));
- G33=real(Y(3,3));
- B33=imag(Y(3,3));
- G34=real(Y(3,4));
- B34=imag(Y(3,4));
- G44=real(Y(4,4));
- B44=imag(Y(4,4));
- % Solution of Min Opt
- x=fmincon('Psop',[1.01;1.01;1.01;0;0;0],[],[],[],[],[0.98;0.98;0.98;-5;-5;-5],[1.02;1.02;1.02;5;5;5],'nonlcon')
- %Dispaly Result
- Psop(x)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement