1---
2version: 0.1.0
3precision: 2
4form_title: Energy Savings Calculator
5form_description: Calculate savings from energy efficiency improvements. Enter old and new consumption, fuel price and investment to see payback period.
6form_inputs: Old consumption|old_kwh{kWh}, New consumption|new_kwh{kWh}, Energy price|price{€/kWh}, Investment|invest{€}
7form_outputs: Annual savings|savings, Payback years|payback, 5-year savings|savings_5yr, 10-year savings|savings_10yr
8---
9# draftply – Energy Savings Calculator
10# How much will you save with a more efficient heating system?
11
12# ── Current and new energy usage ─────────────────────────
13old_kwh = 25000 kWh # current annual consumption
14new_kwh = 15000 kWh # new annual consumption after upgrade
15price = 0.12 €/kWh # energy price (gas, oil, electricity)
16invest = 10000 € # upfront investment cost
17
18# ── Savings calculations ────────────────────────────────
19# Annual energy saved
20savings_kwh = old_kwh - new_kwh
21
22# Annual monetary savings
23savings = savings_kwh * price
24
25# Payback period (investment / annual savings)
26payback = invest / savings
27
28# Cumulative savings over time
29savings_5yr = savings * 5 - invest
30savings_10yr = savings * 10 - invest
31
32# Percentage reduction
33reduction_percent = (savings_kwh / old_kwh) * 100 %
34
35# CO2 savings (assuming 0.2 kg CO2 per kWh for gas)
36co2_per_kwh = 0.2 kg/kWh
37co2_savings = savings_kwh * co2_per_kwh
38
39# ── Results ─────────────────────────────────────────────
40"Old consumption": old_kwh
41"New consumption": new_kwh
42"Energy price": price
43"Investment": invest
44
45"Annual energy savings": savings_kwh
46"Annual monetary savings": savings
47"Energy reduction": reduction_percent
48"CO2 savings per year": co2_savings
49
50"Payback period": payback
51"Savings after 5 years": savings_5yr
52"Savings after 10 years": savings_10yr
53
54# Break-even visualization
55net(year) = savings * year - invest
56plot(net(x), 0..15, "Energy savings payback", "Years", "€", "Cumulative net savings")
57