Example: LCOE and TEA Metrics

This example shows how to use the TEA module

[1]:
from TEA import *
import numpy as np
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[1], line 1
----> 1 from TEA import *
      2 import numpy as np

ModuleNotFoundError: No module named 'TEA'
[2]:
# Random system augmentation values
aug = [0.0, 0.0,177697.15370019045,123415.5182529735,125167.53750872007,127459.48015140122,129797.99522506997,132179.45632859864,
       134604.61151508446,137074.2621040492,139589.22446923406,25270485.436780076,144758.42520256026,153745.5370943209,2395386.602393612,
       95601.68890339525,76487.6653485089,77705.21401286017,79129.25172473586,80581.05651950833,82059.51282053148,25211900.201960098,
       85098.30106005147,86659.63738404102,193247.85620667101,162422.98262435052,163888.04287525837, 165959.6936979254, 168060.3576125073,
       170182.3355685308, 172325.6064117179]

Initialize class

[3]:
LCOECalculator = LCOECalculator(system_capex_USD = 346560945.0499253,
                        system_annual_OM_USD = 7373570,
                        system_annual_VOM_USD = 1097289,
                        system_to_load_annual_MWh_e = 365763,
                        system_augment = aug)

Run using set and default values, or use your own inputs

[4]:
LCOECalculator.calculate_depreciation()
[4]:
([0,
  101057171.57655823,
  58936542.463448755,
  34371791.56468331,
  20045628.84052331,
  11690610.739793193,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0],
 [0,
  0.38880000000000003,
  0.22674816,
  0.13223952691199997,
  0.0771220920950784,
  0.04497760410984972,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0])
[5]:
LCOECalculator.calculate_lcoe_metrics()
[5]:
{'annual_electricity_purchases_USD': 0,
 'annual_electricity_sales_USD': 25603410.000000004,
 'PVD': 0.767373270359498,
 'FCR_AT': 0.036148074230068654,
 'FCR_BT': 0.05294061134598742,
 'CRF': 0.07650022967642069,
 'NPV_cash_flow': -75538974.3174016,
 'IRR': -0.008560633038295795,
 'payback_period': None,
 'LCOE_real_USD_kWh_BT': 0.0884607380006672,
 'LCOE_real_USD_kWh_AT': 0.06270683095590603}
[6]:
LCOECalculator.calculate_depreciation(analysis_period = 5, system_capex_USD = 3000000000, inflation = 0.03)
[6]:
([0, 873000000.0, 508086000.0, 295706052.0, 172100922.264, 100162736.75764799],
 [0, 0.388, 0.225816, 0.131424912, 0.076489298784, 0.044516771892288])
[7]:
LCOECalculator.calculate_lcoe_metrics(system_capex_USD = 3000000000, system_annual_OM_USD = 7373570, depreciation_period = 10)
[7]:
{'annual_electricity_purchases_USD': 0,
 'annual_electricity_sales_USD': 25603410.000000004,
 'PVD': 0.6474760495464913,
 'FCR_AT': 0.03791600902027981,
 'FCR_BT': 0.05532006597615048,
 'CRF': 0.07650022967642069,
 'NPV_cash_flow': -1827446916.07056,
 'IRR': nan,
 'payback_period': None,
 'LCOE_real_USD_kWh_BT': 0.4920364130385064,
 'LCOE_real_USD_kWh_AT': 0.33944481783246816}
[26]:
arr = [1,2,3]
L = 12

arr_with_zero = np.insert(arr, 0, 0)  # Insert a zero at the beginning of the array
l_val = arr_with_zero.size
if L > l_val:
    shortfall = L - l_val
    repeat_times = (shortfall + l_val - 1) // l_val
    repeated_section = np.tile(arr_with_zero, (repeat_times,))[-shortfall:]
    augmented_array = np.concatenate((arr_with_zero, repeated_section))
    print(augmented_array)
else:
    print(arr_with_zero[:L])
[0 1 2 3 0 1 2 3 0 1 2 3]
[ ]: