EnergyInnovation / eps-us

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

Bug in Fraction of CCS Potential Achieved equations #261

Closed mkmahajan closed 1 year ago

mkmahajan commented 1 year ago

Robbie and I discovered that CO2 process emissions from certain industries were negative in the US NDC scenario, which is caused by a small bug in the code that allows for the Fraction of Electricity Sector CCS Potential Achieved and Fraction of Industry Sector CCS Potential Achieved to be greater than 1. For example, the current code is:

BFoCPAbS BAU Fraction of CCS Potential Achieved by Industry Sector[Industry Category,Emissions Type]

Instead, we should incorporate the fix bolded below.

BFoCPAbS BAU Fraction of CCS Potential Achieved by Industry Sector[Industry Category,Emissions Type]

This bug fix significantly affects the US NDC results. Since it has a big effect, Robbie suggested we publish a 3.4.3.1 fix so that the states can roll out on this platform. We'd then need to also fix this for the national model on the latest platform. @jrissman - does that plan sound okay to you, or do you suggest a different approach?

robbieorvis commented 1 year ago

Just to add some clarity. The state models are releasing on 3.4.3 for a variety of reasons. We cannot update them to 3.4.4 at this time. Because of that and the magnitude of the bug, we are proposing launching them on a 3.4.3.1 version that fixes this. For the national model, I suggest we fix this with a 3.4.5 immediately since it is a significant bug (around 100 MMT in 2050 in the NDC scenario).

From: mkmahajan @.> Sent: Wednesday, February 1, 2023 4:42 PM To: EnergyInnovation/eps-us @.> Cc: Subscribed @.***> Subject: [EnergyInnovation/eps-us] Bug in Fraction of CCS Potential Achieved equations (Issue #261)

Robbie and I discovered that CO2 process emissions from certain industries were negative in the US NDC scenario, which is caused by a small bug in the code that allows for the Fraction of Electricity Sector CCS Potential Achieved and Fraction of Industry Sector CCS Potential Achieved to be greater than 1. For example, the current code is:

BFoCPAbS BAU Fraction of CCS Potential Achieved by Industry Sector[Industry Category,Emissions Type]

Instead, we should incorporate the fix bolded below.

BFoCPAbS BAU Fraction of CCS Potential Achieved by Industry Sector[Industry Category,Emissions Type]

This bug fix significantly affects the US NDC results. Since it has a big effect, Robbie suggested we publish a 3.4.3.1 fix so that the states can roll out on this platform. We'd then need to also fix this for the national model on the latest platform. @jrissmanhttps://github.com/jrissman - does that plan sound okay to you, or do you suggest a different approach?

— Reply to this email directly, view it on GitHubhttps://github.com/EnergyInnovation/eps-us/issues/261, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AK5N6SPVTFKTA7JJ4JGZXQDWVLKBHANCNFSM6AAAAAAUOH6DNU. You are receiving this because you are subscribed to this thread.Message ID: @.**@.>>

jrissman commented 1 year ago

Your plan sounds good to me. I agree with making a 3.4.3.1 and a 3.4.5 release, and also incorporating the change into branch #232 so that it is included in the future 3.5 release.

Note that I haven't tested the bug fix myself.

mkmahajan commented 1 year ago

Thanks, Jeff. What's the best way to handle a 3.4.3.1 release since we don't want to merge it into the main branch (which is on a later 3.4.4)? I've already made the fix in a branch titled "3.4.3.1_fix" - can I put the 3.4.3.1 tag there rather than where we normally put it in the main branch?

jrissman commented 1 year ago

Yes, since the U.S. national model's main branch is already on 3.4.4 and will be going to 3.4.5, we won't want this fix to be part of the main branch in the U.S. national model's repo. Putting the 3.4.3.1 tag in the 3.4.3.1_fix branch seems good to me.

However, in the 48 State repos, it should be part of the main branch, because the main branch in the State repos is currently pointing to 3.4.3 and can be smoothly updated to 3.4.3.1. "Main" is for whatever we publicly release, and other branches are for things that are not public releases, on a repo-by-repo (region-by-region) basis.