Lcoe branch by eccoope · Pull Request #1687 · pvlib/pvlib-python · GitHub
Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
49fd4e8
''
eccoope Mar 6, 2023
fb6ff2f
Merge branch 'main' of https://github.com/eccoope/pvlib-python-forked…
eccoope Mar 6, 2023
2204f18
''
eccoope Mar 6, 2023
af4b00b
resolved stickler issues
eccoope Mar 7, 2023
d7c606d
resolved stickler issues
eccoope Mar 7, 2023
9b86e11
resolved stickler issues
eccoope Mar 7, 2023
9f1e090
updated to be consistent suggested changes
eccoope Mar 7, 2023
a4fa101
''
eccoope Mar 7, 2023
fdea1b5
''
eccoope Mar 7, 2023
4c7cba8
''
eccoope Mar 7, 2023
7fdb96f
''
eccoope Mar 7, 2023
59df950
''
eccoope Mar 7, 2023
effdaa7
''
eccoope Mar 7, 2023
4284990
Resolve stickler failures
eccoope Mar 8, 2023
2bfba2e
Resolved stickler issues in simple_lcoe_calculator.py
eccoope Mar 8, 2023
e6f6938
Resolved stickler issues and linked references
eccoope Mar 8, 2023
b61a9cb
Resolved stickler failures
eccoope Mar 8, 2023
49f2631
Changed variable names + real/nominal clarification
eccoope Mar 8, 2023
388f9f4
Resolved stickler failure
eccoope Mar 8, 2023
a18f861
More stickler corrections
eccoope Mar 8, 2023
582c974
Encourage use of real discount rates
eccoope Mar 8, 2023
4161663
Encourage use of real discount rates
eccoope Mar 8, 2023
c0e31dc
Update pvlib/financial.py
eccoope Mar 9, 2023
912969d
Update pvlib/financial.py
eccoope Mar 9, 2023
a0a7cf1
Update pvlib/financial.py
eccoope Mar 9, 2023
17898a6
Update pvlib/financial.py
eccoope Mar 9, 2023
dce7e5f
Update pvlib/financial.py
eccoope Mar 9, 2023
1ea12b5
Update pvlib/financial.py
eccoope Mar 9, 2023
e124027
Update pvlib/financial.py
eccoope Mar 9, 2023
9d17c09
Apply suggestions from code review
eccoope Mar 9, 2023
83d6e02
Update financial.py
eccoope Mar 9, 2023
33c8238
Update test_financial.py
eccoope Mar 9, 2023
cd0ae02
Stickler for lcoe_sam_validation.py
eccoope Mar 10, 2023
92d7258
More stickler for lcoe_sam_validation.py
eccoope Mar 10, 2023
cae3d7b
more stickler for lcoe_sam_validation.py
eccoope Mar 10, 2023
7fc63e7
One last stickler thing
eccoope Mar 10, 2023
00df4f8
Remove "real" from wacc docstring
eccoope Mar 10, 2023
ab47596
Added a line to index.rst
eccoope Mar 15, 2023
7a039b7
Added last two authors to be consistent with version in main branch
eccoope Mar 16, 2023
ebec039
Merge branch 'main' into lcoe_branch
eccoope Mar 16, 2023
7136b84
Merge branch 'main' of https://github.com/eccoope/pvlib-python-forked…
eccoope Jun 21, 2023
41bde9c
Resolved conflicts in v0.9.5 and moved changes to v0.9.6
eccoope Jun 21, 2023
8aff9f0
Merge branch 'main' into lcoe_branch
eccoope Jun 21, 2023
925e155
Remove variable O&M caveatp
eccoope Jun 28, 2023
42b7823
Merge branch 'main' into lcoe_branch
eccoope Jun 28, 2023
0541e5b
Added system degradation rate to example
eccoope Jul 10, 2023
1441de6
Delete v0.9.6.rst
eccoope Jul 10, 2023
d2205c3
Merge branch 'pvlib:main' into lcoe_branch
eccoope Jul 10, 2023
77fb22c
Updated whatsnew v0.10.2.rst
eccoope Jul 10, 2023
b3c272e
Merge branch 'main' into lcoe_branch
eccoope Dec 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
193 changes: 193 additions & 0 deletions docs/examples/financial/lcoe_sam_validation.py
65 changes: 65 additions & 0 deletions docs/examples/financial/simple_lcoe_calculator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
"""
LCOE Calculation
================

Example of an LCOE calculation using an approach implemented in NREL's "Simple
LCOE Calculator", accessible at http://www.nrel.gov/analysis/tech-lcoe.html
"""
# %%
# This example shows basic usage of pvlib's lcoe calculation with
# :py:meth:`pvlib.financial.lcoe` and :py:meth:`pvlib.financial.crf`.
# The example shown here will generate a Series of annual cost and production
# data, and a numerical LCOE. To be comparable with NREL's implemenation,
# this example adheres to the following assumptions: that energy production
# and O&M costs are constant and that the entire project is financed with a
# loan. Input values for CAPEX, capacity factor, and O&M were sourced from
# NREL's ATB for a residential system in 2022 located in Resource Class 5
# with moderate technological advancement. The discount rate is set to the
# value recommended in NREL's implementation.

import numpy as np
import pandas as pd
from pvlib import financial

# Analysis period
n = 20

# Capacity factor
cf = 0.15357857

# Constant annual energy production
energy = np.full(n, cf*8760)

# Real discount rate
discount_rate = 0.03
Comment thread
eccoope marked this conversation as resolved.

# Capital recovery factor
my_crf = financial.crf(discount_rate, n)

# CAPEX
capex = 2443.45

# Fraction of capital cost
loan_frac = 1

# Annual capital costs
cap_cost = np.array([capex*loan_frac*my_crf for i in range(n)])

# Constant annual O&M
fixed_om = pd.Series(data=[26.98 for j in range(n)])

# Put data in table and display
table = pd.DataFrame(columns=['Production [kWh/kW]', 'Capital cost [$/kW]',
'O&M [$/kW]'])
table['Production [kWh/kW]'] = energy
table['Capital cost [$/kW]'] = cap_cost
table['O&M [$/kW]'] = fixed_om
table.index.name = 'Year'
table

# %%
# Get LCOE

my_lcoe = financial.lcoe(production=energy, cap_cost=cap_cost,
fixed_om=fixed_om)
print('LCOE = ' + str(my_lcoe) + str(' cents/kWh'))
13 changes: 13 additions & 0 deletions docs/sphinx/source/reference/financial.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.. currentmodule:: pvlib

Financial
=========

.. autosummary::
:toctree: generated/

financial.lcoe
financial.crf
financial.nominal_to_real
financial.real_to_nominal
financial.wacc
1 change: 1 addition & 0 deletions docs/sphinx/source/reference/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ API reference
bifacial
scaling
location
financial
6 changes: 6 additions & 0 deletions docs/sphinx/source/whatsnew/v0.10.2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ Enhancements
* :py:class:`~pvlib.pvsystem.PVSystem` objects with a single
:py:class:`~pvlib.pvsystem.Array` can now be created without wrapping the
``Array`` in a list first. (:issue:`1831`, :pull:`1854`)
* Added :py:mod:`pvlib.financial` module with functions
:py:func:`~pvlib.financial.lcoe`, :py:func:`~pvlib.financial.crf`,
:py:func:`~pvlib.financial.nominal_to_real`,
:py:func:`~pvlib.financial.real_to_nominal`, and
:py:func:`~pvlib.financial.wacc` (:pull:`1687`)


Bug fixes
Expand Down Expand Up @@ -84,3 +89,4 @@ Contributors
* Will Holmgren (:ghuser:`wholmgren`)
* Mark Mikofski (:ghuser:`mikofski`)
* Kevin Anderson (:ghuser:`kandersolar`)
* Emma Cooper (:ghuser:`eccoope`)
3 changes: 3 additions & 0 deletions docs/sphinx/source/whatsnew/v0.9.5.rst
Loading