Does anyone share with me GAMS Linear AC Optimal Power Flow code ?
Hi; I think this book might come in handy:
Power system Optimization Modeling in GAMS by Alireza Soroudi.
Some of the chapters are available to download, anyway you can find the book in Amazon for $127.20 (Kindle version).
Don't know if the following code will be useful but you igth find exaactly what you are looking for in the book.
Best regards.
GAMS CODE
$ONTEXT
DC-OPF GAMS code for three-bus network.
$OFFTEXT
Sets
bus /1*3/
slack(bus) /3/
Gen /g1*g3/;
Scalars
Sbase /100/;
Alias (bus,node);
Table GenData(Gen ,*) Generating units characteristics
b pmin pmax
g1 10 0 65
g2 11 0 100;
Set
GBconect(bus, Gen) connectivity index of each generating unit to each bus
/ 1 . g1
3 . g2/;
Table BusData(bus ,*) Demands of each bus in MW
Pd
2 100;
Set conex Bus connectivity matrix
/
1 . 2
2 . 3
1 . 3/;
conex(bus,node)$(conex(node,bus))=1;
Table branch (bus, node,*) Network technical characteristics
x Limit
1 . 2 0.2 100
2 . 3 0.25 100
1 . 3 0.4 100;
branch(bus, node, 'x')$(branch(bus, node, 'x')=0)=branch(node, bus, 'x');
branch(bus, node, 'Limit')$(branch(bus, node, 'Limit')=0)=branch(node, bus, 'Limit');
branch(bus, node, 'bij')$conex(bus, node)=1/branch(bus, node, 'x');
Variables
OF
Pij(bus, node)
Pg(Gen)
delta(bus);
Equations const1 , const2 , const3;
const1(bus, node)$conex(bus, node).. Pij(bus, node) =E=
branch(bus, node, 'bij')*(delta(bus)-
delta(node));
const2(bus).. +sum(Gen$GBconect(bus, Gen), Pg(Gen))-BusData(bus ,'pd')/Sbase =E=
+sum(node$conex(node, bus), Pij(bus, node));
const3.. OF =G= sum(Gen, Pg(Gen)*GenData(Gen, 'b')*Sbase);
Model loadflow /const1, const2, const3/;
Pg.lo(Gen)=GenData(Gen, 'Pmin')/Sbase;
Pg.up(Gen)=GenData(Gen, 'Pmax')/Sbase;
delta.up(bus)=pi;
delta.lo(bus)=-pi;
delta.fx(slack)=0;
Pij.up(bus, node)$((conex(bus, node)))=1*branch(bus, node, 'Limit')/Sbase;
Pij.lo(bus, node)$((conex(bus, node)))=-1*branch(bus, node, 'Limit')/Sbase;
Solve loadflow minimizing OF using lp;
Parameter report(bus,*), Congestioncost;
report(bus, 'Gen(MW)')= sum(Gen$GBconect(bus, Gen), Pg.l(Gen))*sbase;
report(bus, 'Angle')= delta.l(bus);
report(bus, 'load (MW)')= BusData(bus, 'pd');
report(bus, 'LMP($/MWh)')=const2.m(bus)/sbase;
Congestioncost= sum((bus, node), Pij.l(bus, node)*(-const2.m(bus)+
const2.m(node)))/2;
Display report, Pij.l, Congestioncost;
I need to model an anisotropic material in which the Poisson's ratio ν_12 ≠ ν_21 and so on. Therefore, the elastic compliance matrix wouldn't be a symmetric one. In ANSYS APDL, for TB,ANEL...
09 August 2024 5,048 2 View
Request Python code from this article : Gender equity of authorship in pulmonary medicine over the past decade. THANKS!
08 August 2024 6,242 2 View
The stability of the Solar System is a complex subject that blends the classical framework of Newtonian mechanics with the modern insights provided by General Relativity (GR). Understanding this...
07 August 2024 2,569 1 View
My name is Apurva Saoji. I am a Ph.D scholar in Computer engineering in India. I am looking for international expert in reviewing my PhD thesis, "Competitive Optimization Techniques to Minimize...
07 August 2024 4,600 2 View
Visual Studio Code (VS Code) has become a popular choice among developers for several reasons: 1. **Free and Open Source**: VS Code is free to use and open source, making it accessible to...
07 August 2024 7,013 4 View
I need the python code to forecast what crop production will be in the next decade considering climate and crop production variables as seen in the attached.csv file.
05 August 2024 2,977 3 View
I´ve been unable to find specific information about this neurotrophin in the CNS of rabbits exclusively. There is extensive info in mice, fish and rats, but in brain´s rabbit is hard to find....
04 August 2024 762 1 View
Hi I am working on data driven model of the microgrid, for that, i need the reliable datasets for the identification of MG data driven Model. Thanks
02 August 2024 5,748 4 View
I am using a windows system, what software I should use for hydration shell analysis with molecular dynamics?
02 August 2024 3,143 4 View
Samuel Morse, the inventor of the Morse Code, understood that certain letters in the English language occurred more frequently than others (Gallistel and King 2010). To deal with this, Morse used...
01 August 2024 4,456 2 View