{ "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", " | Depreciable capital [MM$] | \n", "Fixed capital investment [MM$] | \n", "Working capital [MM$] | \n", "Depreciation [MM$] | \n", "Loan [MM$] | \n", "... | \n", "Net earnings [MM$] | \n", "Cash flow [MM$] | \n", "Discount factor | \n", "Net present value (NPV) [MM$] | \n", "Cumulative NPV [MM$] | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|
2016 | \n", "79.5 | \n", "79.5 | \n", "0 | \n", "0 | \n", "0 | \n", "... | \n", "0 | \n", "-79.5 | \n", "1.15 | \n", "-91.5 | \n", "-91.5 | \n", "
2017 | \n", "119 | \n", "119 | \n", "9.94 | \n", "0 | \n", "0 | \n", "... | \n", "0 | \n", "-129 | \n", "1 | \n", "-129 | \n", "-221 | \n", "
2018 | \n", "0 | \n", "0 | \n", "0 | \n", "28.4 | \n", "0 | \n", "... | \n", "9.95 | \n", "38.4 | \n", "0.87 | \n", "33.4 | \n", "-187 | \n", "
2019 | \n", "0 | \n", "0 | \n", "0 | \n", "48.7 | \n", "0 | \n", "... | \n", "-7.69 | \n", "41 | \n", "0.756 | \n", "31 | \n", "-156 | \n", "
2020 | \n", "0 | \n", "0 | \n", "0 | \n", "34.8 | \n", "0 | \n", "... | \n", "4.92 | \n", "39.7 | \n", "0.658 | \n", "26.1 | \n", "-130 | \n", "
2021 | \n", "0 | \n", "0 | \n", "0 | \n", "24.8 | \n", "0 | \n", "... | \n", "12.8 | \n", "37.6 | \n", "0.572 | \n", "21.5 | \n", "-109 | \n", "
2022 | \n", "0 | \n", "0 | \n", "0 | \n", "17.8 | \n", "0 | \n", "... | \n", "18.4 | \n", "36.1 | \n", "0.497 | \n", "18 | \n", "-90.8 | \n", "
2023 | \n", "0 | \n", "3.19 | \n", "0 | \n", "17.7 | \n", "0 | \n", "... | \n", "18.4 | \n", "32.9 | \n", "0.432 | \n", "14.2 | \n", "-76.6 | \n", "
2024 | \n", "0 | \n", "0 | \n", "0 | \n", "17.8 | \n", "0 | \n", "... | \n", "18.4 | \n", "36.1 | \n", "0.376 | \n", "13.6 | \n", "-63 | \n", "
2025 | \n", "0 | \n", "0 | \n", "0 | \n", "8.87 | \n", "0 | \n", "... | \n", "25.4 | \n", "34.3 | \n", "0.327 | \n", "11.2 | \n", "-51.8 | \n", "
2026 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "... | \n", "32.4 | \n", "32.4 | \n", "0.284 | \n", "9.21 | \n", "-42.6 | \n", "
2027 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "... | \n", "32.4 | \n", "32.4 | \n", "0.247 | \n", "8.01 | \n", "-34.6 | \n", "
2028 | \n", "0 | \n", "3.19 | \n", "0 | \n", "0 | \n", "0 | \n", "... | \n", "32.4 | \n", "29.2 | \n", "0.215 | \n", "6.28 | \n", "-28.3 | \n", "
2029 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "... | \n", "32.4 | \n", "32.4 | \n", "0.187 | \n", "6.06 | \n", "-22.2 | \n", "
2030 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "... | \n", "32.4 | \n", "32.4 | \n", "0.163 | \n", "5.27 | \n", "-17 | \n", "
2031 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "... | \n", "32.4 | \n", "32.4 | \n", "0.141 | \n", "4.58 | \n", "-12.4 | \n", "
2032 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "... | \n", "32.4 | \n", "32.4 | \n", "0.123 | \n", "3.98 | \n", "-8.41 | \n", "
2033 | \n", "0 | \n", "3.19 | \n", "0 | \n", "0 | \n", "0 | \n", "... | \n", "32.4 | \n", "29.2 | \n", "0.107 | \n", "3.12 | \n", "-5.29 | \n", "
2034 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "... | \n", "32.4 | \n", "32.4 | \n", "0.0929 | \n", "3.01 | \n", "-2.28 | \n", "
2035 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "... | \n", "32.4 | \n", "32.4 | \n", "0.0808 | \n", "2.62 | \n", "0.337 | \n", "
2036 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "... | \n", "32.4 | \n", "32.4 | \n", "0.0703 | \n", "2.28 | \n", "2.61 | \n", "
2037 | \n", "0 | \n", "0 | \n", "-9.94 | \n", "0 | \n", "0 | \n", "... | \n", "32.4 | \n", "42.3 | \n", "0.0611 | \n", "2.59 | \n", "5.2 | \n", "
22 rows × 17 columns
\n", "