Skip to content

Auto-generate ng_crf_penalty_st.csv and update financials.py#113

Open
merveturan wants to merge 7 commits into
mainfrom
mt/issue_25
Open

Auto-generate ng_crf_penalty_st.csv and update financials.py#113
merveturan wants to merge 7 commits into
mainfrom
mt/issue_25

Conversation

@merveturan
Copy link
Copy Markdown
Collaborator

Summary

The PR resolves issue #25. The values stored in inputs/state_policies/ng_crf_penalty_st.csv represent a ratio of capital recovery factors — specifically CRF_X / CRF_30, where X is the number of years remaining before a natural gas power plant must retire. Because these values were hard-coded in a CSV, they stayed fixed even when financial inputs like sys_eval_year were changed. This PR wires the calculation into calc_financial_inputs so that the penalty values are derived at runtime from the model's existing financial parameters, keeping them in sync with any upstream changes. The second part of issue #25 — removing the CRF penalty when DAC/BECCS are available — is out of scope for this PR.

Technical details

The CRF_X / CRF_30 ratio computation has been moved from the pre-generated CSV into calc_financial_inputs. Both CRF_X (CRF at the state-specific retirement horizon) and CRF_30 (CRF at 30 years) are now pulled from the model's financial parameter infrastructure, so the penalty automatically updates when sys_eval_year or related inputs change. The ng_crf_penalty_st.csv file has also been updated to reflect the dynamically computed values; the proposed version extends coverage back to 2010 (from 2019 in main) and shows small decimal-level differences in the overlapping years due to the recalculation.

Implementation notes

Additional changes

Switches added/removed/changed

Issues resolved

Closes #25

Known incompatibilities

Relevant sources or documentation

Validation, testing, and comparison report(s)

A comparison run was conducted between v20260524_main_USA_defaults (baseline) and v20260525_USA_defaults (proposed branch). The differences are small and directly attributable to the decimal-level shifts in the dynamically computed ng_crf_penalty_st values. The dispatch differences in the comparison report (primarily Gas-CC, Gas-CC-CCS, Gas-CC-CCS_Upgrade, Gas-CT, and Coal-CCS by timeslice in 2050) are consistent with the modified financial penalty affecting fossil plant retirement economics, and no unexpected changes were observed in non-fossil technologies. The full comparisons report is here.

ng_crf_penalty_st.csv value differences (proposed vs. main)

Year DE (main) DE (prop) DE (diff%) IL (main) IL (prop) IL (diff%) NY (main) NY (prop) NY (diff%) VA (main) VA (prop) VA (diff%)
2010 - 1.00 - - 1.00 - - 1.00 - - 1.00 -
2011 - 1.00 - - 1.00 - - 1.03 - - 1.00 -
2012 - 1.00 - - 1.00 - - 1.05 - - 1.00 -
2013 - 1.00 - - 1.00 - - 1.07 - - 1.00 -
2014 - 1.00 - - 1.00 - - 1.09 - - 1.00 -
2015 - 1.00 - - 1.00 - - 1.09 - - 1.00 -
2016 - 1.02 - - 1.02 - - 1.14 - - 1.02 -
2017 - 1.05 - - 1.05 - - 1.20 - - 1.05 -
2018 - 1.07 - - 1.07 - - 1.23 - - 1.07 -
2019 - 1.09 - - 1.09 - 1.18 1.25 +5.93 - 1.09 -
2020 - 1.10 - - 1.10 - 1.21 1.27 +4.96 1.08 1.10 +1.85
2021 - 1.15 - 1.10 1.15 +4.55 1.25 1.36 +8.80 1.10 1.15 +4.55
2022 - 1.30 - 1.13 1.30 +15.04 1.29 1.67 +29.46 1.13 1.30 +15.04
2023 - 1.20 - 1.15 1.20 +4.35 1.33 1.44 +8.27 1.15 1.20 +4.35
2024 1.18 1.20 +1.69 1.18 1.20 +1.69 1.38 1.42 +2.90 1.18 1.20 +1.69
2025 1.21 1.22 +0.83 1.21 1.22 +0.83 1.44 1.46 +1.39 1.21 1.22 +0.83
2026 1.25 1.26 +0.80 1.25 1.26 +0.80 1.51 1.53 +1.32 1.25 1.26 +0.80
2027 1.29 1.30 +0.78 1.29 1.30 +0.78 1.59 1.61 +1.26 1.29 1.30 +0.78
2028 1.33 1.34 +0.75 1.33 1.34 +0.75 1.68 1.70 +1.19 1.33 1.34 +0.75
2029 1.38 1.40 +1.45 1.38 1.40 +1.45 1.79 1.81 +1.12 1.38 1.40 +1.45
2030 1.44 1.46 +1.39 1.44 1.46 +1.39 1.92 1.95 +1.56 1.44 1.46 +1.39
2031 1.51 1.53 +1.32 1.51 1.53 +1.32 2.08 2.11 +1.44 1.51 1.53 +1.32
2032 1.59 1.61 +1.26 1.59 1.61 +1.26 2.28 2.32 +1.75 1.59 1.61 +1.26
2033 1.68 1.70 +1.19 1.68 1.70 +1.19 2.54 2.58 +1.57 1.68 1.70 +1.19
2034 1.79 1.81 +1.12 1.79 1.81 +1.12 2.89 2.94 +1.73 1.79 1.81 +1.12
2035 1.92 1.95 +1.56 1.92 1.95 +1.56 3.38 3.44 +1.78 1.92 1.95 +1.56
2036 2.08 2.11 +1.44 2.08 2.11 +1.44 4.12 4.20 +1.94 2.08 2.11 +1.44
2037 2.28 2.32 +1.75 2.28 2.32 +1.75 5.35 5.46 +2.06 2.28 2.32 +1.75
2038 2.54 2.58 +1.57 2.54 2.58 +1.57 7.81 7.98 +2.18 2.54 2.58 +1.57
2039 2.89 2.94 +1.73 2.89 2.94 +1.73 15.21 15.55 +2.24 2.89 2.94 +1.73
2040 3.38 3.44 +1.78 3.38 3.44 +1.78 100.00 100.00 0.00 3.38 3.44 +1.78
2041 4.12 4.20 +1.94 4.12 4.20 +1.94 100.00 100.00 0.00 4.12 4.20 +1.94
2042 5.35 5.46 +2.06 5.35 5.46 +2.06 100.00 100.00 0.00 5.35 5.46 +2.06
2043 7.81 7.98 +2.18 7.81 7.98 +2.18 100.00 100.00 0.00 7.81 7.98 +2.18
2044 15.21 15.55 +2.24 15.21 15.55 +2.24 100.00 100.00 0.00 15.21 15.55 +2.24
2045 100.00 100.00 0.00 100.00 100.00 0.00 100.00 100.00 0.00 100.00 100.00 0.00
2046 100.00 100.00 0.00 100.00 100.00 0.00 100.00 100.00 0.00 100.00 100.00 0.00
2047 100.00 100.00 0.00 100.00 100.00 0.00 100.00 100.00 0.00 100.00 100.00 0.00
2048 100.00 100.00 0.00 100.00 100.00 0.00 100.00 100.00 0.00 100.00 100.00 0.00
2049 100.00 100.00 0.00 100.00 100.00 0.00 100.00 100.00 0.00 100.00 100.00 0.00
2050 100.00 100.00 0.00 100.00 100.00 0.00 100.00 100.00 0.00 100.00 100.00 0.00

Checklist for author

Details to double-check

  • Charge code provided to reviewers
  • Included comparison reports for appropriate test cases
  • Documentation updated if necessary
  • If input data added/modified:
    • Dollar year recorded and converted to 2004$ for GAMS
    • Timeseries are in Central Time
    • Units are specified
    • Preprocessing steps have been documented and committed to ReEDS_Input_Processing
    • New large data files handled with .h5 instead of .csv
    • If spatially resolved inputs are modified, the following visualizations for each file are included in the PR description (time-averaged if the inputs are time-resolved):
      • Map of absolute values before
      • Map of absolute values after
      • Map of differences: (after - before) or (after / before)
    • If entries are added/removed/changed in the EIA-NEMS unit database:
      • Changes have been committed to ReEDS_Input_Processing
      • hourlize/resource.py was rerun to regenerate the existing/prescribed VRE capacity data
  • Code formatting standardized
  • Reusable functions used where possible instead of copy/pasted code

General information to guide review

  • Zero impact on results of default case
  • No large data file(s) added/modified
  • No substantive impact on runtime for full-US reference case
  • No substantive impact on folder size for full-US reference case
  • No change to process flow (runreeds.py, reeds/core/solve/solve.py)
  • No change to code organization
  • No change to package requirements (environment.yml or Project.toml)

Did you use LLM tools (chatbot or copilot) in the preparation of this PR? If so, describe how

Yes, It used in preparing text and coding.

Tag points of contact here if you would like additional review of the relevant parts of the model

@github-actions github-actions Bot added the docs label Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make inputs/state_policies/ng_crf_penalty_st.csv dynamic

1 participant