Skip to content

Commit

Permalink
175 improve norse case (#176)
Browse files Browse the repository at this point in the history
* Delete old Norse files

* Fix to c_upper_bound_asset to avoid writting the equation for consumers and transport flows

* Update documentation with last change in the model

* Update input data for the Norse case

* Update the Norse test with the new input data
  • Loading branch information
datejada committed Oct 25, 2023
1 parent 82175d0 commit 0f318b2
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 1,059 deletions.
2 changes: 1 addition & 1 deletion docs/src/mathematical-formulation.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ s_{a,rp,k}^{level} = s_{a,rp,k-1}^{level} + p_{a,rp,k}^{inflow} + \cdot \sum_{f

```math
\begin{aligned}
v^{flow}_{f,rp,k} \leq p^{profile}_{a,rp,k} \cdot \left(p^{init\_capacity}_{a} + p^{unit\_capacity}_a \cdot v^{investment}_a \right) \quad \forall a \notin \mathcal{A}_h, \forall f \in \mathcal{F}_{out}(a), \forall rp \in \mathcal{RP},\forall k \in \mathcal{K}
v^{flow}_{f,rp,k} \leq p^{profile}_{a,rp,k} \cdot \left(p^{init\_capacity}_{a} + p^{unit\_capacity}_a \cdot v^{investment}_a \right) \quad \forall a \notin \mathcal{A}_h \cup \mathcal{A}_c, \forall f \in \mathcal{F}_{out}(a) \& \notin \mathcal{F}_t, \forall rp \in \mathcal{RP},\forall k \in \mathcal{K}
\end{aligned}
```

Expand Down
8 changes: 7 additions & 1 deletion src/model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,13 @@ function create_model(graph, params, sets; verbose = false, write_lp_file = fals
# - upper bound associated with asset
@constraint(
model,
c_upper_bound_asset[a A, f F, rp RP, k K; !(a Ah) && f[1] == a],
c_upper_bound_asset[
a A,
f F,
rp RP,
k K;
!(a Ah Ac) && f[1] == a && f Ft,
],
flow[f, rp, k]
get(params.assets_profile, (a, rp, k), 1.0) * (
params.assets_init_capacity[a] +
Expand Down
20 changes: 10 additions & 10 deletions test/inputs/Norse/assets-data.csv
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
,,{producer;consumer;storage;hub;conversion},{true;false},{true;false},kEUR/MWh,kEUR/MW/year,MW,MW,MW,MW/unit,MW/unit,MW,MW,MWh,h,kEUR/MW/year,year,0
id,name,type,active,investable,variable_cost,investment_cost,capacity,initial_capacity,peak_demand,charging_capacity,discharging_capacity,initial_charging_capacity,initial_discharging_capacity,initial_storage_capacity,energy_to_power_ratio,fixed_cost,lifetime,efficiency
1,Asgard_Battery,storage,true,true,0.003,300,0,0,0,1,1,0,0,0,100,3,10,0
2,Asgard_Solar,producer,true,true,0.001,350,1,0,0,0,0,0,0,0,0,8,25,0
1,Asgard_Battery,storage,true,true,0.003,300,10,0,0,1,1,0,0,0,100,3,10,0
2,Asgard_Solar,producer,true,true,0.001,350,100,0,0,0,0,0,0,0,0,8,25,0
3,Asgard_E_demand,consumer,true,false,0,0,0,0,65787.17792,0,0,0,0,0,0,0,0,0
4,Asgard_CCGT,conversion,true,true,0.0015,650,500,0,0,0,0,0,0,0,0,10,30,0.6
5,G_imports,producer,true,false,0.04,0,0,200000,0,0,0,0,0,0,0,0,0,0
5,G_imports,producer,true,false,0.08,0,0,75000,0,0,0,0,0,0,0,0,0,0
6,Midgard_Wind,producer,true,true,0.002,1300,3,0,0,0,0,0,0,0,0,15,25,0
7,Midgard_Hydro,storage,true,false,0.0012,1600,0,250,0,3,3,0,0,0,4000,16,50,0
8,Midgard_Nuclear_SMR,producer,true,true,0.015,6000,150,0,0,0,0,0,0,0,0,101,60,0
7,Midgard_Hydro,storage,true,false,0.0012,1600,0,250,0,3,3,0,0,4000,0,16,50,0
8,Midgard_Nuclear_SMR,producer,true,true,0.015,6000,150,1000,0,0,0,0,0,0,0,101,60,0
9,Midgard_E_imports,producer,true,false,0.02,0,0,500,0,0,0,0,0,0,0,0,0,0
10,Midgard_CCGT,conversion,true,true,0.0015,650,500,0,0,0,0,0,0,0,0,10,30,0.6
11,Midgard_E_demand,consumer,true,false,0,0,0,0,19604.76443,0,0,0,0,0,0,0,0,0
12,Valhalla_H2_generator,conversion,true,true,0,479,100,0,0,0,0,0,0,0,0,10,20,0.6
13,Valhalla_H2_storage,storage,true,true,0,0.1,0,0,0,3,3,0,0,0,10000,0.005,50,0
13,Valhalla_H2_storage,storage,true,true,0,0.1,500,0,0,3,3,0,0,0,10000,0.005,50,0
14,Valhalla_H2_demand,consumer,true,false,0,0,0,0,745.735,0,0,0,0,0,0,0,0,0
15,Valhalla_Electrolyser,conversion,true,true,0,1260,100,0,0,0,0,0,0,0,0,60,25,0.704
15,Valhalla_Electrolyser,conversion,true,true,0,1260,100,500,0,0,0,0,0,0,0,60,25,0.704
16,Valhalla_E_balance,hub,true,false,0,0,0,0,0,0,0,0,0,0,0,0,0,0
17,Valhalla_E_exports,consumer,true,false,0.09,0,0,0,50,0,0,0,0,0,0,0,0,0
18,Valhalla_Fuel_cell,conversion,true,true,0,800,1,0,0,0,0,0,0,0,0,40,25,0.5
19,Valhalla_Heat_pump,conversion,true,true,0,300,1,0,0,0,0,0,0,0,0,15,20,4
20,Valhalla_Waste_heat,producer,true,true,0.0025,1450,200,0,0,0,0,0,0,0,0,0,30,0
18,Valhalla_Fuel_cell,conversion,true,true,0,800,100,0,0,0,0,0,0,0,0,40,25,0.5
19,Valhalla_Heat_pump,conversion,true,true,0,300,100,0,0,0,0,0,0,0,0,15,20,4
20,Valhalla_Waste_heat,producer,true,false,0.0025,1450,200,0,0,0,0,0,0,0,0,0,30,0
21,Valhalla_Heat_demand,consumer,true,false,0,0,0,0,3548.42445,0,0,0,0,0,0,0,0,0
22,Valhalla_GT,conversion,true,true,0.0015,400,500,0,0,0,0,0,0,0,0,3.85,30,0.6
33 changes: 0 additions & 33 deletions test/inputs/Norse/assets.csv

This file was deleted.

6 changes: 3 additions & 3 deletions test/inputs/Norse/flows-data.csv
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ id,carrier,from_asset,to_asset,active,is_transport,investable,variable_cost,inve
6,gas,G_imports,Midgard_CCGT,true,false,false,0.0015,0,0,0,0,1
7,gas,G_imports,Valhalla_GT,true,false,false,0.0015,0,0,0,0,1
8,gas,G_imports,Valhalla_H2_generator,true,false,false,0.0015,0,0,0,0,1
9,electricity,Asgard_E_demand,Midgard_E_demand,true,true,true,0,1000,100,100,0,1
10,electricity,Asgard_E_demand,Valhalla_E_balance,true,true,true,0,1000,100,100,0,1
11,electricity,Midgard_E_demand,Valhalla_E_balance,true,true,true,0,1000,100,100,0,1
9,electricity,Asgard_E_demand,Midgard_E_demand,true,true,true,0,2000,1000,1000,0,1
10,electricity,Asgard_E_demand,Valhalla_E_balance,true,true,true,0,5000,1000,1000,1000,1
11,electricity,Midgard_E_demand,Valhalla_E_balance,true,true,true,0,3500,1000,1000,0,1
12,electricity,Midgard_Wind,Midgard_E_demand,true,false,false,0.002,0,0,0,0,0
13,electricity,Midgard_Nuclear_SMR,Midgard_E_demand,true,false,false,0.015,0,0,0,0,1
14,electricity,Midgard_E_imports,Midgard_E_demand,true,false,false,0.02,0,0,0,0,1
Expand Down
Loading

0 comments on commit 0f318b2

Please sign in to comment.