EnergyInnovation / eps-us

Energy Policy Simulator - United States
GNU General Public License v3.0
22 stars 7 forks source link

Electricity logit dispatch function working incorrectly with certain EDLE values #220

Closed mkmahajan closed 2 years ago

mkmahajan commented 2 years ago

While calibrating South Korea, we found a case where a logit exponent (elec/EDLE) value more negative than -4 caused the model to dispatch 0 electricity through least-cost and instead leave much of the electricity demand unmet. @robbieorvis realized that because Vensim only carries 6 significant figures, a value of -4 is causing the individual calculations to be less than 1e-6, which Vensim rounds to 0. A simple fix fix for now could be to use a multiplier such as 1000 to make sure calculated values are recognized by Vensim, but we may want to come up with something more permanent (although I know we are likely overhauling the dispatch calculations in the future).

jrissman commented 2 years ago

Yeah, Robbie raised the idea of going back to ALLOCATE AVAILABLE for electricity dispatch, which would avoid this issue. But if the rounding error can be avoided simply by multiplying by 1000, then going through the logit function, then dividing by 1000, we could easily have the EPS do that internally to work around the floating point accuracy limitation in Vensim. So maybe we will do that in 3.3.2 if we don't revert to ALLOCATE AVAILABLE in 3.3.2.

jrissman commented 2 years ago

Completed