17 lines
450 B
Matlab
17 lines
450 B
Matlab
function Mat_G=FormG(Volt,PD,QD,Loadi,bigM,mVolt,rVolt,sigma,Vbi,PDbi,QDbi,mPD,mQD)
|
|
|
|
Mat_G=[
|
|
sparse(PD(Loadi))-mPD(Loadi)-bigM*PDbi-0.1;
|
|
sparse(PD(Loadi))-mPD(Loadi)+bigM*PDbi+0.1;
|
|
sparse(QD(Loadi))-mQD(Loadi)-bigM*QDbi-0.1;
|
|
sparse(QD(Loadi))-mQD(Loadi)+bigM*QDbi+0.1;
|
|
Volt'-mVolt'-bigM*Vbi-0.03;
|
|
Volt'-mVolt'+bigM*Vbi+0.03;
|
|
Vbi;
|
|
PDbi;
|
|
QDbi;
|
|
(1-Vbi).*Vbi;
|
|
% (1-PDbi).*PDbi;
|
|
% (1-QDbi).*QDbi;
|
|
];
|
|
end |