H= 1..24; s.t. ElectBattery{h in H}: ES[h]-ES[h-1]-P2S[h]*Efi['ESt']+PGEN['ESt',h]==0;
error: ES[0] out of domain
One way:
ES[h]
0..24
1..24
ES[0]
ES[0]=10
If you want a steady-state solution, use:
ES[0] = ES[24]
Instead of this, you can also use an if-then-else construct like:
ES[h] - (if h=1 then ES[24] else ES[h-1]) - ..
One way:
ES[h]is defined over0..24(instead of1..24)ES[0]to a known value by adding a constraintES[0]=10(say).If you want a steady-state solution, use:
ES[0] = ES[24]Instead of this, you can also use an if-then-else construct like: