EnergyInnovation / eps-us

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

Verify and Address Errors in Fuel Subsidy Policy #253

Closed jrissman closed 11 months ago

jrissman commented 1 year ago

The EPS policy lever Additional Fuel Tax or Subsidy Rate by Fuel can be set to a positive value to impose taxes on specific types of fuels or a negative value to apply subsidies to specific types of fuels. It was originally designed as a fuel tax lever and the use of negative values to represent subsidies was added later.

This policy may produce runtime errors if the lever is set to a negative value at the time the model is run using the "Simulate" button. (No error appears when already in SyntheSim mode and a scenario containing negative values is loaded). This should be tested by hard-coding negative values for the policy and clicking the "Simulate" button, and by using the "Sim Setup" control to load a .cin file with negative values for this lever when the "Simulate" button is clicked. It should be tested in isolation and in the context of a larger policy package. Any errors that come up should be addressed. While we do this, we should check through the logic downstream of this lever to make sure that using negative values for this policy doesn't violate any assumptions in the code.

Note: do not confuse the lever above with the lever called Subsidy for Elec Production by Fuel, which refers to a subsidy for electricity produced from specific kinds of fuel, not a subsidy for the fuels themselves.

mkmahajan commented 11 months ago

I tested this lever with multiple settings across multiple fuels and only saw a Vensim error if I used a setting more negative than the chosen "Min" value. The Min value was previously set to -0.9, and I updated it to -1. However, this wasn't truly an error with the code, just a warning that I exceeded the suggested minimum value.

I also examined the logic, and I don't see any reason why the lever should not be used with negative values. It is simply used to calculate a multiplier on the fuel price. However, I did add a max function so that just in case a user sets a subsidy value more negative than -1, we cap fuel prices so that they cannot fall below 0.