{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Techno-economic analysis" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "[TEA](../API/TEA.txt) objects can perform cashflow analysis on a [System](../API/System.txt) object and arguments for cashflow analysis. These include arguments such as operating days, lang factor, and income tax, as well as arguments for taking into account startup operation, construction schedule, and capital cost financing." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Inheriting from TEA objects" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Depending on the rigour and flexibility of the techno-economic analysis, different parameters may be needed to calculate total depreciable capital (TDC), fixed capital investment (FCI), and fixed operating cost (FOC). For this reason, the TEA object is left as an *abstract class* with *abstract methods* `_TDC`, `_FCI`, and `_FOC`. Here is an example TEA subclass from the sugarcane biorefinery design for the production of ethanol:" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "tags": [ "nbval-ignore-output" ] }, "outputs": [], "source": [ "import biosteam as bst\n", "import numpy as np\n", "bst.nbtutorial()\n", "\n", "class SugarcaneTEA(bst.TEA):\n", " \"\"\"\n", " Create a SugarcaneTEA object for techno-economic analysis of a biorefinery [1]_.\n", " \n", " Parameters\n", " ---------- \n", " system : System\n", " Should contain feed and product streams.\n", " IRR : float\n", " Internal rate of return (fraction).\n", " duration : tuple[int, int]\n", " Start and end year of venture (e.g. (2018, 2038)).\n", " depreciation : str\n", " 'MACRS' + number of years (e.g. 'MACRS7').\n", " operating_days : float\n", " Number of operating days per year.\n", " income_tax : float\n", " Combined federal and state income tax rate (fraction).\n", " lang_factor : float\n", " Lang factor for getting fixed capital investment from\n", " total purchase cost. If no lang factor, estimate capital investment\n", " using bare module factors.\n", " startup_schedule : tuple[float]\n", " Startup investment fractions per year \n", " (e.g. (0.5, 0.5) for 50% capital investment in the first year and 50%\n", " investment in the second).\n", " WC_over_FCI : float\n", " Working capital as a fraction of fixed capital investment.\n", " labor_cost : float\n", " Total labor cost (USD/yr).\n", " fringe_benefits : float\n", " Cost of fringe benefits as a fraction of labor cost.\n", " property_tax : float\n", " Fee as a fraction of fixed capital investment.\n", " property_insurance : float\n", " Fee as a fraction of fixed capital investment. \n", " supplies : float\n", " Yearly fee as a fraction of labor cost.\n", " maintenance : float\n", " Yearly fee as a fraction of fixed capital investment.\n", " administration : float\n", " Yearly fee as a fraction of fixed capital investment.\n", "\n", " References\n", " ----------\n", " .. [1] Huang, H., Long, S., & Singh, V. (2016). Techno-economic analysis of biodiesel\n", " and ethanol co-production from lipid-producing sugarcane. Biofuels, Bioproducts\n", " and Biorefining, 10(3), 299–315. https://doi.org/10.1002/bbb.1640\n", " \n", " \"\"\"\n", " \n", " def __init__(self, system, IRR, duration, depreciation, income_tax,\n", " operating_days, lang_factor, construction_schedule, WC_over_FCI,\n", " labor_cost, fringe_benefits, property_tax,\n", " property_insurance, supplies, maintenance, administration):\n", " # Huang et. al. does not take into account financing or startup\n", " # so these parameters are 0 by default\n", " super().__init__(system, IRR, duration, depreciation, income_tax,\n", " operating_days, lang_factor, construction_schedule,\n", " startup_months=0, startup_FOCfrac=0, startup_VOCfrac=0,\n", " startup_salesfrac=0, finance_interest=0, finance_years=0, \n", " finance_fraction=0, WC_over_FCI=WC_over_FCI)\n", " self.labor_cost = labor_cost\n", " self.fringe_benefits = fringe_benefits\n", " self.property_tax = property_tax\n", " self.property_insurance = property_insurance\n", " self.supplies= supplies\n", " self.maintenance = maintenance\n", " self.administration = administration\n", " \n", " # The abstract _DPI method should take installed equipment cost\n", " # and return the direct permanent investment. Huang et. al. assume \n", " # these values are equal\n", " def _DPI(self, installed_equipment_cost):\n", " return installed_equipment_cost\n", " \n", " # The abstract _TDC method should take direct permanent investment\n", " # and return the total depreciable capital. Huang et. al. assume \n", " # these values are equal\n", " def _TDC(self, DPI):\n", " return DPI\n", " \n", " # The abstract _FCI method should take total depreciable capital\n", " # and return the fixed capital investment. Again, Huang et. al. \n", " # assume these values are equal.\n", " def _FCI(self, TDC):\n", " return TDC\n", " \n", " # The abstract _FOC method should take fixed capital investment\n", " # and return the fixed operating cost.\n", " def _FOC(self, FCI):\n", " return (FCI*(self.property_tax + self.property_insurance\n", " + self.maintenance + self.administration)\n", " + self.labor_cost*(1+self.fringe_benefits+self.supplies))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Cash flow analysis and results" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Create a TEA object from a system:" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "tags": [ "nbval-ignore-output" ] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "SugarcaneTEA: sugarcane_sys\n", "NPV: 5,200,749 USD at 15.0% IRR\n" ] } ], "source": [ "from biorefineries import sugarcane as sc\n", "\n", "tea = SugarcaneTEA(system=sc.sugarcane_sys,\n", " IRR=0.15,\n", " duration=(2018, 2038),\n", " depreciation='MACRS7',\n", " income_tax=0.21, # Previously 35% in published study\n", " operating_days=200,\n", " lang_factor=3,\n", " construction_schedule=(0.4, 0.6),\n", " WC_over_FCI=0.05,\n", " labor_cost=2.5e6,\n", " fringe_benefits=0.4,\n", " property_tax=0.001,\n", " property_insurance=0.005,\n", " supplies=0.20,\n", " maintenance=0.01,\n", " administration=0.005)\n", "\n", "tea.show() # Print TEA summary at current options\n", "# Ignore the warnings, these are taken care of internally." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Retrieve complete cashflow analysis as a DataFrame object:" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "tags": [ "nbval-ignore-output" ] }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Depreciable capital [MM$]Fixed capital investment [MM$]Working capital [MM$]Depreciation [MM$]Loan [MM$]...Net earnings [MM$]Cash flow [MM$]Discount factorNet present value (NPV) [MM$]Cumulative NPV [MM$]
201679.579.5000...0-79.51.15-91.5-91.5
20171191199.9400...0-1291-129-221
201800028.40...9.9538.40.8733.4-187
201900048.70...-7.69410.75631-156
202000034.80...4.9239.70.65826.1-130
202100024.80...12.837.60.57221.5-109
202200017.80...18.436.10.49718-90.8
202303.19017.70...18.432.90.43214.2-76.6
202400017.80...18.436.10.37613.6-63
20250008.870...25.434.30.32711.2-51.8
202600000...32.432.40.2849.21-42.6
202700000...32.432.40.2478.01-34.6
202803.19000...32.429.20.2156.28-28.3
202900000...32.432.40.1876.06-22.2
203000000...32.432.40.1635.27-17
203100000...32.432.40.1414.58-12.4
203200000...32.432.40.1233.98-8.41
203303.19000...32.429.20.1073.12-5.29
203400000...32.432.40.09293.01-2.28
203500000...32.432.40.08082.620.337
203600000...32.432.40.07032.282.61
203700-9.9400...32.442.30.06112.595.2
\n", "

22 rows × 17 columns

\n", "
" ], "text/plain": [ " Depreciable capital [MM$] Fixed capital investment [MM$] Working capital [MM$] Depreciation [MM$] Loan [MM$] ... Net earnings [MM$] \\\n", "2016 79.5 79.5 0 0 0 ... 0 \n", "2017 119 119 9.94 0 0 ... 0 \n", "2018 0 0 0 28.4 0 ... 9.95 \n", "2019 0 0 0 48.7 0 ... -7.69 \n", "2020 0 0 0 34.8 0 ... 4.92 \n", "2021 0 0 0 24.8 0 ... 12.8 \n", "2022 0 0 0 17.8 0 ... 18.4 \n", "2023 0 3.19 0 17.7 0 ... 18.4 \n", "2024 0 0 0 17.8 0 ... 18.4 \n", "2025 0 0 0 8.87 0 ... 25.4 \n", "2026 0 0 0 0 0 ... 32.4 \n", "2027 0 0 0 0 0 ... 32.4 \n", "2028 0 3.19 0 0 0 ... 32.4 \n", "2029 0 0 0 0 0 ... 32.4 \n", "2030 0 0 0 0 0 ... 32.4 \n", "2031 0 0 0 0 0 ... 32.4 \n", "2032 0 0 0 0 0 ... 32.4 \n", "2033 0 3.19 0 0 0 ... 32.4 \n", "2034 0 0 0 0 0 ... 32.4 \n", "2035 0 0 0 0 0 ... 32.4 \n", "2036 0 0 0 0 0 ... 32.4 \n", "2037 0 0 -9.94 0 0 ... 32.4 \n", "\n", " Cash flow [MM$] Discount factor Net present value (NPV) [MM$] Cumulative NPV [MM$] \n", "2016 -79.5 1.15 -91.5 -91.5 \n", "2017 -129 1 -129 -221 \n", "2018 38.4 0.87 33.4 -187 \n", "2019 41 0.756 31 -156 \n", "2020 39.7 0.658 26.1 -130 \n", "2021 37.6 0.572 21.5 -109 \n", "2022 36.1 0.497 18 -90.8 \n", "2023 32.9 0.432 14.2 -76.6 \n", "2024 36.1 0.376 13.6 -63 \n", "2025 34.3 0.327 11.2 -51.8 \n", "2026 32.4 0.284 9.21 -42.6 \n", "2027 32.4 0.247 8.01 -34.6 \n", "2028 29.2 0.215 6.28 -28.3 \n", "2029 32.4 0.187 6.06 -22.2 \n", "2030 32.4 0.163 5.27 -17 \n", "2031 32.4 0.141 4.58 -12.4 \n", "2032 32.4 0.123 3.98 -8.41 \n", "2033 29.2 0.107 3.12 -5.29 \n", "2034 32.4 0.0929 3.01 -2.28 \n", "2035 32.4 0.0808 2.62 0.337 \n", "2036 32.4 0.0703 2.28 2.61 \n", "2037 42.3 0.0611 2.59 5.2 \n", "\n", "[22 rows x 17 columns]" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "tea.get_cashflow_table()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Find production cost:" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "tags": [ "nbval-ignore-output" ] }, "outputs": [ { "data": { "text/plain": [ "array([57.])" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "products = [bst.main_flowsheet('ethanol')]\n", "costs = tea.production_costs(products)# USD/yr\n", "np.round(costs / 1e6) # million USD / yr" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Solve for the price of a stream at the break even point:" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "tags": [ "nbval-ignore-output" ] }, "outputs": [ { "data": { "text/plain": [ "0.03519" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "feed = bst.main_flowsheet('sugarcane')\n", "price = tea.solve_price(feed) # USD/kg\n", "round(price, 5)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Solve for the IRR at the break even point:" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "tags": [ "nbval-ignore-output" ] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "SugarcaneTEA: sugarcane_sys\n", "NPV: -0 USD at 15.4% IRR\n" ] } ], "source": [ "tea.IRR = tea.solve_IRR()\n", "tea.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Save stream tables, utility requirements, itemized costs, TEA results, and a cash flow table:" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "# Try this on your computer and open excel:\n", "# tea.save_report('report.xlsx')\n", "# Ignore the warning. The flowsheet is saved on the excel file\n", "# as a really big image and Python thinks it could be a \n", "# malicious file cause its so big." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Incentives" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Inclusion of policy incentives in TEA is useful to evaluate their efficacy. Results can be used by researchers to determine the degree to which incentives may improve biorefinery economics, and by policymakers to develop better incentives. The [BioSTEAM Location-Specific Evaluation library (BLocS)](https://github.com/BioSTEAMDevelopmentGroup/BLocS) allows users to simulate 20 existing state-level tax incentives, and also includes state-level tax rate data for use in TEA. Information on the tax incentives available for simulation can be found in [incentives_info.xlsx](https://github.com/BioSTEAMDevelopmentGroup/BLocS/blob/main/blocs/incentives/incentives_info.xlsx), and state-specific tax rate data is available in [state_scenarios_for_import.xlsx](https://github.com/BioSTEAMDevelopmentGroup/BLocS/blob/main/blocs/incentives/state_scenarios_for_import.xlsx).\n", "\n", "In the following example, we evaluate a sugarcane biorefinery operating in Louisiana with state specific data from the BLocS library:" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "tags": [ "nbval-skip" ] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "ConventionalIncentivesTEA: sugarcane_sys\n", "NPV: -0 USD at 14.6% IRR\n" ] } ], "source": [ "import blocs as blc # pip install blocs first (or clone from github)\n", "tea = blc.create_incentivized_tea(\n", " system=sc.sugarcane_sys, \n", " incentive_numbers=[13, 14], # Incentive number as described in incentives_info.xlsx\n", " state='Louisiana',\n", " isconventional=True, \n", " cogeneration_unit=sc.BT,\n", " feedstock=sc.sugarcane, \n", " ethanol_product=sc.ethanol,\n", " IRR=0.15,\n", " duration=(2018, 2038),\n", " depreciation='MACRS7', \n", " federal_income_tax=0.21,\n", " operating_days=180,\n", " lang_factor=3,\n", " construction_schedule=(0.4, 0.6),\n", " WC_over_FCI=0.05,\n", " labor_cost=2.5e6,\n", " fringe_benefits=0.4,\n", " property_tax=0.001,\n", " property_insurance=0.005,\n", " supplies=0.20,\n", " maintenance=0.01,\n", " administration=0.005,\n", ")\n", "tea.IRR = tea.solve_IRR()\n", "tea.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Incentive cashflows can be found in the cash flow table:" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "tags": [ "nbval-skip" ] }, "outputs": [ { "data": { "text/plain": [ "2016 0\n", "2017 0\n", "2018 0.721\n", "2019 0.6\n", "2020 0.513\n", "2021 0.452\n", "2022 0.407\n", "2023 0.363\n", "2024 0.319\n", "2025 0\n", "2026 1\n", "2027 1\n", "2028 0\n", "2029 0\n", "2030 0\n", "2031 0\n", "2032 0\n", "2033 0\n", "2034 0\n", "2035 0\n", "2036 0\n", "2037 0\n", "Name: Incentives [MM$], dtype: float64" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df = tea.get_cashflow_table()\n", "df['Incentives [MM$]']" ] } ], "metadata": { "celltoolbar": "Tags", "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.4" } }, "nbformat": 4, "nbformat_minor": 2 }