Skip to content

Commit 70b9637

Browse files
added output calculator that uses NN to simulate the system which is given tariff table or prices files.
updated financial calculater to also accept prices files. updated the website UI to enable using editable tariff table or prices file as an input instead of a static table, only changing the base tariff and factors. (right now this new UI is disabled). reformatted the code to separate long function into several function and separate some of the logic. updated tests accordingly. changed website icons to use material symbols instead of material icons.
1 parent d387e99 commit 70b9637

15 files changed

+18722
-277
lines changed

docs/nn_financial_example.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
from optibess_algorithm.output_calculator import NNOutputCalculator
2+
from optibess_algorithm.constants import *
3+
from optibess_algorithm.producers import PvProducer
4+
from optibess_algorithm.power_storage import LithiumPowerStorage
5+
from optibess_algorithm.financial_calculator import FinancialCalculator
6+
7+
import time
8+
import numpy as np
9+
10+
storage = LithiumPowerStorage(25, 5000, aug_table=((0, 83), (96, 16), (192, 16)))
11+
producer = PvProducer("test.csv", pv_peak_power=15000)
12+
prices = np.loadtxt("prices.csv")
13+
output = NNOutputCalculator(num_of_years=25, grid_size=5000, producer=producer, power_storage=storage,
14+
save_all_results=True, sell_prices=prices)
15+
fc = FinancialCalculator(output_calculator=output, land_size=100, capex_per_land_unit=215000, capex_per_kwp=370,
16+
opex_per_kwp=5, battery_capex_per_kwh=170, battery_opex_per_kwh=5,
17+
battery_connection_capex_per_kw=50, battery_connection_opex_per_kw=0.5, fixed_capex=150000,
18+
fixed_opex=10000, interest_rate=0.04, cpi=0.02, hourly_sell_prices=prices,
19+
buy_from_grid_factor=1)
20+
start_time = time.time()
21+
output.run()
22+
print("irr: ", fc.get_irr())
23+
print("npv: ", fc.get_npv(5))
24+
print("lcoe: ", fc.get_lcoe())
25+
print("lcos: ", fc.get_lcos())
26+
print("lcoe no grid power:", fc.get_lcoe_no_power_costs())
27+
print(f"calculation took: {(time.time() - start_time)} seconds")

docs/nn_simulation_example.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
from optibess_algorithm.output_calculator import NNOutputCalculator
2+
from optibess_algorithm.producers import PvProducer
3+
from optibess_algorithm.power_storage import LithiumPowerStorage
4+
5+
import numpy as np
6+
import time
7+
8+
start_time = time.time()
9+
10+
power_storage = LithiumPowerStorage(num_of_years=25, connection_size=7000)
11+
prod = PvProducer("test.csv", pv_peak_power=13000)
12+
prices = np.loadtxt("prices.csv")
13+
output = NNOutputCalculator(num_of_years=25, grid_size=7000, producer=prod, power_storage=power_storage,
14+
save_all_results=True, sell_prices=prices)
15+
# run simulation
16+
output.run()
17+
18+
print(f" simulation took {time.time() - start_time} seconds")
19+
20+
# change print options to show full rows of the matrix
21+
np.set_printoptions(linewidth=1000, precision=4)
22+
print(output.monthly_averages())

0 commit comments

Comments
 (0)