Passed
Pull Request — dev (#1208)
by Patrik
04:04 queued 02:13
created

helpers.epc()   A

Complexity

Conditions 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nop 3
1
# %%[func_lcoh_start]
2
def LCOH(invest_cost, operation_cost, heat_produced, revenue=0, i=0.05, n=20):
3
    pvf = ((1 + i) ** n - 1) / ((1 + i) ** n * i)
4
5
    return (invest_cost + pvf * (operation_cost - revenue)) / (
6
        pvf * heat_produced
7
    )
8
9
10
# %%[func_lcoh_end]
11
12
13
# %%[func_epc_start]
14
def epc(invest_cost, i=0.05, n=20):
15
    af = (i * (1 + i) ** n) / ((1 + i) ** n - 1)
16
17
    return invest_cost * af
18
19
20
# %%[func_epc_end]
21