Inflation implementation in TEA object#245
Open
IsaacLeis wants to merge 9 commits into
Open
Conversation
…ble_depreciation function The previous functions to build the inflation factors were deteletd. The inflation is now considered to go from the first year of the project (either construction or operation if no contruction is assumed) to the end year. This decision was made to scalate CAPEX following plant design and economics for chemical engineers book by Peters, Timmerhaus and West
… even solving nominal IRR
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds optional inflation handling to the TEA object. It allows selected cashflows to be escalated over time and enables inflation-aware cashflow-based metrics.
Considerations
The implementation follows these conventions:
IRRis provided as a real internal rate of return. Ifinflation_rateis provided, it is internally converted to a nominal discount rate for NPV calculations using:inflation_rateis an annual constant inflation rate applied to CAPEX, OPEX, sales, replacement costs and working capital.Inflation is applied considering the first construction year as the base-year.
Depreciation is calculated from the inflated CAPEX basis. This means depreciation is based on historical nominal capital expenditure and is not escalated year-by-year with inflation.
finance_interestis interpreted as a nominal financing interest rate when inflation is considered.When
inflation_rate, the original behavior is preserved: cashflows are treated as base-year values and discounted directly withIRR.Implementation details
A new optional argument was added to
TEA.__init__:When
inflation_rate = Nonewhich is the default option, all inflation factors are equal to 1.0. Therfore, original cashflow behavior is preserved. In constract, wheninflation_rateis provided/changed, or whenconstruction_scheduleor/anddurationare modified,inflation_factorsare recalculated and updated.The inflation factors are applied to the main cashflow components before calculating taxes, financing and NPV. Specifically, inflation is applied to:
Only a global inflation rate is currently considered. Future work could extend this implementation to support different inflation rates for individual cashflow categories, such as FOC, VOC, sales, equipment costs, replacement costs, and working capital. This was not implemented here because the current biorefinery models I use, consider a single global inflation rate. In addition, the reference used for this implementation, Plant Design and Economics for Chemical Engineers by Peters, Timmerhaus and West, recommended global inflation rates such as consumer price index.
Metrics based on cashflow analysis are calculated using nominal values when inflation is active. Other metrics, such as
production_costs,net_earningsandinstalled_equipment_cost, are kept as base-year values. This is intentional because accounting for the time value of money is only meaningful when a time-dependent cashflow analysis is being performed.Tests
Backward compatibility is checked through the existing
test_tea, which does not include inflation because the default value ofinflation_rateisNone.A new test,
test_tea_with_inflation, was added to verify the inflation implementation using the same model structure astest_tea. This test checks that:IRRandinflation_rate.get_cashflow_table()and NPV remain consistent.solve_price()works with inflation and returns a price that results in approximately zero NPV.