Commit 1c553e5f authored by ruzhu's avatar ruzhu
Browse files

Upload New File

parent a86a1889
$ontext
Rujie
Starts 2021.01.26
$offtext
$Set matout "'DEMS_outputs.gdx',Pdis,Pcha,SoC,obj,Dcost,Pw";
$GDXIN DEMS_inputs.gdx
Set
t /1*25/;
Parameter
PBMax /30/
PBMin /-30/
EBESS /150/
chaeffi /0.95/
diseffi /0.95/
SoCini /0.5/
Cinv /113000/
alpha /5.75e-2/
beta /121/
kdelta1 /1.4e5/
kdelta2 /-5.01e-1/
kdelta3 /-1.23e5/
ksigma /1.04/
sigmaref /0.5/
kT /6.93e-2/
Tref /25/
kti /4.14e-10/
PwMax /100/
Pgrid /100/
Pw_hat
Sptprc_hat
Emax
ad
;
$LOAD Pw_hat Sptprc_hat Emax ad
$GDXIN
scalars
disfactor /0.7/
deltat /1/
kp /0.85/;
Binary variables
z;
Variables
PH
Pdis
Pcha
SoC
E
L
dhalf
Neq
obj
Dcost
Pw
;
Equations
ObjF
PBal
SoCevo
SoClimit
* SoClimit2
PBlimit1
PBlimit2
Pwlimit
Energylimit1
Energylimit2
Cost
* Deglimit
;
* ObjF.. obj=e=sum(t$(ord(t)<25),Sptprc(t)*PH(t));
ObjF.. obj=e=sum(t$(ord(t)<25),Sptprc_hat(t)*PH(t))-Dcost;
PBal(t)$(ord(t)<25) .. PH(t)=e=Pw(t)+Pdis(t)-Pcha(t);
SoCevo(t)$(ord(t)<25) .. SoC(t+1)=e=SoC(t)*0.95+Pcha(t)*chaeffi*deltat/Emax-Pdis(t)/diseffi*deltat/Emax;
* SoClimit1(t)$(ord(t)=1) .. SoC(t)=e=SoCini;
SoClimit(t)$(ord(t)=1 or ord(t)=25) .. SoC(t)=e=SoCini;
* PBlimit1(t)$(ord(t)<25) .. Pdis(t)=e=max(PB(t),0);
* PBlimit2(t)$(ord(t)<25) .. Pcha(t)=e=max(-PB(t),0);
PBlimit1(t)$(ord(t)<25) .. Pdis(t)=l=z(t)*PBMax;
PBlimit2(t)$(ord(t)<25) .. Pcha(t)=l=(1-z(t))*PBMax;
Pwlimit(t)$(ord(t)<25) .. Pw(t)=l=Pw_hat(t);
Energylimit1(t)$(ord(t)<25).. Pdis(t)*deltat=l=Emax*SoC(t);
Energylimit2(t)$(ord(t)<25).. Pcha(t)*deltat=l=Emax*(1-SoC(t));
Cost .. Dcost=e=Cinv*(ad*(sum(t,(Pdis(t)+Pcha(t))*deltat)))*EBESS;
* Deglimit .. ad*sum(t,(Pdis(t)+Pcha(t))*deltat)=l=dlimit;
* Pdis.up(t)=PBMax;
Pdis.lo(t)=0;
* Pcha.up(t)=PBMax;
Pcha.lo(t)=0;
SoC.up(t)=1;
SoC.lo(t)=0.2;
* PH.lo(t)=0;
Pw.lo(t)=0;
PH.lo(t)=-Pgrid;
PH.up(t)=Pgrid;
*options dnlp=cplex
*options minlp=knitro
model DEMS /all/;
solve DEMS using mip maximizing obj;
*solve MLD using minlp minimizing obj;
Execute_Unload %matout%;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment