TEA#
- class TEA(system, IRR, duration, depreciation, income_tax, operating_days, lang_factor, construction_schedule, startup_months, startup_FOCfrac, startup_VOCfrac, startup_salesfrac, WC_over_FCI, finance_interest, finance_years, finance_fraction, accumulate_interest_during_construction=None, inflation_rate=None, start_year=None)[source]#
Abstract TEA class for cash flow analysis.
Abstract methods
- _DPI(installed_equipment_cost) -> float
Should return the direct permanent investment (DPI) given the installed equipment cost.
- _TDC(DPI) -> float
Should take direct permanent investment (DPI) as an argument and return total depreciable capital (TDC).
- _FCI(TDC) -> float
Should take total depreciable capital (TDC) as an argument and return fixed capital investment (FCI).
- _FOC(FCI) -> float
Should take fixed capital investment (FCI) as an arguments and return fixed operating cost without depreciation (FOC).
- _fill_tax_and_incentives(incentives, taxable_cashflow, nontaxable_cashflow, tax)
Should take two empty 1d arrays and fill them with incentive and tax cash flows. Additional parameters include taxable_cashflow (sales - costs - depreciation - payments), and nontaxable_cashflow (depreciation - capital cost - working capital).
- Parameters:
system (
System) – Should contain feed and product streams.IRR (
float) – Real internal rate of return (fraction).duration (
tuple[int,int]) – Start and end year of venture (e.g. (2018, 2038)).depreciation (
str|ndarray[tuple[Any,...],dtype[float]]) – Depreciation schedule array or a string with format ‘{schedule}{years}’, where years is the number of years until the property value is zero and schedule is one of the following: ‘MACRS’ (Modified Accelerated Cost Recovery System), ‘SL’ (straight line), ‘DDB’ (double declining balance), or ‘SYD’ (sum-of-the-years’ digits). If years is not given, it defaults to the venture years at run time.operating_days (
float) – Number of operating days per year.income_tax (
float) – Combined federal and state income tax rate (fraction).lang_factor (
float|None) – Lang factor for getting fixed capital investment from total purchase cost. If no lang factor, estimate capital investment using bare module factors.construction_schedule (
Sequence[float]) – Construction investment fractions per year (e.g. (0.5, 0.5) for 50% capital investment in the first year and 50% investment in the second).startup_months (
float) – Startup time in months.startup_FOCfrac (
float) – Fraction of fixed operating costs incurred during startup.startup_VOCfrac (
float) – Fraction of variable operating costs incurred during startup.startup_salesfrac (
float) – Fraction of sales achieved during startup.WC_over_FCI (
float) – Working capital as a fraction of fixed capital investment.finance_interest (
float) – Nominal yearly interest of capital cost financing as a fraction.finance_years (
int) – Number of years the loan is paid for.finance_fraction (
float) – Fraction of capital cost that needs to be financed.inflation_rate (
float, optional) – Annual constant inflation rate as a fraction.start_year (
int, optional) – Year 0 for inflation and discount factor calculations. Defaults to last year of construction.
Notes
If inflation_rate is given, operating costs, sales, capital expenses, replacement costs and working capital flows are escalated to nominal dollars using this rate. NPV calculations use the nominal discount rate, which is computed from the real IRR and inflation_rate by the Fisher equation . If no inflation is applied, cashflows are treated as base-year dollars.
Warning
When using a Lang factor, a short-cut to get the FCI, we cannot work backwards to get installed equipment cost. For practical purposes, the code assumes that installed equipment cost, total depreciable capital (TDC), and fixed capital investment (FCI) are the same when the Lang factor is in use. In actuality, the installed equipment cost should be less than the fixed capital investment.
Examples
-
depreciation_schedules:
dict[tuple[str,int],ndarray[tuple[Any,...],dtype[float]]] = {('MACRS', 3): array([0.333, 0.445, 0.148, 0.074]), ('MACRS', 5): array([0.2 , 0.32 , 0.192, 0.115, 0.115, 0.058]), ('MACRS', 7): array([0.143, 0.245, 0.175, 0.125, 0.089, 0.089, 0.089, 0.045]), ('MACRS', 10): array([0.1 , 0.18 , 0.144, 0.115, 0.092, 0.074, 0.066, 0.066, 0.066, 0.066, 0.033]), ('MACRS', 15): array([0.05 , 0.095, 0.086, 0.077, 0.069, 0.062, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.029]), ('MACRS', 20): array([0.037, 0.072, 0.067, 0.062, 0.057, 0.053, 0.049, 0.045, 0.045, 0.045, 0.045, 0.045, 0.045, 0.045, 0.045, 0.045, 0.045, 0.045, 0.045, 0.045, 0.022])}# Available depreciation schedules. Defaults include modified accelerated cost recovery system from U.S. IRS publication 946 (MACRS), half-year convention.
-
investment_site_factors:
dict[str,float] = {'India': 0.85, 'Japan': 1.15, 'Mexico': 0.95, 'Pacific Rim': 1.0, 'U.S. Gulf Coast': 1.0, 'U.S. Midwest': 1.15, 'U.S. Northwest': 1.1, 'U.S. Southwest': 0.95, 'U.S. West Coast': 1.25, 'Western Europe': 1.2}# Investment site factors used to multiply the total permanent investment (TPI), also known as total fixed capital (FCI), to account for locality cost differences based on labor availability, workforce efficiency, local rules, etc.
- accumulate_interest_during_construction#
Whether to immediately pay interest before operation or to accumulate interest during construction.
- property lang_factor: float | None#
Lang factor for getting fixed capital investment from total purchase cost. If no lang factor, estimate capital investment using bare module factors.
- property depreciation: str | ndarray[tuple[Any, ...], dtype[float]]#
Depreciation schedule array or a string with format ‘{schedule}{years}’, where years is the number of years until the property value is zero and schedule is one of the following: ‘MACRS’ (Modified Accelerated Cost Recovery System), ‘SL’ (straight line), ‘DDB’ (double declining balance), or ‘SYD’ (sum-of-the-years’ digits). If years is not given, it defaults to the venture years at run time.
- property construction_schedule: Sequence[float]#
Construction investment fractions per year, starting from year 0. For example, for 50% capital investment in year 0 and 50% investment in year 1, use (0.5, 0.5).
- property purchase_cost#
Total purchase cost [USD].
- property annual_depreciation: float#
Depreciation [USD/yr] equivalent to TDC divided by the duration of the venture.
- property discount_rate#
Return the nominal discount rate based on the real IRR and the inflation rate.
- get_cashflow_table()[source]#
Return DataFrame of the cash flow analysis.
Notes
If inflation_rate is provided annual, annual costs, sales, capital expenses, replacement costs and working capital are reported in nominal dollars. Discount factors are computed using the nominal discount rate derived from the real IRR and inflation_rate.
- property NPV: float#
Net present value.
Notes
With inflation, cashflows are nominal and discounted with the nominal discount rate. Without inflation, cashflows are treated as base-year values and discounted only with the IRR.
- production_costs(products, with_annual_depreciation=True)[source]#
Return production cost of products [USD/yr].
- Parameters:
Notes
If there is more than one main product, The production cost is proportionally allocated to each of the main products with respect to their marketing values. The marketing value of each product is determined by the annual production multiplied by its selling price.
- total_production_cost(products, with_annual_depreciation=True)[source]#
Return total production cost of products [USD/yr].
- Parameters:
products (
Collection[Stream]) – Main products of the system.with_annual_depreciation (
bool, optional) – Whether to add annualized depreciation to the production costs.
- solve_IRR(financing=True, bounds=None)[source]#
Return the real internal rate of return at the break-even point.
Notes
If an inflation_rate is specified, this method first solves for the nominal IRR using the inflated cashflows. Then, the nominal IRR is converted to the real IRR by applying Fisher equation:
$IRR_{real} = (1 + IRR_{nominal}) / (1 + f_{inflationrate}) - 1$
- solve_price(streams)[source]#
Return the price [USD/kg] of a stream(s) at the break even point (NPV = 0) through cash flow analysis.
- Parameters:
streams (
Stream, optional) – Streams with variable selling price.
- solve_sales()[source]#
Return the required additional sales [USD] to reach the breakeven point (NPV = 0) through cash flow analysis.
Notes
The returned value is expressed in base-year dollars. If inflation_rate is provided, this additional sales value is escalated through time using inflation_factors before calculating NPV.