EnergyInnovation / eps-us

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

Support model end dates out to 2100 #168

Closed jrissman closed 3 years ago

jrissman commented 3 years ago

Some model deployments will require end dates farther out than 2050. Extending the model's end date requires structural edits (but a model can choose to use an earlier end date than the farthest date supported in the model structure).

Extend model structure support for end dates as far out as 2100, to give future models more flexibility to choose their end date.

jrissman commented 3 years ago

Support for model run end dates out as far as 2100 is now complete. The end date is controlled by the input data variable plcy-schd/FT Final Time. When you update that variable, the model should run through whatever date you specify, and the graphs in Vensim should all display results through that date.

Most input data variables are untouched. Should you need to build an EPS version with an end date after 2050, simply extend any time-series input data variables through your chosen end date.

Two input data variables did require modification:

The model builds and runs correctly in the web interface, but the web interface's policy schedule editor shows data for beyond the end year, so I'll need to ask Todd to make a small tweak there to the display code. It should not affect the usability of the model in the meanwhile.

jrissman commented 3 years ago

I've realized that perhaps I only needed policy schedule values out to 2100 for testing, and now that I've confirmed that it works, maybe I can remove them. That would mean the "Set Schedules Here" tab would look as it did before. I think it would be slightly cleaned that way, so I will try it. It would also avoid the need for Todd to make a change on his end.

jrissman commented 3 years ago

In commit d1c0342, I enhanced plcy-schd/FoPITY so that it now adapts itself automatically to varying end years. It is no longer necessary to include schedule data out to 2100 - rather, schedules should be specified exactly as they were before (with data going out only to the end year of the model run, which is specified in plcy-schd/FT and is 2050 for the U.S. national model). This means it is no longer feeding data points after the last year of the model run to the web app, so it avoids the situation I mentioned where the web app's schedule editor shows schedule data from after the model run.

Note that during testing of this, I've discovered that Vensim 8.0.7 cannot display the "Table" output for the variable FoPITY Fraction of Policy Implemented This Year because that variable has grown too big, and Vensim is poorly optimized for display of large numbers of Lookups. We are only using lookups here because older versions of Vensim were unable to override data obtained using GET DIRECT DATA, but could override data obtained using GET DIRECT LOOKUPS. (Overriding whatever is in the input files is necessary for the web app to work.) I think they may have removed that limitation after I complained about it a while back. So we might be able to switch these statements (and related equations) back to GET DIRECT DATA and thereby avoid the problem. I will test it.

jrissman commented 3 years ago

Okay, I can't switch the GET DIRECT LOOKUPS to GET DIRECT DATA because the RPS policy needs foresight to future year values, and we are using math to select the active policy schedule, and Vensim doesn't do math (i.e. in auxiliary variables) for years ahead of the current year. I'll report the Vensim crash bug to Ventana Systems to fix. Note that it doesn't affect our model results at all - it's just preventing us from viewing the contents of FoPITY Fraction of Policy Implemented This Year using the "Table" button.

jrissman commented 3 years ago

I reported the issue to Ventana - you can follow the progress at https://www.ventanasystems.co.uk/forum/viewtopic.php?f=2&t=7761