Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %===========================================%
- %Power Electronics in Distribution Networks %
- %Coursework Task 2 Constrains %
- %===========================================%
- function [g,h]=nonlcon(x)
- 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;
- %The system do not have inequality constrains
- g=[];
- %equality constrains
- h=[V1*x(1)*(G12*cos(x(4))+B12*sin(x(4)))+x(1)*x(1)*G22+x(1)*x(2)*(G23*cos(x(4)-x(5))+B23*sin(x(4)-x(5)))+x(3)*x(1)*(G24*cos(x(4)-x(6))+B24*sin(x(4)-x(6)))-PG+V1*x(3)*(G14*cos(x(6))+B14*sin(x(6)))+x(1)*x(3)*(G24*cos(x(6)-x(4))+B24*sin(x(6)-x(4)))+x(3)*x(2)*(G34*cos(x(6)-x(5))+B34*sin(x(6)-x(5)))+x(3)*x(3)*G44;
- V1*x(2)*(G13*cos(x(5))+B13*sin(x(5)))+x(1)*x(2)*(G23*cos(x(5)-x(4))+B23*sin(x(5)-x(4)))+x(2)*x(2)*G33+x(3)*x(2)*(G34*cos(x(5)-x(6))+B34*sin(x(5)-x(6)));
- V1*x(1)*(G12*sin(x(4))-B12*cos(x(4)))-x(1)*x(1)*B22+x(1)*x(2)*(G23*sin(x(4)-x(5))-B23*cos(x(4)-x(5)))+x(1)*x(3)*(G24*sin(x(4)-x(6))-B24*cos(x(4)-x(6)))+QSOP;
- V1*x(2)*(G13*sin(x(5))-B13*cos(x(5)))+x(1)*x(2)*(G23*sin(x(5)-x(4))-B23*cos(x(5)-x(4)))-x(2)*x(2)*B33+x(2)*x(3)*(G34*sin(x(5)-x(6))-B34*cos(x(5)-x(6)));
- V1*x(3)*(G14*sin(x(6))-B14*cos(x(6)))+x(1)*x(3)*(G24*sin(x(6)-x(4))-B24*cos(x(6)-x(4)))+x(2)*x(3)*(G34*sin(x(6)-x(5))-B34*cos(x(6)-x(5)))-x(3)*x(3)*B44+QSOP4;];
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement