Skip to content

Inflation implementation in TEA object#245

Open
IsaacLeis wants to merge 9 commits into
BioSTEAMDevelopmentGroup:masterfrom
IsaacLeis:tea-inflation
Open

Inflation implementation in TEA object#245
IsaacLeis wants to merge 9 commits into
BioSTEAMDevelopmentGroup:masterfrom
IsaacLeis:tea-inflation

Conversation

@IsaacLeis
Copy link
Copy Markdown
Collaborator

@IsaacLeis IsaacLeis commented May 28, 2026

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:

  1. IRR is provided as a real internal rate of return. If inflation_rate is provided, it is internally converted to a nominal discount rate for NPV calculations using:

    nominal_IRR = (1 + IRR) * (1 + inflation_rate) - 1
  2. inflation_rate is an annual constant inflation rate applied to CAPEX, OPEX, sales, replacement costs and working capital.

  3. Inflation is applied considering the first construction year as the base-year.

  4. 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.

  5. finance_interest is interpreted as a nominal financing interest rate when inflation is considered.

  6. When inflation_rate, the original behavior is preserved: cashflows are treated as base-year values and discounted directly with IRR.

Implementation details

A new optional argument was added to TEA.__init__:

inflation_rate : float | None = None

When inflation_rate = None which is the default option, all inflation factors are equal to 1.0. Therfore, original cashflow behavior is preserved. In constract, when inflation_rate is provided/changed, or when construction_schedule or/and duration are modified, inflation_factors are recalculated and updated.

The inflation factors are applied to the main cashflow components before calculating taxes, financing and NPV. Specifically, inflation is applied to:

  • annual operating costs
  • sales
  • fixed capital investment
  • depreciable capital
  • replacement costs
  • working capital cashflows

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_earnings and installed_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 of inflation_rate is None.

A new test, test_tea_with_inflation, was added to verify the inflation implementation using the same model structure as test_tea. This test checks that:

  • inflation factors are correctly generated.
  • relevant cashflows are properly escalated.
  • the nominal discount rate is calculated from IRR and inflation_rate.
  • get_cashflow_table() and NPV remain consistent.
  • solve_price() works with inflation and returns a price that results in approximately zero NPV.

IsaacLeis added 9 commits May 27, 2026 16:33
…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
@yoelcortes
Copy link
Copy Markdown
Member

@IsaacLeis, this is a great contribution. I made a pull request with minor modifications to your branch. Once you accept those changes your side, I will merge this pull.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants