-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
61 lines (52 loc) · 3 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Calculate LCOW</title>
<script type="text/javascript">
function calculator() {
var capacity = parseInt(document.getElementById("Capacity").value);
var capex = parseInt(document.getElementById("Capex").value);
var opex = parseFloat(document.getElementById("Opex").value);
var lcoe = parseFloat(document.getElementById("LCOE").value);
var lcoh = parseFloat(document.getElementById("LCOH").value);
var sec = parseFloat(document.getElementById("SEC").value);
var stec = parseInt(document.getElementById("STEC").value);
var lifetime = parseInt(document.getElementById("Lifetime").value);
var interest = parseFloat(document.getElementById("Interest").value);
var lcow = capex*1000*interest/100*(1+interest/100)**lifetime/((1+interest/100)**lifetime-1)/(0.9*365*capacity);
var unit_capex = lcow+opex+lcoe*sec+lcoh*stec;
var calc_capex = document.getElementById('calculated_capex');
calc_capex.innerHTML = "$" + unit_capex.toFixed(2) + "/m3";
calc_lcow = document.getElementById('calculated_lcow');
calc_lcow.innerHTML = "$" + lcow.toFixed(2) + "/m3";
console.log(lcow +" "+ unit_capex);
}
</script>
</head>
<body onload="calculator()">
<h3>Calculate LCOW</h3>
<form>
<label for="Capacity">Capacity, m3/day</label><br>
<input type="number" id="Capacity" name="Capacity" value=1000 oninput="calculator()"><br><br>
<label for="Capex">Capex, $1,000s</label><br>
<input type="number" id="Capex" name="Capex" value=2755 oninput="calculator()"><br><br>
<label for="Opex">Opex, $/m3</label><br>
<input type="number" id="Opex" name="Opex" value=0.3 step=0.01 oninput="calculator()"><br><br>
<label for="LCOE">LCOE, $/kWh</label><br>
<input type="number" id="LCOE" name="LCOE" value=0.05 step=0.01 oninput="calculator()"><br><br>
<label for="LCOH">LCOH, $/kWh</label><br>
<input type="number" id="LCOH" name="LCOH" value=0.015 step=0.001 oninput="calculator()"><br><br>
<label for="SEC">SEC, kWh/m3</label><br>
<input type="number" id="SEC" name="SEC" value=1.8 step=0.1 oninput="calculator()"><br><br>
<label for="STEC">STEC, kWh/m3</label><br>
<input type="number" id="STEC" name="STEC" value=55 step=1 oninput="calculator()"><br><br>
<label for="Lifetime">Plant life time, years</label><br>
<input type="number" id="Lifetime" name="Lifetime" value=20 step=1 oninput="calculator()""><br><br>
<label for="Interest">Interest Rate, %</label><br>
<input type="number" id="Interest" name="Interest" value=4 step=0.1 oninput="calculator()"><br><br>
</form>
<b>Unit Capex:</b> <span id="calculated_capex"> </span><br><br>
<b>LCOW:</b> <span id="calculated_lcow"> </span><br>
</body>
</html>