Running the urban scale example model¶
This notebook will show you how to load, build, solve, and examine the results of the urban scale example model.
import calliope
import pandas as pd
import plotly.express as px
# We increase logging verbosity
calliope.set_log_verbosity("INFO", include_solver_output=False)
Load model and examine inputs¶
model = calliope.examples.urban_scale()
[2024-01-27 14:24:51] INFO Model: initialising
[2024-01-27 14:24:52] INFO Model: preprocessing stage 1 (model_run)
[2024-01-27 14:24:55] INFO Model: preprocessing stage 2 (model_data)
[2024-01-27 14:24:55] INFO Model: preprocessing complete
Model inputs can be viewed at model.inputs
.
Variables are indexed over any combination of techs
, nodes
, carriers
, costs
and timesteps
.
model.inputs
<xarray.Dataset> Dimensions: (costs: 1, techs: 12, nodes: 4, carriers: 3, timesteps: 48) Coordinates: * costs (costs) object 'monetary' * techs (techs) object 'N1_to_X2' ... 'supply_grid_po... * carriers (carriers) object 'electricity' 'gas' 'heat' * nodes (nodes) object 'N1' 'X1' 'X2' 'X3' * timesteps (timesteps) datetime64[ns] 2005-07-01 ... 200... Data variables: (12/35) objective_cost_weights (costs) float64 1.0 bigM float64 1e+06 base_tech (techs) object 'transmission' ... 'supply' carrier_in (nodes, techs, carriers) float64 nan nan ... nan carrier_out (nodes, techs, carriers) float64 nan nan ... nan color (techs) object '#823739' '#823739' ... '#C5ABE3' ... ... available_area (nodes) float64 nan 500.0 1.3e+03 900.0 source_use_equals (techs, timesteps) float64 nan nan ... nan nan sink_use_equals (timesteps, techs, nodes) float64 nan ... nan definition_matrix (nodes, techs, carriers) bool False ... False timestep_resolution (timesteps) float64 1.0 1.0 1.0 ... 1.0 1.0 1.0 timestep_weights (timesteps) float64 1.0 1.0 1.0 ... 1.0 1.0 1.0 Attributes: calliope_version_defined: 0.7.0 calliope_version_initialised: 0.7.0.dev2 applied_overrides: scenario: None defaults: {'available_area': inf, 'bigM': 1000000000... allow_operate_mode: 1 config: {'build': {'backend': 'pyomo', 'ensure_fea... applied_custom_math: ['custom_math.yaml'] math: {'constraints': {'flow_capacity_per_storag... name: Urban-scale example model
- costs: 1
- techs: 12
- nodes: 4
- carriers: 3
- timesteps: 48
- costs(costs)object'monetary'
array(['monetary'], dtype=object)
- techs(techs)object'N1_to_X2' ... 'supply_grid_power'
array(['N1_to_X2', 'N1_to_X3', 'X1_to_N1', 'X1_to_X2', 'X1_to_X3', 'boiler', 'chp', 'demand_electricity', 'demand_heat', 'pv', 'supply_gas', 'supply_grid_power'], dtype=object)
- carriers(carriers)object'electricity' 'gas' 'heat'
array(['electricity', 'gas', 'heat'], dtype=object)
- nodes(nodes)object'N1' 'X1' 'X2' 'X3'
array(['N1', 'X1', 'X2', 'X3'], dtype=object)
- timesteps(timesteps)datetime64[ns]2005-07-01 ... 2005-07-02T23:00:00
array(['2005-07-01T00:00:00.000000000', '2005-07-01T01:00:00.000000000', '2005-07-01T02:00:00.000000000', '2005-07-01T03:00:00.000000000', '2005-07-01T04:00:00.000000000', '2005-07-01T05:00:00.000000000', '2005-07-01T06:00:00.000000000', '2005-07-01T07:00:00.000000000', '2005-07-01T08:00:00.000000000', '2005-07-01T09:00:00.000000000', '2005-07-01T10:00:00.000000000', '2005-07-01T11:00:00.000000000', '2005-07-01T12:00:00.000000000', '2005-07-01T13:00:00.000000000', '2005-07-01T14:00:00.000000000', '2005-07-01T15:00:00.000000000', '2005-07-01T16:00:00.000000000', '2005-07-01T17:00:00.000000000', '2005-07-01T18:00:00.000000000', '2005-07-01T19:00:00.000000000', '2005-07-01T20:00:00.000000000', '2005-07-01T21:00:00.000000000', '2005-07-01T22:00:00.000000000', '2005-07-01T23:00:00.000000000', '2005-07-02T00:00:00.000000000', '2005-07-02T01:00:00.000000000', '2005-07-02T02:00:00.000000000', '2005-07-02T03:00:00.000000000', '2005-07-02T04:00:00.000000000', '2005-07-02T05:00:00.000000000', '2005-07-02T06:00:00.000000000', '2005-07-02T07:00:00.000000000', '2005-07-02T08:00:00.000000000', '2005-07-02T09:00:00.000000000', '2005-07-02T10:00:00.000000000', '2005-07-02T11:00:00.000000000', '2005-07-02T12:00:00.000000000', '2005-07-02T13:00:00.000000000', '2005-07-02T14:00:00.000000000', '2005-07-02T15:00:00.000000000', '2005-07-02T16:00:00.000000000', '2005-07-02T17:00:00.000000000', '2005-07-02T18:00:00.000000000', '2005-07-02T19:00:00.000000000', '2005-07-02T20:00:00.000000000', '2005-07-02T21:00:00.000000000', '2005-07-02T22:00:00.000000000', '2005-07-02T23:00:00.000000000'], dtype='datetime64[ns]')
- objective_cost_weights(costs)float641.0
- is_result :
- False
- default :
- 1
array([1.])
- bigM()float641e+06
- is_result :
- False
- default :
- 1000000000.0
array(1000000.)
- base_tech(techs)object'transmission' ... 'supply'
- is_result :
- False
array(['transmission', 'transmission', 'transmission', 'transmission', 'transmission', 'conversion', 'conversion', 'demand', 'demand', 'supply', 'supply', 'supply'], dtype=object)
- carrier_in(nodes, techs, carriers)float64nan nan 1.0 nan ... nan nan nan nan
- is_result :
- False
array([[[nan, nan, 1.], [nan, nan, 1.], [nan, nan, 1.], [nan, nan, nan], [nan, nan, nan], [nan, nan, nan], [nan, nan, nan], [nan, nan, nan], [nan, nan, nan], [nan, nan, nan], [nan, nan, nan], [nan, nan, nan]], [[nan, nan, nan], [nan, nan, nan], [nan, nan, 1.], [ 1., nan, nan], [ 1., nan, nan], [nan, nan, nan], [nan, 1., nan], ... [nan, 1., nan], [nan, nan, nan], [ 1., nan, nan], [nan, nan, 1.], [nan, nan, nan], [nan, nan, nan], [nan, nan, nan]], [[nan, nan, nan], [nan, nan, 1.], [nan, nan, nan], [nan, nan, nan], [ 1., nan, nan], [nan, 1., nan], [nan, nan, nan], [ 1., nan, nan], [nan, nan, 1.], [nan, nan, nan], [nan, nan, nan], [nan, nan, nan]]])
- carrier_out(nodes, techs, carriers)float64nan nan 1.0 nan ... nan nan nan nan
- is_result :
- False
array([[[nan, nan, 1.], [nan, nan, 1.], [nan, nan, 1.], [nan, nan, nan], [nan, nan, nan], [nan, nan, nan], [nan, nan, nan], [nan, nan, nan], [nan, nan, nan], [nan, nan, nan], [nan, nan, nan], [nan, nan, nan]], [[nan, nan, nan], [nan, nan, nan], [nan, nan, 1.], [ 1., nan, nan], [ 1., nan, nan], [nan, nan, nan], [ 1., nan, 1.], ... [nan, nan, 1.], [nan, nan, nan], [nan, nan, nan], [nan, nan, nan], [ 1., nan, nan], [nan, 1., nan], [nan, nan, nan]], [[nan, nan, nan], [nan, nan, 1.], [nan, nan, nan], [nan, nan, nan], [ 1., nan, nan], [nan, nan, 1.], [nan, nan, nan], [nan, nan, nan], [nan, nan, nan], [ 1., nan, nan], [nan, 1., nan], [nan, nan, nan]]])
- color(techs)object'#823739' '#823739' ... '#C5ABE3'
- is_result :
- False
- default :
- nan
array(['#823739', '#823739', '#823739', '#6783E3', '#6783E3', '#8E2999', '#E4AB97', '#072486', '#660507', '#F9D956', '#C98AAD', '#C5ABE3'], dtype=object)
- cost_flow_cap_per_distance(techs, costs)float640.3 0.3 0.3 0.01 ... nan nan nan
- is_result :
- False
- default :
- 0
array([[0.3 ], [0.3 ], [0.3 ], [0.01], [0.01], [ nan], [ nan], [ nan], [ nan], [ nan], [ nan], [ nan]])
- cost_interest_rate(techs, costs)float640.1 0.1 0.1 0.1 ... nan 0.1 0.1 0.1
- is_result :
- False
- default :
- 0
array([[0.1], [0.1], [0.1], [0.1], [0.1], [0.1], [0.1], [nan], [nan], [0.1], [0.1], [0.1]])
- distance(techs)float643.0 4.0 3.0 10.0 ... nan nan nan
- is_result :
- False
- default :
- nan
array([ 3., 4., 3., 10., 5., nan, nan, nan, nan, nan, nan, nan])
- flow_cap_max(techs, carriers, nodes)float64nan nan nan nan ... nan nan nan nan
- is_result :
- False
- default :
- inf
array([[[ nan, nan, nan, nan], [ nan, nan, nan, nan], [2000., nan, 2000., nan]], [[ nan, nan, nan, nan], [ nan, nan, nan, nan], [2000., nan, nan, 2000.]], [[ nan, nan, nan, nan], [ nan, nan, nan, nan], [2000., 2000., nan, nan]], [[ nan, 2000., 2000., nan], [ nan, nan, nan, nan], [ nan, nan, nan, nan]], [[ nan, 2000., nan, 2000.], [ nan, nan, nan, nan], [ nan, nan, nan, nan]], ... [[ nan, nan, nan, nan], [ nan, nan, nan, nan], [ nan, nan, nan, nan]], [[ nan, nan, nan, nan], [ nan, nan, nan, nan], [ nan, nan, nan, nan]], [[ nan, 250., 250., 50.], [ nan, nan, nan, nan], [ nan, nan, nan, nan]], [[ nan, nan, nan, nan], [ nan, 2000., 2000., 2000.], [ nan, nan, nan, nan]], [[ nan, 2000., nan, nan], [ nan, nan, nan, nan], [ nan, nan, nan, nan]]])
- flow_out_eff_per_distance(techs)float640.975 0.975 0.975 ... nan nan nan
- is_result :
- False
- default :
- 1.0
array([0.975, 0.975, 0.975, nan, nan, nan, nan, nan, nan, nan, nan, nan])
- lifetime(techs)float6425.0 25.0 25.0 ... 25.0 25.0 25.0
- is_result :
- False
- default :
- inf
array([25., 25., 25., 25., 25., 25., 25., nan, nan, 25., 25., 25.])
- name(techs)object'District heat distribution' ......
- is_result :
- False
- default :
- nan
array(['District heat distribution', 'District heat distribution', 'District heat distribution', 'Electrical power distribution', 'Electrical power distribution', 'Natural gas boiler', 'Combined heat and power', 'Electrical demand', 'Heat demand', 'Solar photovoltaic power', 'Natural gas import', 'National grid import'], dtype=object)
- techs_inheritance(techs)object'interest_rate_setter,heat_pipes...
- is_result :
- False
array(['interest_rate_setter,heat_pipes', 'interest_rate_setter,heat_pipes', 'interest_rate_setter,heat_pipes', 'interest_rate_setter,power_lines', 'interest_rate_setter,power_lines', 'interest_rate_setter', 'interest_rate_setter', nan, nan, 'interest_rate_setter', 'interest_rate_setter', 'interest_rate_setter'], dtype=object)
- carrier_export(techs, carriers)float64nan nan nan nan ... nan nan nan nan
- is_result :
- False
array([[nan, nan, nan], [nan, nan, nan], [nan, nan, nan], [nan, nan, nan], [nan, nan, nan], [nan, nan, nan], [ 1., nan, nan], [nan, nan, nan], [nan, nan, nan], [ 1., nan, nan], [nan, nan, nan], [nan, nan, nan]])
- cost_flow_cap(nodes, techs, costs, carriers)float64nan nan nan nan ... nan nan nan nan
- is_result :
- False
- default :
- 0
array([[[[ nan, nan, nan]], [[ nan, nan, nan]], [[ nan, nan, nan]], [[ nan, nan, nan]], [[ nan, nan, nan]], [[ nan, nan, nan]], [[ nan, nan, nan]], [[ nan, nan, nan]], [[ nan, nan, nan]], [[ nan, nan, nan]], ... [[ nan, nan, nan]], [[ nan, nan, nan]], [[ nan, nan, nan]], [[ nan, nan, 7.80e+01]], [[ nan, nan, nan]], [[ nan, nan, nan]], [[ nan, nan, nan]], [[1.35e+03, nan, nan]], [[ nan, 1.00e+00, nan]], [[ nan, nan, nan]]]])
- cost_flow_out(techs, costs, carriers, nodes)float64nan nan nan nan ... nan nan nan nan
- is_result :
- False
- default :
- 0
array([[[[ nan, nan, nan, nan], [ nan, nan, nan, nan], [ nan, nan, nan, nan]]], [[[ nan, nan, nan, nan], [ nan, nan, nan, nan], [ nan, nan, nan, nan]]], [[[ nan, nan, nan, nan], [ nan, nan, nan, nan], [ nan, nan, nan, nan]]], [[[ nan, nan, nan, nan], [ nan, nan, nan, nan], [ nan, nan, nan, nan]]], ... [[[ nan, nan, nan, nan], [ nan, nan, nan, nan], [ nan, nan, nan, nan]]], [[[ nan, nan, -0.0203, nan], [ nan, nan, nan, nan], [ nan, nan, nan, nan]]], [[[ nan, nan, nan, nan], [ nan, nan, nan, nan], [ nan, nan, nan, nan]]], [[[ nan, nan, nan, nan], [ nan, nan, nan, nan], [ nan, nan, nan, nan]]]])
- flow_out_eff(techs, carriers)float64nan nan nan nan ... nan nan nan nan
- is_result :
- False
- default :
- 1.0
array([[ nan, nan, nan], [ nan, nan, nan], [ nan, nan, nan], [0.98 , nan, nan], [0.98 , nan, nan], [ nan, 0.85 , 0.85 ], [0.405, nan, nan], [ nan, nan, nan], [ nan, nan, nan], [ nan, nan, nan], [ nan, nan, nan], [ nan, nan, nan]])
- heat_to_power_ratio(techs)float64nan nan nan nan ... nan nan nan nan
- is_result :
- False
array([nan, nan, nan, nan, nan, nan, 0.8, nan, nan, nan, nan, nan])
- area_use_max(techs)float64nan nan nan nan ... 1.5e+03 nan nan
- is_result :
- False
- default :
- inf
array([ nan, nan, nan, nan, nan, nan, nan, nan, nan, 1500., nan, nan])
- area_use_per_flow_cap(techs)float64nan nan nan nan ... nan 7.0 nan nan
- is_result :
- False
- default :
- nan
array([nan, nan, nan, nan, nan, nan, nan, nan, nan, 7., nan, nan])
- flow_out_parasitic_eff(techs)float64nan nan nan nan ... 0.85 nan nan
- is_result :
- False
- default :
- 1.0
array([ nan, nan, nan, nan, nan, nan, nan, nan, nan, 0.85, nan, nan])
- source_unit(techs)objectnan nan nan ... 'per_area' nan nan
- is_result :
- False
- default :
- absolute
array([nan, nan, nan, nan, nan, nan, nan, nan, nan, 'per_area', nan, nan], dtype=object)
- cost_flow_in(techs, costs)float64nan nan nan nan ... nan 0.025 0.1
- is_result :
- False
- default :
- 0
array([[ nan], [ nan], [ nan], [ nan], [ nan], [0.004], [ nan], [ nan], [ nan], [ nan], [0.025], [0.1 ]])
- source_use_max(techs)float64nan nan nan nan ... nan nan inf inf
- is_result :
- False
- default :
- inf
array([nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, inf, inf])
- cost_export(nodes, techs, costs, carriers, timesteps)float64nan nan nan nan ... nan nan nan nan
- is_result :
- False
- default :
- 0
array([[[[[ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan]]], [[[ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan]]], [[[ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan]]], ..., [[[ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan], ... [ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan]]], ..., [[[ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan]]], [[[ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan]]], [[[ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan]]]]])
- cost_om_annual(nodes, techs, costs)float64nan nan nan nan ... -80.5 nan nan
- is_result :
- False
- default :
- 0
array([[[ nan], [ nan], [ nan], [ nan], [ nan], [ nan], [ nan], [ nan], [ nan], [ nan], [ nan], [ nan]], [[ nan], [ nan], [ nan], [ nan], [ nan], [ nan], [ nan], ... [ nan], [ nan], [ nan], [ nan], [ nan], [ nan], [ nan]], [[ nan], [ nan], [ nan], [ nan], [ nan], [ nan], [ nan], [ nan], [ nan], [-80.5], [ nan], [ nan]]])
- latitude(nodes)float6451.45 51.46 51.47 51.43
- is_result :
- False
array([51.4450766, 51.4596158, 51.4652373, 51.4287016])
- longitude(nodes)float64-0.1247 -0.1613 -0.1142 -0.1311
- is_result :
- False
array([-0.1247183, -0.1613446, -0.1141548, -0.1310635])
- available_area(nodes)float64nan 500.0 1.3e+03 900.0
- is_result :
- False
- default :
- inf
array([ nan, 500., 1300., 900.])
- source_use_equals(techs, timesteps)float64nan nan nan nan ... nan nan nan nan
- is_result :
- False
- default :
- nan
array([[ nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan], [ nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan], ... [ nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan], [ nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan]])
- sink_use_equals(timesteps, techs, nodes)float64nan nan nan nan ... nan nan nan nan
- is_result :
- False
- default :
- nan
array([[[nan, nan, nan, nan], [nan, nan, nan, nan], [nan, nan, nan, nan], ..., [nan, nan, nan, nan], [nan, nan, nan, nan], [nan, nan, nan, nan]], [[nan, nan, nan, nan], [nan, nan, nan, nan], [nan, nan, nan, nan], ..., [nan, nan, nan, nan], [nan, nan, nan, nan], [nan, nan, nan, nan]], [[nan, nan, nan, nan], [nan, nan, nan, nan], [nan, nan, nan, nan], ..., ... ..., [nan, nan, nan, nan], [nan, nan, nan, nan], [nan, nan, nan, nan]], [[nan, nan, nan, nan], [nan, nan, nan, nan], [nan, nan, nan, nan], ..., [nan, nan, nan, nan], [nan, nan, nan, nan], [nan, nan, nan, nan]], [[nan, nan, nan, nan], [nan, nan, nan, nan], [nan, nan, nan, nan], ..., [nan, nan, nan, nan], [nan, nan, nan, nan], [nan, nan, nan, nan]]])
- definition_matrix(nodes, techs, carriers)boolFalse False True ... False False
- is_result :
- False
array([[[False, False, True], [False, False, True], [False, False, True], [False, False, False], [False, False, False], [False, False, False], [False, False, False], [False, False, False], [False, False, False], [False, False, False], [False, False, False], [False, False, False]], [[False, False, False], [False, False, False], [False, False, True], [ True, False, False], [ True, False, False], [False, False, False], [ True, True, True], ... [False, True, True], [False, False, False], [ True, False, False], [False, False, True], [ True, False, False], [False, True, False], [False, False, False]], [[False, False, False], [False, False, True], [False, False, False], [False, False, False], [ True, False, False], [False, True, True], [False, False, False], [ True, False, False], [False, False, True], [ True, False, False], [False, True, False], [False, False, False]]])
- timestep_resolution(timesteps)float641.0 1.0 1.0 1.0 ... 1.0 1.0 1.0 1.0
- is_result :
- False
array([1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.])
- timestep_weights(timesteps)float641.0 1.0 1.0 1.0 ... 1.0 1.0 1.0 1.0
- is_result :
- False
array([1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.])
- costsPandasIndex
PandasIndex(Index(['monetary'], dtype='object', name='costs'))
- techsPandasIndex
PandasIndex(Index(['N1_to_X2', 'N1_to_X3', 'X1_to_N1', 'X1_to_X2', 'X1_to_X3', 'boiler', 'chp', 'demand_electricity', 'demand_heat', 'pv', 'supply_gas', 'supply_grid_power'], dtype='object', name='techs'))
- carriersPandasIndex
PandasIndex(Index(['electricity', 'gas', 'heat'], dtype='object', name='carriers'))
- nodesPandasIndex
PandasIndex(Index(['N1', 'X1', 'X2', 'X3'], dtype='object', name='nodes'))
- timestepsPandasIndex
PandasIndex(DatetimeIndex(['2005-07-01 00:00:00', '2005-07-01 01:00:00', '2005-07-01 02:00:00', '2005-07-01 03:00:00', '2005-07-01 04:00:00', '2005-07-01 05:00:00', '2005-07-01 06:00:00', '2005-07-01 07:00:00', '2005-07-01 08:00:00', '2005-07-01 09:00:00', '2005-07-01 10:00:00', '2005-07-01 11:00:00', '2005-07-01 12:00:00', '2005-07-01 13:00:00', '2005-07-01 14:00:00', '2005-07-01 15:00:00', '2005-07-01 16:00:00', '2005-07-01 17:00:00', '2005-07-01 18:00:00', '2005-07-01 19:00:00', '2005-07-01 20:00:00', '2005-07-01 21:00:00', '2005-07-01 22:00:00', '2005-07-01 23:00:00', '2005-07-02 00:00:00', '2005-07-02 01:00:00', '2005-07-02 02:00:00', '2005-07-02 03:00:00', '2005-07-02 04:00:00', '2005-07-02 05:00:00', '2005-07-02 06:00:00', '2005-07-02 07:00:00', '2005-07-02 08:00:00', '2005-07-02 09:00:00', '2005-07-02 10:00:00', '2005-07-02 11:00:00', '2005-07-02 12:00:00', '2005-07-02 13:00:00', '2005-07-02 14:00:00', '2005-07-02 15:00:00', '2005-07-02 16:00:00', '2005-07-02 17:00:00', '2005-07-02 18:00:00', '2005-07-02 19:00:00', '2005-07-02 20:00:00', '2005-07-02 21:00:00', '2005-07-02 22:00:00', '2005-07-02 23:00:00'], dtype='datetime64[ns]', name='timesteps', freq=None))
- calliope_version_defined :
- 0.7.0
- calliope_version_initialised :
- 0.7.0.dev2
- applied_overrides :
- scenario :
- None
- defaults :
- {'available_area': inf, 'bigM': 1000000000.0, 'objective_cost_weights': 1, 'area_use': inf, 'area_use_max': inf, 'area_use_min': 0, 'area_use_per_flow_cap': nan, 'cap_method': 'continuous', 'color': nan, 'cost_area_use': 0, 'cost_depreciation_rate': 1, 'cost_export': 0, 'cost_flow_cap': 0, 'cost_flow_cap_per_distance': 0, 'cost_flow_in': 0, 'cost_flow_out': 0, 'cost_interest_rate': 0, 'cost_om_annual': 0, 'cost_om_annual_investment_fraction': 0, 'cost_purchase': 0, 'cost_purchase_per_distance': 0, 'cost_source_cap': 0, 'cost_storage_cap': 0, 'cyclic_storage': True, 'distance': nan, 'export_max': inf, 'flow_cap': inf, 'flow_cap_max': inf, 'flow_cap_max_systemwide': inf, 'flow_cap_min': 0, 'flow_cap_min_systemwide': 0, 'flow_cap_per_storage_cap_max': inf, 'flow_cap_per_storage_cap_min': 0, 'flow_cap_per_unit': nan, 'flow_in_eff': 1.0, 'flow_in_eff_per_distance': 1.0, 'flow_out_eff': 1.0, 'flow_out_eff_per_distance': 1.0, 'flow_out_min_relative': 0, 'flow_out_parasitic_eff': 1.0, 'flow_ramping': 1.0, 'force_async_flow': False, 'include_storage': False, 'integer_dispatch': False, 'lifetime': inf, 'name': nan, 'one_way': False, 'purchased_units': inf, 'purchased_units_max': inf, 'purchased_units_max_systemwide': inf, 'purchased_units_min': 0, 'purchased_units_min_systemwide': 0, 'sink_unit': 'absolute', 'sink_use_equals': nan, 'sink_use_max': inf, 'sink_use_min': 0, 'source_cap': inf, 'source_cap_equals_flow_cap': False, 'source_cap_max': inf, 'source_cap_min': 0, 'source_eff': 1.0, 'source_unit': 'absolute', 'source_use_equals': nan, 'source_use_max': inf, 'source_use_min': 0, 'storage_cap': inf, 'storage_cap_max': inf, 'storage_cap_min': 0, 'storage_cap_per_unit': nan, 'storage_discharge_depth': 0, 'storage_initial': 0, 'storage_loss': 0}
- allow_operate_mode :
- 1
- config :
- {'build': {'backend': 'pyomo', 'ensure_feasibility': True, 'mode': 'plan', 'objective': 'min_cost_optimisation', 'operate_use_cap_results': False}, 'solve': {'save_logs': None, 'solver': 'cbc', 'solver_io': None, 'solver_options': None, 'spores_number': 3, 'spores_save_per_spore': False, 'spores_score_cost_class': 'spores_score', 'spores_skip_cost_op': False, 'zero_threshold': 1e-10}}
- applied_custom_math :
- ['custom_math.yaml']
- math :
- {'constraints': {'flow_capacity_per_storage_capacity_min': {'description': 'Set the lower bound of storage flow capacity relative to its storage capacity.', 'foreach': ['nodes', 'techs', 'carriers'], 'where': 'storage_cap AND flow_cap_per_storage_cap_min', 'equations': [{'expression': 'flow_cap >= storage_cap * flow_cap_per_storage_cap_min'}]}, 'flow_capacity_per_storage_capacity_max': {'description': 'Set the upper bound of storage flow capacity relative to its storage capacity.', 'foreach': ['nodes', 'techs', 'carriers'], 'where': 'storage_cap AND flow_cap_per_storage_cap_max', 'equations': [{'expression': 'flow_cap <= storage_cap * flow_cap_per_storage_cap_max'}]}, 'source_capacity_equals_flow_capacity': {'description': "Set a `supply` technology's flow capacity to equal its source capacity.", 'foreach': ['nodes', 'techs', 'carriers'], 'where': 'source_cap AND source_cap_equals_flow_cap=True', 'equations': [{'expression': 'source_cap == flow_cap'}]}, 'force_zero_area_use': {'description': "Set a technology's area use to zero if its flow capacity upper bound is zero.", 'foreach': ['nodes', 'techs'], 'where': 'area_use AND flow_cap_max=0', 'equations': [{'expression': 'area_use == 0'}]}, 'area_use_per_flow_capacity': {'description': "Set a fixed relationship between a technology's flow capacity and its area use.", 'foreach': ['nodes', 'techs', 'carriers'], 'where': 'area_use AND area_use_per_flow_cap', 'equations': [{'expression': 'area_use == flow_cap * area_use_per_flow_cap'}]}, 'area_use_capacity_per_loc': {'description': 'Set an upper bound on the total area that all technologies with `area_use` can occupy at a given node.', 'foreach': ['nodes'], 'where': 'area_use AND available_area', 'equations': [{'expression': 'sum(area_use, over=techs) <= available_area'}]}, 'flow_capacity_systemwide_max': {'description': 'Set an upper bound on flow capacity of a technology across all nodes in which the technology exists.', 'foreach': ['techs', 'carriers'], 'where': 'flow_cap_max_systemwide', 'equations': [{'expression': 'sum(flow_cap, over=nodes) <= flow_cap_max_systemwide'}]}, 'flow_capacity_systemwide_min': {'description': 'Set a lower bound on flow capacity of a technology across all nodes in which the technology exists.', 'foreach': ['techs', 'carriers'], 'where': 'flow_cap_min_systemwide', 'equations': [{'expression': 'sum(flow_cap, over=nodes) >= flow_cap_min_systemwide'}]}, 'balance_conversion': {'description': "Fix the relationship between a `conversion` technology's outflow and consumption.", 'foreach': ['nodes', 'techs', 'timesteps'], 'where': 'base_tech=conversion AND NOT include_storage=true', 'equations': [{'where': 'NOT [chp] in techs', 'expression': 'sum(flow_out_inc_eff, over=carriers) == sum(flow_in_inc_eff, over=carriers)'}, {'where': '[chp] in techs', 'expression': 'flow_out_inc_eff[carriers=electricity] == sum(flow_in_inc_eff, over=carriers)'}]}, 'flow_out_max': {'description': "Set the upper bound of a technology's outflow.", 'foreach': ['nodes', 'techs', 'carriers', 'timesteps'], 'where': 'carrier_out AND NOT operating_units', 'equations': [{'expression': 'flow_out <= flow_cap * timestep_resolution * flow_out_parasitic_eff'}]}, 'flow_out_min': {'description': "Set the lower bound of a technology's outflow.", 'foreach': ['nodes', 'techs', 'carriers', 'timesteps'], 'where': 'flow_out_min_relative AND NOT operating_units', 'equations': [{'expression': 'flow_out >= flow_cap * timestep_resolution * flow_out_min_relative'}]}, 'flow_in_max': {'description': "Set the upper bound of a technology's inflow.", 'foreach': ['nodes', 'techs', 'carriers', 'timesteps'], 'where': 'carrier_in AND NOT operating_units', 'equations': [{'expression': 'flow_in <= flow_cap * timestep_resolution'}]}, 'source_max': {'description': "Set the upper bound of a `supply` technology's source consumption.", 'foreach': ['nodes', 'techs', 'timesteps'], 'where': 'source_cap', 'equations': [{'expression': 'source_use <= timestep_resolution * source_cap'}]}, 'storage_max': {'description': 'Set the upper bound of the amount of carrier a technology can store.', 'foreach': ['nodes', 'techs', 'timesteps'], 'where': 'storage', 'equations': [{'expression': 'storage <= storage_cap'}]}, 'storage_discharge_depth_limit': {'description': 'Set the lower bound of the stored carrier a technology must keep in reserve at all times.', 'foreach': ['nodes', 'techs', 'timesteps'], 'where': 'storage AND storage_discharge_depth', 'equations': [{'expression': 'storage - storage_discharge_depth * storage_cap >= 0'}]}, 'system_balance': {'description': 'Set the global carrier balance of the optimisation problem by fixing the total production of a given carrier to equal the total consumption of that carrier at every node in every timestep.', 'foreach': ['nodes', 'carriers', 'timesteps'], 'equations': [{'expression': 'sum(flow_out, over=techs) - sum(flow_in, over=techs) - $flow_export + $unmet_demand_and_unused_supply == 0'}], 'sub_expressions': {'flow_export': [{'where': 'any(carrier_export, over=techs)', 'expression': 'sum(flow_export, over=techs)'}, {'where': 'NOT any(carrier_export, over=techs)', 'expression': '0'}], 'unmet_demand_and_unused_supply': [{'where': 'config.ensure_feasibility=True', 'expression': 'unmet_demand + unused_supply'}, {'where': 'NOT config.ensure_feasibility=True', 'expression': '0'}]}}, 'balance_demand': {'description': 'Set the upper bound on, or a fixed total of, that a demand technology must dump to its sink in each timestep.', 'foreach': ['nodes', 'techs', 'carriers', 'timesteps'], 'where': 'base_tech=demand', 'equations': [{'where': 'sink_use_equals', 'expression': 'flow_in_inc_eff == sink_use_equals * $sink_scaler'}, {'where': 'NOT sink_use_equals AND sink_use_max', 'expression': 'flow_in_inc_eff <= sink_use_max * $sink_scaler'}], 'sub_expressions': {'sink_scaler': [{'where': 'sink_unit=per_area', 'expression': 'area_use'}, {'where': 'sink_unit=per_cap', 'expression': 'sum(flow_cap, over=carriers)'}, {'where': 'sink_unit=absolute', 'expression': '1'}]}}, 'balance_demand_min_use': {'description': 'Set the lower bound on the quantity of flow a `demand` technology must dump to its sink in each timestep.', 'foreach': ['nodes', 'techs', 'carriers', 'timesteps'], 'where': 'sink_use_min AND NOT sink_use_equals AND base_tech=demand', 'equations': [{'expression': 'flow_in_inc_eff >= sink_use_min * $sink_scaler'}], 'sub_expressions': {'sink_scaler': [{'where': 'sink_unit=per_area', 'expression': 'area_use'}, {'where': 'sink_unit=per_cap', 'expression': 'sum(flow_cap, over=carriers)'}, {'where': 'sink_unit=absolute', 'expression': '1'}]}}, 'balance_supply_no_storage': {'description': 'Fix the outflow of a `supply` technology to its consumption of the available source.', 'foreach': ['nodes', 'techs', 'carriers', 'timesteps'], 'where': 'base_tech=supply AND NOT include_storage=True', 'equations': [{'expression': 'flow_out_inc_eff == source_use * source_eff'}]}, 'balance_supply_with_storage': {'description': 'Fix the outflow of a `supply` technology to its consumption of the available source, with a storage buffer to temporally offset the outflow from source consumption.', 'foreach': ['nodes', 'techs', 'carriers', 'timesteps'], 'where': 'storage AND base_tech=supply', 'equations': [{'expression': 'storage == $storage_previous_step + source_use * source_eff - flow_out_inc_eff'}], 'sub_expressions': {'storage_previous_step': [{'where': 'timesteps=get_val_at_index(timesteps=0) AND NOT cyclic_storage=True', 'expression': 'storage_initial * storage_cap'}, {'where': '(\n (timesteps=get_val_at_index(timesteps=0) AND cyclic_storage=True)\n OR NOT timesteps=get_val_at_index(timesteps=0)\n) AND NOT lookup_cluster_first_timestep=True', 'expression': '(1 - storage_loss) ** roll(timestep_resolution, timesteps=1) * roll(storage, timesteps=1)'}, {'where': 'lookup_cluster_first_timestep=True AND NOT (timesteps=get_val_at_index(timesteps=0) AND NOT cyclic_storage=True)', 'expression': '(1 - storage_loss) ** select_from_lookup_arrays(timestep_resolution, timesteps=lookup_cluster_last_timestep) * select_from_lookup_arrays(storage, timesteps=lookup_cluster_last_timestep)'}]}}, 'source_availability_supply': {'description': "Set the upper bound on, or a fixed total of, a `supply` technology's ability to consume its available resource.", 'foreach': ['nodes', 'techs', 'timesteps'], 'where': 'source_use AND (source_use_equals OR source_use_max)', 'equations': [{'where': 'source_use_equals', 'expression': 'source_use == source_use_equals * $source_scaler'}, {'where': 'NOT source_use_equals AND source_use_max', 'expression': 'source_use <= source_use_max * $source_scaler'}], 'sub_expressions': {'source_scaler': [{'where': 'source_unit=per_area', 'expression': 'area_use'}, {'where': 'source_unit=per_cap', 'expression': 'sum(flow_cap, over=carriers)'}, {'where': 'source_unit=absolute', 'expression': '1'}]}}, 'balance_supply_min_use': {'description': 'Set the lower bound on the quantity of its source a `supply` technology must use in each timestep.', 'foreach': ['nodes', 'techs', 'timesteps'], 'where': 'source_use_min AND NOT source_use_equals AND base_tech=supply', 'equations': [{'expression': 'source_use >= source_use_min * $source_scaler'}], 'sub_expressions': {'source_scaler': [{'where': 'source_unit=per_area', 'expression': 'area_use'}, {'where': 'source_unit=per_cap', 'expression': 'sum(flow_cap, over=carriers)'}, {'where': 'source_unit=absolute', 'expression': '1'}]}}, 'balance_storage': {'description': 'Fix the quantity of carrier stored in a `storage` technology at the end of each timestep based on the net flow of carrier charged and discharged and the quantity of carrier stored at the start of the timestep.', 'foreach': ['nodes', 'techs', 'timesteps'], 'where': '(include_storage=true or base_tech=storage) AND NOT (base_tech=supply OR base_tech=demand)', 'equations': [{'expression': 'storage == $storage_previous_step -\n sum(flow_out_inc_eff, over=carriers) + sum(flow_in_inc_eff, over=carriers)'}], 'sub_expressions': {'storage_previous_step': [{'where': 'timesteps=get_val_at_index(timesteps=0) AND NOT cyclic_storage=True', 'expression': 'storage_initial * storage_cap'}, {'where': '(\n (timesteps=get_val_at_index(timesteps=0) AND cyclic_storage=True)\n OR NOT timesteps=get_val_at_index(timesteps=0)\n) AND NOT lookup_cluster_first_timestep=True', 'expression': '(1 - storage_loss) ** roll(timestep_resolution, timesteps=1) * roll(storage, timesteps=1)'}, {'where': 'lookup_cluster_first_timestep=True AND NOT (timesteps=get_val_at_index(timesteps=0) AND NOT cyclic_storage=True)', 'expression': '(1 - storage_loss) ** select_from_lookup_arrays(timestep_resolution, timesteps=lookup_cluster_last_timestep) * select_from_lookup_arrays(storage, timesteps=lookup_cluster_last_timestep)'}]}}, 'set_storage_initial': {'description': 'Fix the relationship between carrier stored in a `storage` technology at the start and end of the whole model period.', 'foreach': ['nodes', 'techs'], 'where': 'storage AND storage_initial AND cyclic_storage=True', 'equations': [{'expression': 'storage[timesteps=$final_step] * (\n (1 - storage_loss) ** timestep_resolution[timesteps=$final_step]\n) == storage_initial * storage_cap'}], 'slices': {'final_step': [{'expression': 'get_val_at_index(timesteps=-1)'}]}, 'active': True}, 'balance_transmission': {'description': 'Fix the relationship between between carrier flowing into and out of a `transmission` link in each timestep.', 'foreach': ['techs', 'timesteps'], 'where': 'base_tech=transmission', 'equations': [{'expression': 'sum(flow_out_inc_eff, over=[nodes, carriers]) == sum(flow_in_inc_eff, over=[nodes, carriers])'}]}, 'symmetric_transmission': {'description': 'Fix the flow capacity of two `transmission` technologies representing the same link in the system.', 'foreach': ['nodes', 'techs'], 'where': 'base_tech=transmission', 'equations': [{'expression': 'sum(flow_cap, over=carriers) == link_flow_cap'}]}, 'export_balance': {'description': "Set the lower bound of a technology's outflow to a technology's carrier export, for any technologies that can export carriers out of the system.", 'foreach': ['nodes', 'techs', 'carriers', 'timesteps'], 'where': 'flow_export', 'equations': [{'expression': 'flow_out >= flow_export'}]}, 'flow_export_max': {'description': "Set the upper bound of a technology's carrier export, for any technologies that can export carriers out of the system.", 'foreach': ['nodes', 'techs', 'carriers', 'timesteps'], 'where': 'flow_export AND export_max', 'equations': [{'where': 'operating_units', 'expression': 'flow_export <= export_max * operating_units'}, {'where': 'NOT operating_units', 'expression': 'flow_export <= export_max'}]}, 'unit_commitment_milp': {'description': 'Set the upper bound of the number of integer units of technology that can exist, for any technology using integer units to define its capacity.', 'foreach': ['nodes', 'techs', 'timesteps'], 'where': 'operating_units AND purchased_units', 'equations': [{'expression': 'operating_units <= purchased_units'}]}, 'available_flow_cap_binary': {'description': 'Limit flow capacity to zero if the technology is not operating in a given timestep.', 'foreach': ['nodes', 'techs', 'carriers', 'timesteps'], 'where': 'available_flow_cap', 'equations': [{'expression': 'available_flow_cap <= flow_cap_max * operating_units'}]}, 'available_flow_cap_continuous': {'description': 'Limit flow capacity to the value of the `flow_cap` decision variable when the technology is operating in a given timestep.', 'foreach': ['nodes', 'techs', 'carriers', 'timesteps'], 'where': 'available_flow_cap', 'equations': [{'expression': 'available_flow_cap <= flow_cap'}]}, 'available_flow_cap_max_binary_continuous_switch': {'description': 'Force flow capacity to equal the value of the `flow_cap` decision variable if the technology is operating in a given timestep, zero otherwise.', 'foreach': ['nodes', 'techs', 'carriers', 'timesteps'], 'where': 'available_flow_cap', 'equations': [{'expression': 'available_flow_cap >= flow_cap + ((operating_units - purchased_units) * flow_cap_max)'}]}, 'flow_out_max_milp': {'description': "Set the upper bound of a technology's ability to produce carriers, for any technology using integer units to define its capacity.", 'foreach': ['nodes', 'techs', 'carriers', 'timesteps'], 'where': 'flow_out AND operating_units AND flow_cap_per_unit', 'equations': [{'expression': 'flow_out <= operating_units * timestep_resolution * flow_cap_per_unit * flow_out_parasitic_eff'}]}, 'flow_in_max_milp': {'description': "Set the upper bound of a technology's ability to consume carriers, for any technology using integer units to define its capacity.", 'foreach': ['nodes', 'techs', 'carriers', 'timesteps'], 'where': 'flow_in AND operating_units AND flow_cap_per_unit', 'equations': [{'expression': 'flow_in <= operating_units * timestep_resolution * flow_cap_per_unit'}]}, 'flow_out_min_milp': {'description': "Set the lower bound of a technology's ability to produce carriers, for any technology using integer units to define its capacity.", 'foreach': ['nodes', 'techs', 'carriers', 'timesteps'], 'where': 'flow_out AND operating_units AND flow_out_min_relative', 'equations': [{'where': 'flow_cap_per_unit', 'expression': 'flow_out >= operating_units * timestep_resolution * flow_cap_per_unit * flow_out_min_relative'}, {'where': 'available_flow_cap', 'expression': 'flow_out >= available_flow_cap * timestep_resolution * flow_out_min_relative'}]}, 'storage_capacity_units_milp': {'description': 'Fix the storage capacity of any technology using integer units to define its capacity.', 'foreach': ['nodes', 'techs', 'carriers'], 'where': 'storage AND purchased_units AND storage_cap_per_unit', 'equations': [{'expression': 'storage_cap == purchased_units * storage_cap_per_unit'}]}, 'flow_capacity_units_milp': {'description': 'Fix the flow capacity of any technology using integer units to define its capacity.', 'foreach': ['nodes', 'techs', 'carriers'], 'where': 'operating_units', 'equations': [{'where': 'flow_cap_per_unit', 'expression': 'flow_cap == purchased_units * flow_cap_per_unit'}, {'where': 'NOT flow_cap_per_unit', 'expression': 'flow_cap <= purchased_units * bigM'}]}, 'flow_capacity_max_purchase_milp': {'description': "Set the upper bound on a technology's flow capacity, for any technology with integer capacity purchasing.", 'foreach': ['nodes', 'techs', 'carriers'], 'where': 'purchased_units AND flow_cap_max', 'equations': [{'expression': 'flow_cap <= flow_cap_max * purchased_units'}]}, 'flow_capacity_min_purchase_milp': {'description': "Set the lower bound on a technology's flow capacity, for any technology with integer capacity purchasing.", 'foreach': ['nodes', 'techs', 'carriers'], 'where': 'purchased_units AND flow_cap_min', 'equations': [{'expression': 'flow_cap >= flow_cap_min * purchased_units'}]}, 'storage_capacity_max_purchase_milp': {'description': "Set the upper bound on a technology's storage capacity, for any technology with integer capacity purchasing.", 'foreach': ['nodes', 'techs'], 'where': 'purchased_units AND storage_cap_max', 'equations': [{'expression': 'storage_cap <= storage_cap_max * purchased_units'}]}, 'storage_capacity_min_purchase_milp': {'description': "Set the lower bound on a technology's storage capacity, for any technology with integer capacity purchasing.", 'foreach': ['nodes', 'techs'], 'where': 'purchased_units AND storage_cap_min', 'equations': [{'expression': 'storage_cap >= storage_cap_min * purchased_units'}]}, 'unit_capacity_max_systemwide_milp': {'description': 'Set the upper bound on the total number of units of a technology that can be purchased across all nodes where the technology can exist, for any technology using integer units to define its capacity.', 'foreach': ['techs'], 'where': 'purchased_units AND purchased_units_max_systemwide', 'equations': [{'expression': 'sum(purchased_units, over=nodes) <= purchased_units_max_systemwide'}]}, 'unit_capacity_min_systemwide_milp': {'description': 'Set the lower bound on the total number of units of a technology that can be purchased across all nodes where the technology can exist, for any technology using integer units to define its capacity.', 'foreach': ['techs'], 'where': 'purchased_units AND purchased_units_max_systemwide', 'equations': [{'expression': 'sum(purchased_units, over=nodes) >= purchased_units_min_systemwide'}]}, 'async_flow_in_milp': {'description': "Set a technology's ability to have inflow in the same timestep that it has outflow, for any technology using the asynchronous flow binary switch.", 'foreach': ['nodes', 'techs', 'timesteps'], 'where': 'async_flow_switch', 'equations': [{'expression': 'sum(flow_in, over=carriers) <= (1 - async_flow_switch) * bigM'}]}, 'async_flow_out_milp': {'description': "Set a technology's ability to have outflow in the same timestep that it has inflow, for any technology using the asynchronous flow binary switch.", 'foreach': ['nodes', 'techs', 'timesteps'], 'where': 'async_flow_switch', 'equations': [{'expression': 'sum(flow_out, over=carriers) <= async_flow_switch * bigM'}]}, 'ramping_up': {'description': "Set the upper bound on a technology's ability to ramp outflow up beyond a certain percentage compared to the previous timestep.", 'foreach': ['nodes', 'techs', 'carriers', 'timesteps'], 'where': 'flow_ramping AND NOT timesteps=get_val_at_index(timesteps=0)', 'equations': [{'expression': '$flow - roll($flow, timesteps=1) <= flow_ramping * flow_cap'}], 'sub_expressions': {'flow': [{'where': 'carrier_out AND NOT carrier_in', 'expression': 'flow_out / timestep_resolution'}, {'where': 'carrier_in AND NOT carrier_out', 'expression': 'flow_in / timestep_resolution'}, {'where': 'carrier_in AND carrier_out', 'expression': '(flow_out - flow_in) / timestep_resolution'}]}}, 'ramping_down': {'description': "Set the upper bound on a technology's ability to ramp outflow down beyond a certain percentage compared to the previous timestep.", 'foreach': ['nodes', 'techs', 'carriers', 'timesteps'], 'where': 'flow_ramping AND NOT timesteps=get_val_at_index(timesteps=0)', 'equations': [{'expression': '-1 * flow_ramping * flow_cap <= $flow - roll($flow, timesteps=1)'}], 'sub_expressions': {'flow': [{'where': 'carrier_out AND NOT carrier_in', 'expression': 'flow_out / timestep_resolution'}, {'where': 'carrier_in AND NOT carrier_out', 'expression': 'flow_in / timestep_resolution'}, {'where': 'carrier_in AND carrier_out', 'expression': '(flow_out - flow_in) / timestep_resolution'}]}}, 'link_chp_outputs': {'description': 'Fix the relationship between heat and electricity output', 'equations': [{'expression': 'flow_out[carriers=electricity] * heat_to_power_ratio == flow_out[carriers=heat]'}], 'foreach': ['nodes', 'techs', 'timesteps'], 'where': '[chp] in techs'}}, 'variables': {'flow_cap': {'description': "A technology's flow capacity, also known as its nominal or nameplate capacity.", 'unit': 'power', 'foreach': ['nodes', 'techs', 'carriers'], 'bounds': {'min': 'flow_cap_min', 'max': 'flow_cap_max'}}, 'link_flow_cap': {'description': "A transmission technology's flow capacity, also known as its nominal or nameplate capacity.", 'unit': 'power', 'foreach': ['techs'], 'where': 'base_tech=transmission', 'bounds': {'min': 0, 'max': inf}}, 'flow_out': {'description': 'The outflow of a technology per timestep, also known as the flow discharged (from `storage` technologies) or the flow received (by `transmission` technologies) on a link.', 'unit': 'energy', 'foreach': ['nodes', 'techs', 'carriers', 'timesteps'], 'where': 'carrier_out', 'bounds': {'min': 0, 'max': inf}}, 'flow_in': {'description': 'The inflow to a technology per timestep, also known as the flow consumed (by `storage` technologies) or the flow sent (by `transmission` technologies) on a link.', 'unit': 'energy', 'foreach': ['nodes', 'techs', 'carriers', 'timesteps'], 'where': 'carrier_in', 'bounds': {'min': 0, 'max': inf}}, 'flow_export': {'description': 'The flow of a carrier exported outside the system boundaries by a technology per timestep.', 'unit': 'energy', 'foreach': ['nodes', 'techs', 'carriers', 'timesteps'], 'where': 'carrier_export', 'bounds': {'min': 0, 'max': inf}}, 'area_use': {'description': 'The area in space utilised directly (e.g., solar PV panels) or indirectly (e.g., biofuel crops) by a technology.', 'unit': 'area', 'foreach': ['nodes', 'techs'], 'where': '(area_use_min OR area_use_max OR area_use_per_flow_cap OR sink_unit=per_area OR source_unit=per_area)', 'bounds': {'min': 'area_use_min', 'max': 'area_use_max'}}, 'source_use': {'description': 'The carrier flow consumed from outside the system boundaries by a `supply` technology.', 'unit': 'energy', 'foreach': ['nodes', 'techs', 'timesteps'], 'where': 'base_tech=supply', 'bounds': {'min': 0, 'max': inf}}, 'source_cap': {'description': 'The upper limit on a flow that can be consumed from outside the system boundaries by a `supply` technology in each timestep.', 'unit': 'power', 'foreach': ['nodes', 'techs'], 'where': 'base_tech=supply', 'bounds': {'min': 'source_cap_min', 'max': 'source_cap_max'}}, 'storage_cap': {'description': 'The upper limit on a carrier that can be stored by a technology in any timestep.', 'unit': 'energy', 'foreach': ['nodes', 'techs'], 'where': 'include_storage=True OR base_tech=storage', 'domain': 'real', 'bounds': {'min': 'storage_cap_min', 'max': 'storage_cap_max'}, 'active': True}, 'storage': {'description': 'The carrier stored by a `storage` technology in each timestep.', 'unit': 'energy', 'foreach': ['nodes', 'techs', 'timesteps'], 'where': 'include_storage=True OR base_tech=storage', 'bounds': {'min': 0, 'max': inf}}, 'purchased_units': {'description': 'Integer number of a technology that has been purchased,\nfor any technology set to require integer capacity purchasing.\nThis is used to allow installation of fixed capacity units of technologies (\nif `flow_cap_max` == `flow_cap_min`) and/or to set a fixed cost for a technology,\nirrespective of its installed capacity.\nOn top of a fixed technology cost,\na continuous cost for the quantity of installed capacity can still be applied.\n\nSince technology capacity is no longer a continuous decision variable,\nit is possible for these technologies to have a lower bound set on outflow/consumption\nwhich will only be enforced in those timesteps that the technology is operating.\nOtherwise, the same lower bound forces the technology to produce/consume\nthat minimum amount of carrier in *every* timestep.\n', 'unit': 'integer', 'foreach': ['nodes', 'techs'], 'where': 'cap_method=integer', 'domain': 'integer', 'bounds': {'min': 'purchased_units_min', 'max': 'purchased_units_max'}}, 'operating_units': {'description': 'Integer number of a technology that is operating in each timestep, for any technology set to require integer capacity purchasing.', 'unit': 'integer', 'foreach': ['nodes', 'techs', 'timesteps'], 'where': 'integer_dispatch=True AND cap_method=integer', 'domain': 'integer', 'bounds': {'min': 0, 'max': inf}}, 'available_flow_cap': {'description': 'Flow capacity that will be set to zero if the technology is not operating in a given timestep and will be set to the value of the decision variable `flow_cap` otherwise.', 'unit': 'power', 'foreach': ['nodes', 'techs', 'carriers', 'timesteps'], 'where': 'integer_dispatch=True AND flow_cap_max AND NOT flow_cap_per_unit', 'bounds': {'min': 0, 'max': inf}}, 'async_flow_switch': {'description': 'Binary switch to force asynchronous outflow/consumption of technologies with both `flow_in` and `flow_out` defined. This ensures that a technology with carrier flow efficiencies < 100% cannot produce and consume a flow simultaneously to remove unwanted carrier from the system.', 'unit': 'integer', 'foreach': ['nodes', 'techs', 'timesteps'], 'where': 'force_async_flow=True', 'domain': 'integer', 'bounds': {'min': 0, 'max': 1}}, 'unmet_demand': {'description': 'Virtual source of carrier flow to ensure model feasibility. This should only be considered a debugging rather than a modelling tool as it may distort the model in other ways due to the large impact it has on the objective function value. When present in a model in which it has been requested, it indicates an inability for technologies in the model to reach a sufficient combined supply capacity to meet demand.', 'unit': 'energy', 'foreach': ['nodes', 'carriers', 'timesteps'], 'where': 'config.ensure_feasibility=True', 'bounds': {'min': 0, 'max': inf}}, 'unused_supply': {'description': 'Virtual sink of carrier flow to ensure model feasibility. This should only be considered a debugging rather than a modelling tool as it may distort the model in other ways due to the large impact it has on the objective function value. In model results, the negation of this variable is combined with `unmet_demand` and presented as only one variable: `unmet_demand`. When present in a model in which it has been requested, it indicates an inability for technologies in the model to reach a sufficient combined consumption capacity to meet required outflow (e.g. from renewables without the possibility of curtailment).', 'unit': 'energy', 'foreach': ['nodes', 'carriers', 'timesteps'], 'where': 'config.ensure_feasibility=True', 'bounds': {'min': -inf, 'max': 0}}}, 'objectives': {'min_cost_optimisation': {'description': 'Minimise the total cost of installing and operating all technologies in the system. If multiple cost classes are present (e.g., monetary and co2 emissions), the weighted sum of total costs is minimised. Cost class weights can be defined in the indexed parameter `objective_cost_weights`.', 'equations': [{'where': 'any(cost, over=[nodes, techs, costs])', 'expression': 'sum(\n sum(cost, over=[nodes, techs])\n * objective_cost_weights,\n over=costs\n) + $unmet_demand'}, {'where': 'NOT any(cost, over=[nodes, techs, costs])', 'expression': '$unmet_demand'}], 'sub_expressions': {'unmet_demand': [{'where': 'config.ensure_feasibility=True', 'expression': 'sum(\n sum(unmet_demand - unused_supply, over=[carriers, nodes])\n * timestep_weights,\n over=timesteps\n) * bigM'}, {'where': 'NOT config.ensure_feasibility=True', 'expression': '0'}]}, 'sense': 'minimise', 'active': True}}, 'global_expressions': {'flow_out_inc_eff': {'description': 'Outflows after taking efficiency losses into account.', 'foreach': ['nodes', 'techs', 'carriers', 'timesteps'], 'where': 'flow_out', 'equations': [{'where': 'base_tech=transmission', 'expression': 'flow_out / (\n flow_out_eff * flow_out_parasitic_eff *\n flow_out_eff_per_distance ** default_if_empty(distance, 1)\n)'}, {'where': 'NOT base_tech=transmission', 'expression': 'flow_out / (flow_out_eff * flow_out_parasitic_eff)'}]}, 'flow_in_inc_eff': {'description': 'Inflows after taking efficiency losses into account.', 'foreach': ['nodes', 'techs', 'carriers', 'timesteps'], 'where': 'flow_in', 'equations': [{'where': 'base_tech=transmission', 'expression': 'flow_in * flow_in_eff * flow_in_eff_per_distance ** default_if_empty(distance, 1)'}, {'where': 'NOT base_tech=transmission', 'expression': 'flow_in * flow_in_eff'}]}, 'cost_var': {'description': 'The operating costs per timestep of a technology.', 'unit': 'cost_per_time', 'foreach': ['nodes', 'techs', 'costs', 'timesteps'], 'where': 'cost_export OR cost_flow_in OR cost_flow_out', 'equations': [{'expression': 'timestep_weights * ($cost_export + $cost_flow_out + $cost_flow_in)'}], 'sub_expressions': {'cost_export': [{'where': 'flow_export', 'expression': 'sum(cost_export * default_if_empty(flow_export, 0), over=carriers)'}, {'where': 'NOT flow_export', 'expression': '0'}], 'cost_flow_in': [{'where': 'base_tech=supply', 'expression': 'cost_flow_in * source_use'}, {'where': 'NOT base_tech=supply', 'expression': 'sum(cost_flow_in * default_if_empty(flow_in, 0), over=carriers)'}], 'cost_flow_out': [{'expression': 'sum(cost_flow_out * default_if_empty(flow_out, 0), over=carriers)'}]}}, 'cost_investment_flow_cap': {'description': 'The investment costs associated with the nominal/rated capacity of a technology.', 'foreach': ['nodes', 'techs', 'carriers', 'costs'], 'where': 'flow_cap AND (cost_flow_cap OR cost_flow_cap_per_distance)', 'equations': [{'expression': '$cost_sum * flow_cap'}], 'sub_expressions': {'cost_sum': [{'where': 'base_tech=transmission', 'expression': '(cost_flow_cap + cost_flow_cap_per_distance * default_if_empty(distance, 0)) * 0.5'}, {'where': 'NOT base_tech=transmission', 'expression': 'cost_flow_cap'}]}}, 'cost_investment_storage_cap': {'description': 'The investment costs associated with the storage capacity of a technology.', 'foreach': ['nodes', 'techs', 'costs'], 'where': 'cost_storage_cap AND storage_cap', 'equations': [{'expression': 'cost_storage_cap * storage_cap'}]}, 'cost_investment_source_cap': {'description': 'The investment costs associated with the source consumption capacity of a technology.', 'foreach': ['nodes', 'techs', 'costs'], 'where': 'cost_source_cap AND source_cap', 'equations': [{'expression': 'cost_source_cap * source_cap'}]}, 'cost_investment_area_use': {'description': 'The investment costs associated with the area used by a technology.', 'foreach': ['nodes', 'techs', 'costs'], 'where': 'cost_area_use AND area_use', 'equations': [{'expression': 'cost_area_use * area_use'}]}, 'cost_investment_purchase': {'description': 'The investment costs associated with the binary purchase of a technology.', 'foreach': ['nodes', 'techs', 'costs'], 'where': 'cost_purchase AND purchased_units', 'equations': [{'where': 'base_tech=transmission', 'expression': '(cost_purchase + cost_purchase_per_distance * default_if_empty(distance, 0)) * purchased_units * 0.5'}, {'where': 'NOT base_tech=transmission', 'expression': 'cost_purchase * purchased_units'}]}, 'cost_investment': {'description': 'The installation costs of a technology, including annualised investment costs and annual maintenance costs.', 'unit': 'cost', 'foreach': ['nodes', 'techs', 'costs'], 'where': 'cost_investment_flow_cap OR cost_investment_storage_cap OR cost_investment_source_cap OR cost_investment_area_use OR cost_investment_purchase', 'equations': [{'expression': '$annualisation_weight * (\n $depreciation_rate * (\n sum(default_if_empty(cost_investment_flow_cap, 0), over=carriers) +\n default_if_empty(cost_investment_storage_cap, 0) +\n default_if_empty(cost_investment_source_cap, 0) +\n default_if_empty(cost_investment_area_use, 0) +\n default_if_empty(cost_investment_purchase, 0)\n ) * (1 + cost_om_annual_investment_fraction)\n + sum(cost_om_annual * default_if_empty(flow_cap, 0), over=carriers)\n)\n'}], 'sub_expressions': {'annualisation_weight': [{'expression': 'sum(timestep_resolution * timestep_weights, over=timesteps) / 8760'}], 'depreciation_rate': [{'where': 'cost_depreciation_rate', 'expression': 'cost_depreciation_rate'}, {'where': 'NOT cost_depreciation_rate AND cost_interest_rate=0', 'expression': '1 / lifetime'}, {'where': 'NOT cost_depreciation_rate AND cost_interest_rate>0', 'expression': '(cost_interest_rate * ((1 + cost_interest_rate) ** lifetime)) / (((1 + cost_interest_rate) ** lifetime) - 1)'}]}}, 'cost': {'description': 'The total annualised costs of a technology, including installation and operation costs.', 'unit': 'cost', 'foreach': ['nodes', 'techs', 'costs'], 'where': 'cost_investment OR cost_var', 'equations': [{'expression': '$cost_investment + $cost_var_sum'}], 'sub_expressions': {'cost_investment': [{'where': 'cost_investment', 'expression': 'cost_investment'}, {'where': 'NOT cost_investment', 'expression': '0'}], 'cost_var_sum': [{'where': 'cost_var', 'expression': 'sum(cost_var, over=timesteps)'}, {'where': 'NOT cost_var', 'expression': '0'}]}, 'active': True}}}
- name :
- Urban-scale example model
Individual data variables can be accessed easily, to_series().dropna()
allows us to view the data in a nice tabular format.
model.inputs.flow_cap_max.to_series().dropna()
techs carriers nodes N1_to_X2 heat N1 2000.0 X2 2000.0 N1_to_X3 heat N1 2000.0 X3 2000.0 X1_to_N1 heat N1 2000.0 X1 2000.0 X1_to_X2 electricity X1 2000.0 X2 2000.0 X1_to_X3 electricity X1 2000.0 X3 2000.0 boiler heat X2 600.0 X3 600.0 chp electricity X1 1500.0 pv electricity X1 250.0 X2 250.0 X3 50.0 supply_gas gas X1 2000.0 X2 2000.0 X3 2000.0 supply_grid_power electricity X1 2000.0 Name: flow_cap_max, dtype: float64
You can apply node/tech/carrier/timesteps only operations, like summing information over timesteps
model.inputs.sink_use_equals.sum(
"timesteps", min_count=1, skipna=True
).to_series().dropna()
techs nodes demand_electricity X1 35.271156 X2 8796.878622 X3 1244.604116 demand_heat X1 33.999992 X2 7147.808356 X3 50.567751 Name: sink_use_equals, dtype: float64
Build and solve the optimisation problem.¶
Results are loaded into model.results
.
By setting the log verbosity at the start of this tutorial to "INFO", we can see the timing of parts of the run, as well as the solver's log.
model.build()
model.solve()
[2024-01-27 14:24:56] INFO Optimisation Model | parameters | Generated.
[2024-01-27 14:24:56] INFO Optimisation Model | variables | Generated.
[2024-01-27 14:24:57] INFO Optimisation Model | global_expressions | Generated.
[2024-01-27 14:24:59] INFO Optimisation Model | constraints | Generated.
[2024-01-27 14:24:59] INFO Optimisation Model | objectives | Generated.
[2024-01-27 14:24:59] INFO Optimisation model | starting model in plan mode.
[2024-01-27 14:24:59] INFO Backend: solver finished running. Time since start of solving optimisation problem: 0:00:00.457629
[2024-01-27 14:24:59] INFO Postprocessing: started
[2024-01-27 14:24:59] INFO Postprocessing: zero threshold of 1e-10 not required
[2024-01-27 14:24:59] INFO Postprocessing: ended. Time since start of solving optimisation problem: 0:00:00.616718
[2024-01-27 14:24:59] INFO Model: loaded model_data
Model results are held in the same structure as model inputs. The results consist of the optimal values for all decision variables, including capacities and carrier flow. There are also results, like system capacity factor and levelised costs, which are calculated in postprocessing before being added to the results Dataset
Examine results¶
model.results
<xarray.Dataset> Dimensions: (nodes: 4, techs: 12, carriers: 3, timesteps: 48, costs: 1) Coordinates: * techs (techs) object 'N1_to_X2' ... 'supply_grid_po... * carriers (carriers) <U11 'electricity' 'gas' 'heat' * nodes (nodes) object 'N1' 'X1' 'X2' 'X3' * timesteps (timesteps) datetime64[ns] 2005-07-01 ... 200... * costs (costs) object 'monetary' Data variables: (12/19) flow_cap (nodes, techs, carriers) float64 nan nan ... nan link_flow_cap (techs) float64 190.2 10.38 569.1 ... nan nan flow_out (nodes, techs, carriers, timesteps) float64 n... flow_in (nodes, techs, carriers, timesteps) float64 n... flow_export (nodes, techs, carriers, timesteps) float64 n... area_use (nodes, techs) float64 nan nan nan ... nan nan ... ... cost_investment (nodes, techs, costs) float64 0.05168 ... nan cost (nodes, techs, costs) float64 0.05168 ... nan capacity_factor (nodes, techs, carriers, timesteps) float64 0... systemwide_capacity_factor (techs, carriers) float64 0.0 0.0 ... 0.0 0.0 systemwide_levelised_cost (carriers, techs, costs) float64 nan nan ... nan total_levelised_cost (carriers, costs) float64 0.08069 ... 0.09578 Attributes: termination_condition: optimal calliope_version_defined: 0.7.0 calliope_version_initialised: 0.7.0.dev2 applied_overrides: scenario: None defaults: {'available_area': inf, 'bigM': 1000000000... allow_operate_mode: 1 config: {'build': {'backend': 'pyomo', 'ensure_fea... applied_custom_math: ['custom_math.yaml'] math: {'constraints': {'flow_capacity_per_storag... name: Urban-scale example model
- nodes: 4
- techs: 12
- carriers: 3
- timesteps: 48
- costs: 1
- techs(techs)object'N1_to_X2' ... 'supply_grid_power'
array(['N1_to_X2', 'N1_to_X3', 'X1_to_N1', 'X1_to_X2', 'X1_to_X3', 'boiler', 'chp', 'demand_electricity', 'demand_heat', 'pv', 'supply_gas', 'supply_grid_power'], dtype=object)
- carriers(carriers)<U11'electricity' 'gas' 'heat'
array(['electricity', 'gas', 'heat'], dtype='<U11')
- nodes(nodes)object'N1' 'X1' 'X2' 'X3'
array(['N1', 'X1', 'X2', 'X3'], dtype=object)
- timesteps(timesteps)datetime64[ns]2005-07-01 ... 2005-07-02T23:00:00
array(['2005-07-01T00:00:00.000000000', '2005-07-01T01:00:00.000000000', '2005-07-01T02:00:00.000000000', '2005-07-01T03:00:00.000000000', '2005-07-01T04:00:00.000000000', '2005-07-01T05:00:00.000000000', '2005-07-01T06:00:00.000000000', '2005-07-01T07:00:00.000000000', '2005-07-01T08:00:00.000000000', '2005-07-01T09:00:00.000000000', '2005-07-01T10:00:00.000000000', '2005-07-01T11:00:00.000000000', '2005-07-01T12:00:00.000000000', '2005-07-01T13:00:00.000000000', '2005-07-01T14:00:00.000000000', '2005-07-01T15:00:00.000000000', '2005-07-01T16:00:00.000000000', '2005-07-01T17:00:00.000000000', '2005-07-01T18:00:00.000000000', '2005-07-01T19:00:00.000000000', '2005-07-01T20:00:00.000000000', '2005-07-01T21:00:00.000000000', '2005-07-01T22:00:00.000000000', '2005-07-01T23:00:00.000000000', '2005-07-02T00:00:00.000000000', '2005-07-02T01:00:00.000000000', '2005-07-02T02:00:00.000000000', '2005-07-02T03:00:00.000000000', '2005-07-02T04:00:00.000000000', '2005-07-02T05:00:00.000000000', '2005-07-02T06:00:00.000000000', '2005-07-02T07:00:00.000000000', '2005-07-02T08:00:00.000000000', '2005-07-02T09:00:00.000000000', '2005-07-02T10:00:00.000000000', '2005-07-02T11:00:00.000000000', '2005-07-02T12:00:00.000000000', '2005-07-02T13:00:00.000000000', '2005-07-02T14:00:00.000000000', '2005-07-02T15:00:00.000000000', '2005-07-02T16:00:00.000000000', '2005-07-02T17:00:00.000000000', '2005-07-02T18:00:00.000000000', '2005-07-02T19:00:00.000000000', '2005-07-02T20:00:00.000000000', '2005-07-02T21:00:00.000000000', '2005-07-02T22:00:00.000000000', '2005-07-02T23:00:00.000000000'], dtype='datetime64[ns]')
- costs(costs)object'monetary'
array(['monetary'], dtype=object)
- flow_cap(nodes, techs, carriers)float64nan nan 190.2 nan ... nan nan nan
- description :
- A technology's flow capacity, also known as its nominal or nameplate capacity.
- unit :
- power
- is_result :
- 1
array([[[ nan, nan, 1.9024262e+02], [ nan, nan, 1.0382599e+01], [ nan, nan, 5.6912593e+02], [ nan, nan, nan], [ nan, nan, nan], [ nan, nan, nan], [ nan, nan, nan], [ nan, nan, nan], [ nan, nan, nan], [ nan, nan, nan], [ nan, nan, nan], [ nan, nan, nan]], [[ nan, nan, nan], [ nan, nan, nan], [ nan, nan, 5.6912593e+02], [2.7451170e+02, nan, nan], [4.5778336e+01, nan, nan], [ nan, nan, nan], [2.6094670e+02, 6.4431283e+02, 2.0875736e+02], ... [ nan, 2.2685938e+02, 1.9283047e+02], [ nan, nan, nan], [2.6934435e+02, nan, nan], [ nan, nan, 3.6513767e+02], [6.3309509e+01, nan, nan], [ nan, 2.2685938e+02, nan], [ nan, nan, nan]], [[ nan, nan, nan], [ nan, nan, 1.0382599e+01], [ nan, nan, nan], [ nan, nan, nan], [4.5778336e+01, nan, nan], [ nan, 1.8352941e-02, 1.5600000e-02], [ nan, nan, nan], [6.4927357e+01, nan, nan], [ nan, nan, 9.3982291e+00], [5.0000000e+01, nan, nan], [ nan, 1.8352941e-02, nan], [ nan, nan, nan]]])
- link_flow_cap(techs)float64190.2 10.38 569.1 ... nan nan nan
- description :
- A transmission technology's flow capacity, also known as its nominal or nameplate capacity.
- unit :
- power
- is_result :
- 1
array([190.24262 , 10.382599, 569.12593 , 274.5117 , 45.778336, nan, nan, nan, nan, nan, nan, nan])
- flow_out(nodes, techs, carriers, timesteps)float64nan nan nan nan ... nan nan nan nan
- description :
- The outflow of a technology per timestep, also known as the flow discharged (from `storage` technologies) or the flow received (by `transmission` technologies) on a link.
- unit :
- energy
- is_result :
- 1
array([[[[ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan], [5.2099378e+01, 0.0000000e+00, 0.0000000e+00, ..., 0.0000000e+00, 0.0000000e+00, 0.0000000e+00]], [[ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan], [8.3685615e+00, 0.0000000e+00, 0.0000000e+00, ..., 0.0000000e+00, 0.0000000e+00, 0.0000000e+00]], [[ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan], [8.5869798e+01, 7.2541074e+01, 7.2915564e+01, ..., 1.6303621e+02, 1.1680008e+02, 9.2852036e+01]], ... [[0.0000000e+00, 0.0000000e+00, 0.0000000e+00, ..., 0.0000000e+00, 0.0000000e+00, 0.0000000e+00], [ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan]], [[ nan, nan, nan, ..., nan, nan, nan], [0.0000000e+00, 1.8352941e-02, 1.8352941e-02, ..., 1.8352941e-02, 1.8352941e-02, 1.8352941e-02], [ nan, nan, nan, ..., nan, nan, nan]], [[ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan]]]])
- flow_in(nodes, techs, carriers, timesteps)float64nan nan nan nan ... nan nan nan nan
- description :
- The inflow to a technology per timestep, also known as the flow consumed (by `storage` technologies) or the flow sent (by `transmission` technologies) on a link.
- unit :
- energy
- is_result :
- 1
array([[[[ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan], [135.95514 , 71.606325 , 72.915564 , ..., 162.10148 , 116.80008 , 91.917322 ]], [[ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan], [ 10.382599 , 0.93474975, 0. , ..., 0.93472555, 0. , 0.93471415]], [[ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]], ... [[ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan]], [[ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan]], [[ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan]]]])
- flow_export(nodes, techs, carriers, timesteps)float64nan nan nan nan ... nan nan nan nan
- description :
- The flow of a carrier exported outside the system boundaries by a technology per timestep.
- unit :
- energy
- is_result :
- 1
array([[[[nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan]], [[nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan]], [[nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan]], ..., [[nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan]], [[nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan], ... [nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan]], [[nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan]], ..., [[ 0., 0., 0., ..., 0., 0., 0.], [nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan]], [[nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan]], [[nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan]]]])
- area_use(nodes, techs)float64nan nan nan nan ... 350.0 nan nan
- description :
- The area in space utilised directly (e.g., solar PV panels) or indirectly (e.g., biofuel crops) by a technology.
- unit :
- area
- is_result :
- 1
array([[ nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan], [ nan, nan, nan, nan, nan, nan, nan, nan, nan, 0. , nan, nan], [ nan, nan, nan, nan, nan, nan, nan, nan, nan, 443.16656, nan, nan], [ nan, nan, nan, nan, nan, nan, nan, nan, nan, 350. , nan, nan]])
- source_use(nodes, techs, timesteps)float64nan nan nan nan ... nan nan nan nan
- description :
- The carrier flow consumed from outside the system boundaries by a `supply` technology.
- unit :
- energy
- is_result :
- 1
array([[[ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan], ..., [ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan]], [[ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan], ... [ 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, ..., 0.0000000e+00, 0.0000000e+00, 0.0000000e+00], [-0.0000000e+00, 4.8052305e+00, 1.1306472e+01, ..., 1.0563477e+02, 4.1552015e+01, 1.0442145e+00], [ nan, nan, nan, ..., nan, nan, nan]], [[ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan], ..., [ 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, ..., 0.0000000e+00, 0.0000000e+00, 0.0000000e+00], [-0.0000000e+00, 1.8352941e-02, 1.8352941e-02, ..., 1.8352941e-02, 1.8352941e-02, 1.8352941e-02], [ nan, nan, nan, ..., nan, nan, nan]]])
- source_cap(nodes, techs)float64nan nan nan ... 38.95 0.01835 nan
- description :
- The upper limit on a flow that can be consumed from outside the system boundaries by a `supply` technology in each timestep.
- unit :
- power
- is_result :
- 1
array([[ nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan], [ nan, nan, nan, nan, nan, nan, nan, nan, nan, 0.0000000e+00, 6.4431283e+02, 3.3620147e+01], [ nan, nan, nan, nan, nan, nan, nan, nan, nan, 4.9318107e+01, 2.2685938e+02, nan], [ nan, nan, nan, nan, nan, nan, nan, nan, nan, 3.8950000e+01, 1.8352941e-02, nan]])
- unmet_demand(nodes, carriers, timesteps)float64nan nan nan nan ... 0.0 0.0 0.0 0.0
- is_result :
- 1
array([[[nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan], [nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan], [ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]], [[ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.], [ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., ... 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.], [ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]], [[ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.], [ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.], [ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]]])
- flow_out_inc_eff(nodes, techs, carriers, timesteps)float64nan nan nan nan ... nan nan nan nan
- description :
- Outflows after taking efficiency losses into account.
- is_result :
- 1
array([[[[ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan], [5.62106609e+01, 0.00000000e+00, 0.00000000e+00, ..., 0.00000000e+00, 0.00000000e+00, 0.00000000e+00]], [[ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan], [9.26045550e+00, 0.00000000e+00, 0.00000000e+00, ..., 0.00000000e+00, 0.00000000e+00, 0.00000000e+00]], [[ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan], [9.26459831e+01, 7.82654586e+01, 7.86695004e+01, ..., 1.75901776e+02, 1.26017045e+02, 1.00179206e+02]], ... [[0.00000000e+00, 0.00000000e+00, 0.00000000e+00, ..., 0.00000000e+00, 0.00000000e+00, 0.00000000e+00], [ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan]], [[ nan, nan, nan, ..., nan, nan, nan], [0.00000000e+00, 1.83529410e-02, 1.83529410e-02, ..., 1.83529410e-02, 1.83529410e-02, 1.83529410e-02], [ nan, nan, nan, ..., nan, nan, nan]], [[ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan]]]])
- flow_in_inc_eff(nodes, techs, carriers, timesteps)float64nan nan nan nan ... nan nan nan nan
- description :
- Inflows after taking efficiency losses into account.
- is_result :
- 1
array([[[[ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan], [135.95514 , 71.606325 , 72.915564 , ..., 162.10148 , 116.80008 , 91.917322 ]], [[ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan], [ 10.382599 , 0.93474975, 0. , ..., 0.93472555, 0. , 0.93471415]], [[ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]], ... [[ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan]], [[ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan]], [[ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan]]]])
- cost_var(nodes, techs, costs, timesteps)float64nan nan nan nan ... nan nan nan nan
- description :
- The operating costs per timestep of a technology.
- unit :
- cost_per_time
- is_result :
- 1
array([[[[ nan, nan, nan, ..., nan, nan, nan]], [[ nan, nan, nan, ..., nan, nan, nan]], [[ nan, nan, nan, ..., nan, nan, nan]], ..., [[ nan, nan, nan, ..., nan, nan, nan]], [[ nan, nan, nan, ..., nan, nan, nan]], [[ nan, nan, nan, ..., nan, nan, nan]]], ... [[[ nan, nan, nan, ..., nan, nan, nan]], [[ nan, nan, nan, ..., nan, nan, nan]], [[ nan, nan, nan, ..., nan, nan, nan]], ..., [[ nan, nan, nan, ..., nan, nan, nan]], [[0.00000000e+00, 4.58823525e-04, 4.58823525e-04, ..., 4.58823525e-04, 4.58823525e-04, 4.58823525e-04]], [[ nan, nan, nan, ..., nan, nan, nan]]]])
- cost_investment_flow_cap(nodes, techs, carriers, costs)float64nan nan 85.61 nan ... nan nan nan
- description :
- The investment costs associated with the nominal/rated capacity of a technology.
- is_result :
- 1
array([[[[ nan], [ nan], [8.56091790e+01]], [[ nan], [ nan], [6.22955940e+00]], [[ nan], [ nan], [2.56106669e+02]], [[ nan], [ nan], [ nan]], [[ nan], [ nan], [ nan]], ... [[ nan], [ nan], [ nan]], [[ nan], [ nan], [ nan]], [[6.75000000e+04], [ nan], [ nan]], [[ nan], [1.83529410e-02], [ nan]], [[ nan], [ nan], [ nan]]]])
- cost_investment(nodes, techs, costs)float640.05168 0.003761 ... 1.108e-05 nan
- description :
- The installation costs of a technology, including annualised investment costs and annual maintenance costs.
- unit :
- cost
- is_result :
- 1
array([[[5.16788943e-02], [3.76054000e-03], [1.54601523e-01], [ nan], [ nan], [ nan], [ nan], [ nan], [ nan], [ nan], [ nan], [ nan]], [[ nan], [ nan], [1.54601523e-01], [8.28559583e-03], [6.90864524e-04], [ nan], [1.18142445e+02], ... [5.01701975e+00], [ nan], [ nan], [ nan], [5.15935718e+01], [1.36946085e-01], [ nan]], [[ nan], [3.76054000e-03], [ nan], [ nan], [6.90864524e-04], [7.34534303e-04], [ nan], [ nan], [ nan], [1.86923007e+01], [1.10789487e-05], [ nan]]])
- cost(nodes, techs, costs)float640.05168 0.003761 ... 0.01102 nan
- description :
- The total annualised costs of a technology, including installation and operation costs.
- unit :
- cost
- is_result :
- 1
array([[[5.16788943e-02], [3.76054000e-03], [1.54601523e-01], [ nan], [ nan], [ nan], [ nan], [ nan], [ nan], [ nan], [ nan], [ nan]], [[ nan], [ nan], [1.54601523e-01], [8.28559583e-03], [6.90864524e-04], [ nan], [1.54998802e+02], ... [1.17131167e+01], [ nan], [ nan], [ nan], [3.05980984e+01], [4.19875519e+01], [ nan]], [[ nan], [3.76054000e-03], [ nan], [ nan], [6.90864524e-04], [2.49641664e-03], [ nan], [ nan], [ nan], [1.86923007e+01], [1.10228435e-02], [ nan]]])
- capacity_factor(nodes, techs, carriers, timesteps)float640.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0
- is_result :
- 1
array([[[[0. , 0. , 0. , ..., 0. , 0. , 0. ], [0. , 0. , 0. , ..., 0. , 0. , 0. ], [0.27385755, 0. , 0. , ..., 0. , 0. , 0. ]], [[0. , 0. , 0. , ..., 0. , 0. , 0. ], [0. , 0. , 0. , ..., 0. , 0. , 0. ], [0.80601798, 0. , 0. , ..., 0. , 0. , 0. ]], [[0. , 0. , 0. , ..., 0. , 0. , 0. ], [0. , 0. , 0. , ..., 0. , 0. , 0. ], [0.15088014, 0.1274605 , 0.12811851, ..., 0.28646772, 0.20522713, 0.16314849]], ... [[0. , 0. , 0. , ..., 0. , 0. , 0. ], [0. , 0. , 0. , ..., 0. , 0. , 0. ], [0. , 0. , 0. , ..., 0. , 0. , 0. ]], [[0. , 0. , 0. , ..., 0. , 0. , 0. ], [0. , 1. , 1. , ..., 1. , 1. , 1. ], [0. , 0. , 0. , ..., 0. , 0. , 0. ]], [[0. , 0. , 0. , ..., 0. , 0. , 0. ], [0. , 0. , 0. , ..., 0. , 0. , 0. ], [0. , 0. , 0. , ..., 0. , 0. , 0. ]]]])
- systemwide_capacity_factor(techs, carriers)float640.0 0.0 0.4215 ... 0.07874 0.0 0.0
- is_result :
- 1
array([[0. , 0. , 0.4214595 ], [0. , 0. , 0.39230343], [0. , 0. , 0.21178662], [0.31713349, 0. , 0. ], [0.19753726, 0. , 0. ], [0. , 0. , 0.15375983], [0.73562989, 0. , 0.73562989], [0. , 0. , 0. ], [0. , 0. , 0. ], [0.20185729, 0. , 0. ], [0. , 0.58409777, 0. ], [0.07873735, 0. , 0. ]])
- systemwide_levelised_cost(carriers, techs, costs)float64nan nan nan ... nan nan nan
- is_result :
- 1
array([[[ nan], [ nan], [ nan], [1.98280285e-06], [1.59163184e-06], [ nan], [1.68219341e-02], [ nan], [ nan], [4.48962739e-02], [ nan], [1.15972425e-01]], [[ nan], [ nan], [ nan], [ nan], [ nan], [ nan], [ nan], [ nan], [ nan], [ nan], [2.50215311e-02], [ nan]], [[1.34279065e-05], [1.92344950e-05], [2.67217957e-05], [ nan], [ nan], [8.23133164e-03], [2.10274176e-02], [ nan], [ nan], [ nan], [ nan], [ nan]]])
- total_levelised_cost(carriers, costs)float640.08069 0.03449 0.09578
- is_result :
- 1
array([[0.08069117], [0.03448625], [0.09577928]])
- techsPandasIndex
PandasIndex(Index(['N1_to_X2', 'N1_to_X3', 'X1_to_N1', 'X1_to_X2', 'X1_to_X3', 'boiler', 'chp', 'demand_electricity', 'demand_heat', 'pv', 'supply_gas', 'supply_grid_power'], dtype='object', name='techs'))
- carriersPandasIndex
PandasIndex(Index(['electricity', 'gas', 'heat'], dtype='object', name='carriers'))
- nodesPandasIndex
PandasIndex(Index(['N1', 'X1', 'X2', 'X3'], dtype='object', name='nodes'))
- timestepsPandasIndex
PandasIndex(DatetimeIndex(['2005-07-01 00:00:00', '2005-07-01 01:00:00', '2005-07-01 02:00:00', '2005-07-01 03:00:00', '2005-07-01 04:00:00', '2005-07-01 05:00:00', '2005-07-01 06:00:00', '2005-07-01 07:00:00', '2005-07-01 08:00:00', '2005-07-01 09:00:00', '2005-07-01 10:00:00', '2005-07-01 11:00:00', '2005-07-01 12:00:00', '2005-07-01 13:00:00', '2005-07-01 14:00:00', '2005-07-01 15:00:00', '2005-07-01 16:00:00', '2005-07-01 17:00:00', '2005-07-01 18:00:00', '2005-07-01 19:00:00', '2005-07-01 20:00:00', '2005-07-01 21:00:00', '2005-07-01 22:00:00', '2005-07-01 23:00:00', '2005-07-02 00:00:00', '2005-07-02 01:00:00', '2005-07-02 02:00:00', '2005-07-02 03:00:00', '2005-07-02 04:00:00', '2005-07-02 05:00:00', '2005-07-02 06:00:00', '2005-07-02 07:00:00', '2005-07-02 08:00:00', '2005-07-02 09:00:00', '2005-07-02 10:00:00', '2005-07-02 11:00:00', '2005-07-02 12:00:00', '2005-07-02 13:00:00', '2005-07-02 14:00:00', '2005-07-02 15:00:00', '2005-07-02 16:00:00', '2005-07-02 17:00:00', '2005-07-02 18:00:00', '2005-07-02 19:00:00', '2005-07-02 20:00:00', '2005-07-02 21:00:00', '2005-07-02 22:00:00', '2005-07-02 23:00:00'], dtype='datetime64[ns]', name='timesteps', freq=None))
- costsPandasIndex
PandasIndex(Index(['monetary'], dtype='object', name='costs'))
- termination_condition :
- optimal
- calliope_version_defined :
- 0.7.0
- calliope_version_initialised :
- 0.7.0.dev2
- applied_overrides :
- scenario :
- None
- defaults :
- {'available_area': inf, 'bigM': 1000000000.0, 'objective_cost_weights': 1, 'area_use': inf, 'area_use_max': inf, 'area_use_min': 0, 'area_use_per_flow_cap': nan, 'cap_method': 'continuous', 'color': nan, 'cost_area_use': 0, 'cost_depreciation_rate': 1, 'cost_export': 0, 'cost_flow_cap': 0, 'cost_flow_cap_per_distance': 0, 'cost_flow_in': 0, 'cost_flow_out': 0, 'cost_interest_rate': 0, 'cost_om_annual': 0, 'cost_om_annual_investment_fraction': 0, 'cost_purchase': 0, 'cost_purchase_per_distance': 0, 'cost_source_cap': 0, 'cost_storage_cap': 0, 'cyclic_storage': True, 'distance': nan, 'export_max': inf, 'flow_cap': inf, 'flow_cap_max': inf, 'flow_cap_max_systemwide': inf, 'flow_cap_min': 0, 'flow_cap_min_systemwide': 0, 'flow_cap_per_storage_cap_max': inf, 'flow_cap_per_storage_cap_min': 0, 'flow_cap_per_unit': nan, 'flow_in_eff': 1.0, 'flow_in_eff_per_distance': 1.0, 'flow_out_eff': 1.0, 'flow_out_eff_per_distance': 1.0, 'flow_out_min_relative': 0, 'flow_out_parasitic_eff': 1.0, 'flow_ramping': 1.0, 'force_async_flow': False, 'include_storage': False, 'integer_dispatch': False, 'lifetime': inf, 'name': nan, 'one_way': False, 'purchased_units': inf, 'purchased_units_max': inf, 'purchased_units_max_systemwide': inf, 'purchased_units_min': 0, 'purchased_units_min_systemwide': 0, 'sink_unit': 'absolute', 'sink_use_equals': nan, 'sink_use_max': inf, 'sink_use_min': 0, 'source_cap': inf, 'source_cap_equals_flow_cap': False, 'source_cap_max': inf, 'source_cap_min': 0, 'source_eff': 1.0, 'source_unit': 'absolute', 'source_use_equals': nan, 'source_use_max': inf, 'source_use_min': 0, 'storage_cap': inf, 'storage_cap_max': inf, 'storage_cap_min': 0, 'storage_cap_per_unit': nan, 'storage_discharge_depth': 0, 'storage_initial': 0, 'storage_loss': 0}
- allow_operate_mode :
- 1
- config :
- {'build': {'backend': 'pyomo', 'ensure_feasibility': True, 'mode': 'plan', 'objective': 'min_cost_optimisation', 'operate_use_cap_results': False}, 'solve': {'save_logs': None, 'solver': 'cbc', 'solver_io': None, 'solver_options': None, 'spores_number': 3, 'spores_save_per_spore': False, 'spores_score_cost_class': 'spores_score', 'spores_skip_cost_op': False, 'zero_threshold': 1e-10}}
- applied_custom_math :
- ['custom_math.yaml']
- math :
- {'constraints': {'flow_capacity_per_storage_capacity_min': {'description': 'Set the lower bound of storage flow capacity relative to its storage capacity.', 'foreach': ['nodes', 'techs', 'carriers'], 'where': 'storage_cap AND flow_cap_per_storage_cap_min', 'equations': [{'expression': 'flow_cap >= storage_cap * flow_cap_per_storage_cap_min'}]}, 'flow_capacity_per_storage_capacity_max': {'description': 'Set the upper bound of storage flow capacity relative to its storage capacity.', 'foreach': ['nodes', 'techs', 'carriers'], 'where': 'storage_cap AND flow_cap_per_storage_cap_max', 'equations': [{'expression': 'flow_cap <= storage_cap * flow_cap_per_storage_cap_max'}]}, 'source_capacity_equals_flow_capacity': {'description': "Set a `supply` technology's flow capacity to equal its source capacity.", 'foreach': ['nodes', 'techs', 'carriers'], 'where': 'source_cap AND source_cap_equals_flow_cap=True', 'equations': [{'expression': 'source_cap == flow_cap'}]}, 'force_zero_area_use': {'description': "Set a technology's area use to zero if its flow capacity upper bound is zero.", 'foreach': ['nodes', 'techs'], 'where': 'area_use AND flow_cap_max=0', 'equations': [{'expression': 'area_use == 0'}]}, 'area_use_per_flow_capacity': {'description': "Set a fixed relationship between a technology's flow capacity and its area use.", 'foreach': ['nodes', 'techs', 'carriers'], 'where': 'area_use AND area_use_per_flow_cap', 'equations': [{'expression': 'area_use == flow_cap * area_use_per_flow_cap'}]}, 'area_use_capacity_per_loc': {'description': 'Set an upper bound on the total area that all technologies with `area_use` can occupy at a given node.', 'foreach': ['nodes'], 'where': 'area_use AND available_area', 'equations': [{'expression': 'sum(area_use, over=techs) <= available_area'}]}, 'flow_capacity_systemwide_max': {'description': 'Set an upper bound on flow capacity of a technology across all nodes in which the technology exists.', 'foreach': ['techs', 'carriers'], 'where': 'flow_cap_max_systemwide', 'equations': [{'expression': 'sum(flow_cap, over=nodes) <= flow_cap_max_systemwide'}]}, 'flow_capacity_systemwide_min': {'description': 'Set a lower bound on flow capacity of a technology across all nodes in which the technology exists.', 'foreach': ['techs', 'carriers'], 'where': 'flow_cap_min_systemwide', 'equations': [{'expression': 'sum(flow_cap, over=nodes) >= flow_cap_min_systemwide'}]}, 'balance_conversion': {'description': "Fix the relationship between a `conversion` technology's outflow and consumption.", 'foreach': ['nodes', 'techs', 'timesteps'], 'where': 'base_tech=conversion AND NOT include_storage=true', 'equations': [{'where': 'NOT [chp] in techs', 'expression': 'sum(flow_out_inc_eff, over=carriers) == sum(flow_in_inc_eff, over=carriers)'}, {'where': '[chp] in techs', 'expression': 'flow_out_inc_eff[carriers=electricity] == sum(flow_in_inc_eff, over=carriers)'}]}, 'flow_out_max': {'description': "Set the upper bound of a technology's outflow.", 'foreach': ['nodes', 'techs', 'carriers', 'timesteps'], 'where': 'carrier_out AND NOT operating_units', 'equations': [{'expression': 'flow_out <= flow_cap * timestep_resolution * flow_out_parasitic_eff'}]}, 'flow_out_min': {'description': "Set the lower bound of a technology's outflow.", 'foreach': ['nodes', 'techs', 'carriers', 'timesteps'], 'where': 'flow_out_min_relative AND NOT operating_units', 'equations': [{'expression': 'flow_out >= flow_cap * timestep_resolution * flow_out_min_relative'}]}, 'flow_in_max': {'description': "Set the upper bound of a technology's inflow.", 'foreach': ['nodes', 'techs', 'carriers', 'timesteps'], 'where': 'carrier_in AND NOT operating_units', 'equations': [{'expression': 'flow_in <= flow_cap * timestep_resolution'}]}, 'source_max': {'description': "Set the upper bound of a `supply` technology's source consumption.", 'foreach': ['nodes', 'techs', 'timesteps'], 'where': 'source_cap', 'equations': [{'expression': 'source_use <= timestep_resolution * source_cap'}]}, 'storage_max': {'description': 'Set the upper bound of the amount of carrier a technology can store.', 'foreach': ['nodes', 'techs', 'timesteps'], 'where': 'storage', 'equations': [{'expression': 'storage <= storage_cap'}]}, 'storage_discharge_depth_limit': {'description': 'Set the lower bound of the stored carrier a technology must keep in reserve at all times.', 'foreach': ['nodes', 'techs', 'timesteps'], 'where': 'storage AND storage_discharge_depth', 'equations': [{'expression': 'storage - storage_discharge_depth * storage_cap >= 0'}]}, 'system_balance': {'description': 'Set the global carrier balance of the optimisation problem by fixing the total production of a given carrier to equal the total consumption of that carrier at every node in every timestep.', 'foreach': ['nodes', 'carriers', 'timesteps'], 'equations': [{'expression': 'sum(flow_out, over=techs) - sum(flow_in, over=techs) - $flow_export + $unmet_demand_and_unused_supply == 0'}], 'sub_expressions': {'flow_export': [{'where': 'any(carrier_export, over=techs)', 'expression': 'sum(flow_export, over=techs)'}, {'where': 'NOT any(carrier_export, over=techs)', 'expression': '0'}], 'unmet_demand_and_unused_supply': [{'where': 'config.ensure_feasibility=True', 'expression': 'unmet_demand + unused_supply'}, {'where': 'NOT config.ensure_feasibility=True', 'expression': '0'}]}}, 'balance_demand': {'description': 'Set the upper bound on, or a fixed total of, that a demand technology must dump to its sink in each timestep.', 'foreach': ['nodes', 'techs', 'carriers', 'timesteps'], 'where': 'base_tech=demand', 'equations': [{'where': 'sink_use_equals', 'expression': 'flow_in_inc_eff == sink_use_equals * $sink_scaler'}, {'where': 'NOT sink_use_equals AND sink_use_max', 'expression': 'flow_in_inc_eff <= sink_use_max * $sink_scaler'}], 'sub_expressions': {'sink_scaler': [{'where': 'sink_unit=per_area', 'expression': 'area_use'}, {'where': 'sink_unit=per_cap', 'expression': 'sum(flow_cap, over=carriers)'}, {'where': 'sink_unit=absolute', 'expression': '1'}]}}, 'balance_demand_min_use': {'description': 'Set the lower bound on the quantity of flow a `demand` technology must dump to its sink in each timestep.', 'foreach': ['nodes', 'techs', 'carriers', 'timesteps'], 'where': 'sink_use_min AND NOT sink_use_equals AND base_tech=demand', 'equations': [{'expression': 'flow_in_inc_eff >= sink_use_min * $sink_scaler'}], 'sub_expressions': {'sink_scaler': [{'where': 'sink_unit=per_area', 'expression': 'area_use'}, {'where': 'sink_unit=per_cap', 'expression': 'sum(flow_cap, over=carriers)'}, {'where': 'sink_unit=absolute', 'expression': '1'}]}}, 'balance_supply_no_storage': {'description': 'Fix the outflow of a `supply` technology to its consumption of the available source.', 'foreach': ['nodes', 'techs', 'carriers', 'timesteps'], 'where': 'base_tech=supply AND NOT include_storage=True', 'equations': [{'expression': 'flow_out_inc_eff == source_use * source_eff'}]}, 'balance_supply_with_storage': {'description': 'Fix the outflow of a `supply` technology to its consumption of the available source, with a storage buffer to temporally offset the outflow from source consumption.', 'foreach': ['nodes', 'techs', 'carriers', 'timesteps'], 'where': 'storage AND base_tech=supply', 'equations': [{'expression': 'storage == $storage_previous_step + source_use * source_eff - flow_out_inc_eff'}], 'sub_expressions': {'storage_previous_step': [{'where': 'timesteps=get_val_at_index(timesteps=0) AND NOT cyclic_storage=True', 'expression': 'storage_initial * storage_cap'}, {'where': '(\n (timesteps=get_val_at_index(timesteps=0) AND cyclic_storage=True)\n OR NOT timesteps=get_val_at_index(timesteps=0)\n) AND NOT lookup_cluster_first_timestep=True', 'expression': '(1 - storage_loss) ** roll(timestep_resolution, timesteps=1) * roll(storage, timesteps=1)'}, {'where': 'lookup_cluster_first_timestep=True AND NOT (timesteps=get_val_at_index(timesteps=0) AND NOT cyclic_storage=True)', 'expression': '(1 - storage_loss) ** select_from_lookup_arrays(timestep_resolution, timesteps=lookup_cluster_last_timestep) * select_from_lookup_arrays(storage, timesteps=lookup_cluster_last_timestep)'}]}}, 'source_availability_supply': {'description': "Set the upper bound on, or a fixed total of, a `supply` technology's ability to consume its available resource.", 'foreach': ['nodes', 'techs', 'timesteps'], 'where': 'source_use AND (source_use_equals OR source_use_max)', 'equations': [{'where': 'source_use_equals', 'expression': 'source_use == source_use_equals * $source_scaler'}, {'where': 'NOT source_use_equals AND source_use_max', 'expression': 'source_use <= source_use_max * $source_scaler'}], 'sub_expressions': {'source_scaler': [{'where': 'source_unit=per_area', 'expression': 'area_use'}, {'where': 'source_unit=per_cap', 'expression': 'sum(flow_cap, over=carriers)'}, {'where': 'source_unit=absolute', 'expression': '1'}]}}, 'balance_supply_min_use': {'description': 'Set the lower bound on the quantity of its source a `supply` technology must use in each timestep.', 'foreach': ['nodes', 'techs', 'timesteps'], 'where': 'source_use_min AND NOT source_use_equals AND base_tech=supply', 'equations': [{'expression': 'source_use >= source_use_min * $source_scaler'}], 'sub_expressions': {'source_scaler': [{'where': 'source_unit=per_area', 'expression': 'area_use'}, {'where': 'source_unit=per_cap', 'expression': 'sum(flow_cap, over=carriers)'}, {'where': 'source_unit=absolute', 'expression': '1'}]}}, 'balance_storage': {'description': 'Fix the quantity of carrier stored in a `storage` technology at the end of each timestep based on the net flow of carrier charged and discharged and the quantity of carrier stored at the start of the timestep.', 'foreach': ['nodes', 'techs', 'timesteps'], 'where': '(include_storage=true or base_tech=storage) AND NOT (base_tech=supply OR base_tech=demand)', 'equations': [{'expression': 'storage == $storage_previous_step -\n sum(flow_out_inc_eff, over=carriers) + sum(flow_in_inc_eff, over=carriers)'}], 'sub_expressions': {'storage_previous_step': [{'where': 'timesteps=get_val_at_index(timesteps=0) AND NOT cyclic_storage=True', 'expression': 'storage_initial * storage_cap'}, {'where': '(\n (timesteps=get_val_at_index(timesteps=0) AND cyclic_storage=True)\n OR NOT timesteps=get_val_at_index(timesteps=0)\n) AND NOT lookup_cluster_first_timestep=True', 'expression': '(1 - storage_loss) ** roll(timestep_resolution, timesteps=1) * roll(storage, timesteps=1)'}, {'where': 'lookup_cluster_first_timestep=True AND NOT (timesteps=get_val_at_index(timesteps=0) AND NOT cyclic_storage=True)', 'expression': '(1 - storage_loss) ** select_from_lookup_arrays(timestep_resolution, timesteps=lookup_cluster_last_timestep) * select_from_lookup_arrays(storage, timesteps=lookup_cluster_last_timestep)'}]}}, 'set_storage_initial': {'description': 'Fix the relationship between carrier stored in a `storage` technology at the start and end of the whole model period.', 'foreach': ['nodes', 'techs'], 'where': 'storage AND storage_initial AND cyclic_storage=True', 'equations': [{'expression': 'storage[timesteps=$final_step] * (\n (1 - storage_loss) ** timestep_resolution[timesteps=$final_step]\n) == storage_initial * storage_cap'}], 'slices': {'final_step': [{'expression': 'get_val_at_index(timesteps=-1)'}]}, 'active': True}, 'balance_transmission': {'description': 'Fix the relationship between between carrier flowing into and out of a `transmission` link in each timestep.', 'foreach': ['techs', 'timesteps'], 'where': 'base_tech=transmission', 'equations': [{'expression': 'sum(flow_out_inc_eff, over=[nodes, carriers]) == sum(flow_in_inc_eff, over=[nodes, carriers])'}]}, 'symmetric_transmission': {'description': 'Fix the flow capacity of two `transmission` technologies representing the same link in the system.', 'foreach': ['nodes', 'techs'], 'where': 'base_tech=transmission', 'equations': [{'expression': 'sum(flow_cap, over=carriers) == link_flow_cap'}]}, 'export_balance': {'description': "Set the lower bound of a technology's outflow to a technology's carrier export, for any technologies that can export carriers out of the system.", 'foreach': ['nodes', 'techs', 'carriers', 'timesteps'], 'where': 'flow_export', 'equations': [{'expression': 'flow_out >= flow_export'}]}, 'flow_export_max': {'description': "Set the upper bound of a technology's carrier export, for any technologies that can export carriers out of the system.", 'foreach': ['nodes', 'techs', 'carriers', 'timesteps'], 'where': 'flow_export AND export_max', 'equations': [{'where': 'operating_units', 'expression': 'flow_export <= export_max * operating_units'}, {'where': 'NOT operating_units', 'expression': 'flow_export <= export_max'}]}, 'unit_commitment_milp': {'description': 'Set the upper bound of the number of integer units of technology that can exist, for any technology using integer units to define its capacity.', 'foreach': ['nodes', 'techs', 'timesteps'], 'where': 'operating_units AND purchased_units', 'equations': [{'expression': 'operating_units <= purchased_units'}]}, 'available_flow_cap_binary': {'description': 'Limit flow capacity to zero if the technology is not operating in a given timestep.', 'foreach': ['nodes', 'techs', 'carriers', 'timesteps'], 'where': 'available_flow_cap', 'equations': [{'expression': 'available_flow_cap <= flow_cap_max * operating_units'}]}, 'available_flow_cap_continuous': {'description': 'Limit flow capacity to the value of the `flow_cap` decision variable when the technology is operating in a given timestep.', 'foreach': ['nodes', 'techs', 'carriers', 'timesteps'], 'where': 'available_flow_cap', 'equations': [{'expression': 'available_flow_cap <= flow_cap'}]}, 'available_flow_cap_max_binary_continuous_switch': {'description': 'Force flow capacity to equal the value of the `flow_cap` decision variable if the technology is operating in a given timestep, zero otherwise.', 'foreach': ['nodes', 'techs', 'carriers', 'timesteps'], 'where': 'available_flow_cap', 'equations': [{'expression': 'available_flow_cap >= flow_cap + ((operating_units - purchased_units) * flow_cap_max)'}]}, 'flow_out_max_milp': {'description': "Set the upper bound of a technology's ability to produce carriers, for any technology using integer units to define its capacity.", 'foreach': ['nodes', 'techs', 'carriers', 'timesteps'], 'where': 'flow_out AND operating_units AND flow_cap_per_unit', 'equations': [{'expression': 'flow_out <= operating_units * timestep_resolution * flow_cap_per_unit * flow_out_parasitic_eff'}]}, 'flow_in_max_milp': {'description': "Set the upper bound of a technology's ability to consume carriers, for any technology using integer units to define its capacity.", 'foreach': ['nodes', 'techs', 'carriers', 'timesteps'], 'where': 'flow_in AND operating_units AND flow_cap_per_unit', 'equations': [{'expression': 'flow_in <= operating_units * timestep_resolution * flow_cap_per_unit'}]}, 'flow_out_min_milp': {'description': "Set the lower bound of a technology's ability to produce carriers, for any technology using integer units to define its capacity.", 'foreach': ['nodes', 'techs', 'carriers', 'timesteps'], 'where': 'flow_out AND operating_units AND flow_out_min_relative', 'equations': [{'where': 'flow_cap_per_unit', 'expression': 'flow_out >= operating_units * timestep_resolution * flow_cap_per_unit * flow_out_min_relative'}, {'where': 'available_flow_cap', 'expression': 'flow_out >= available_flow_cap * timestep_resolution * flow_out_min_relative'}]}, 'storage_capacity_units_milp': {'description': 'Fix the storage capacity of any technology using integer units to define its capacity.', 'foreach': ['nodes', 'techs', 'carriers'], 'where': 'storage AND purchased_units AND storage_cap_per_unit', 'equations': [{'expression': 'storage_cap == purchased_units * storage_cap_per_unit'}]}, 'flow_capacity_units_milp': {'description': 'Fix the flow capacity of any technology using integer units to define its capacity.', 'foreach': ['nodes', 'techs', 'carriers'], 'where': 'operating_units', 'equations': [{'where': 'flow_cap_per_unit', 'expression': 'flow_cap == purchased_units * flow_cap_per_unit'}, {'where': 'NOT flow_cap_per_unit', 'expression': 'flow_cap <= purchased_units * bigM'}]}, 'flow_capacity_max_purchase_milp': {'description': "Set the upper bound on a technology's flow capacity, for any technology with integer capacity purchasing.", 'foreach': ['nodes', 'techs', 'carriers'], 'where': 'purchased_units AND flow_cap_max', 'equations': [{'expression': 'flow_cap <= flow_cap_max * purchased_units'}]}, 'flow_capacity_min_purchase_milp': {'description': "Set the lower bound on a technology's flow capacity, for any technology with integer capacity purchasing.", 'foreach': ['nodes', 'techs', 'carriers'], 'where': 'purchased_units AND flow_cap_min', 'equations': [{'expression': 'flow_cap >= flow_cap_min * purchased_units'}]}, 'storage_capacity_max_purchase_milp': {'description': "Set the upper bound on a technology's storage capacity, for any technology with integer capacity purchasing.", 'foreach': ['nodes', 'techs'], 'where': 'purchased_units AND storage_cap_max', 'equations': [{'expression': 'storage_cap <= storage_cap_max * purchased_units'}]}, 'storage_capacity_min_purchase_milp': {'description': "Set the lower bound on a technology's storage capacity, for any technology with integer capacity purchasing.", 'foreach': ['nodes', 'techs'], 'where': 'purchased_units AND storage_cap_min', 'equations': [{'expression': 'storage_cap >= storage_cap_min * purchased_units'}]}, 'unit_capacity_max_systemwide_milp': {'description': 'Set the upper bound on the total number of units of a technology that can be purchased across all nodes where the technology can exist, for any technology using integer units to define its capacity.', 'foreach': ['techs'], 'where': 'purchased_units AND purchased_units_max_systemwide', 'equations': [{'expression': 'sum(purchased_units, over=nodes) <= purchased_units_max_systemwide'}]}, 'unit_capacity_min_systemwide_milp': {'description': 'Set the lower bound on the total number of units of a technology that can be purchased across all nodes where the technology can exist, for any technology using integer units to define its capacity.', 'foreach': ['techs'], 'where': 'purchased_units AND purchased_units_max_systemwide', 'equations': [{'expression': 'sum(purchased_units, over=nodes) >= purchased_units_min_systemwide'}]}, 'async_flow_in_milp': {'description': "Set a technology's ability to have inflow in the same timestep that it has outflow, for any technology using the asynchronous flow binary switch.", 'foreach': ['nodes', 'techs', 'timesteps'], 'where': 'async_flow_switch', 'equations': [{'expression': 'sum(flow_in, over=carriers) <= (1 - async_flow_switch) * bigM'}]}, 'async_flow_out_milp': {'description': "Set a technology's ability to have outflow in the same timestep that it has inflow, for any technology using the asynchronous flow binary switch.", 'foreach': ['nodes', 'techs', 'timesteps'], 'where': 'async_flow_switch', 'equations': [{'expression': 'sum(flow_out, over=carriers) <= async_flow_switch * bigM'}]}, 'ramping_up': {'description': "Set the upper bound on a technology's ability to ramp outflow up beyond a certain percentage compared to the previous timestep.", 'foreach': ['nodes', 'techs', 'carriers', 'timesteps'], 'where': 'flow_ramping AND NOT timesteps=get_val_at_index(timesteps=0)', 'equations': [{'expression': '$flow - roll($flow, timesteps=1) <= flow_ramping * flow_cap'}], 'sub_expressions': {'flow': [{'where': 'carrier_out AND NOT carrier_in', 'expression': 'flow_out / timestep_resolution'}, {'where': 'carrier_in AND NOT carrier_out', 'expression': 'flow_in / timestep_resolution'}, {'where': 'carrier_in AND carrier_out', 'expression': '(flow_out - flow_in) / timestep_resolution'}]}}, 'ramping_down': {'description': "Set the upper bound on a technology's ability to ramp outflow down beyond a certain percentage compared to the previous timestep.", 'foreach': ['nodes', 'techs', 'carriers', 'timesteps'], 'where': 'flow_ramping AND NOT timesteps=get_val_at_index(timesteps=0)', 'equations': [{'expression': '-1 * flow_ramping * flow_cap <= $flow - roll($flow, timesteps=1)'}], 'sub_expressions': {'flow': [{'where': 'carrier_out AND NOT carrier_in', 'expression': 'flow_out / timestep_resolution'}, {'where': 'carrier_in AND NOT carrier_out', 'expression': 'flow_in / timestep_resolution'}, {'where': 'carrier_in AND carrier_out', 'expression': '(flow_out - flow_in) / timestep_resolution'}]}}, 'link_chp_outputs': {'description': 'Fix the relationship between heat and electricity output', 'equations': [{'expression': 'flow_out[carriers=electricity] * heat_to_power_ratio == flow_out[carriers=heat]'}], 'foreach': ['nodes', 'techs', 'timesteps'], 'where': '[chp] in techs'}}, 'variables': {'flow_cap': {'description': "A technology's flow capacity, also known as its nominal or nameplate capacity.", 'unit': 'power', 'foreach': ['nodes', 'techs', 'carriers'], 'bounds': {'min': 'flow_cap_min', 'max': 'flow_cap_max'}}, 'link_flow_cap': {'description': "A transmission technology's flow capacity, also known as its nominal or nameplate capacity.", 'unit': 'power', 'foreach': ['techs'], 'where': 'base_tech=transmission', 'bounds': {'min': 0, 'max': inf}}, 'flow_out': {'description': 'The outflow of a technology per timestep, also known as the flow discharged (from `storage` technologies) or the flow received (by `transmission` technologies) on a link.', 'unit': 'energy', 'foreach': ['nodes', 'techs', 'carriers', 'timesteps'], 'where': 'carrier_out', 'bounds': {'min': 0, 'max': inf}}, 'flow_in': {'description': 'The inflow to a technology per timestep, also known as the flow consumed (by `storage` technologies) or the flow sent (by `transmission` technologies) on a link.', 'unit': 'energy', 'foreach': ['nodes', 'techs', 'carriers', 'timesteps'], 'where': 'carrier_in', 'bounds': {'min': 0, 'max': inf}}, 'flow_export': {'description': 'The flow of a carrier exported outside the system boundaries by a technology per timestep.', 'unit': 'energy', 'foreach': ['nodes', 'techs', 'carriers', 'timesteps'], 'where': 'carrier_export', 'bounds': {'min': 0, 'max': inf}}, 'area_use': {'description': 'The area in space utilised directly (e.g., solar PV panels) or indirectly (e.g., biofuel crops) by a technology.', 'unit': 'area', 'foreach': ['nodes', 'techs'], 'where': '(area_use_min OR area_use_max OR area_use_per_flow_cap OR sink_unit=per_area OR source_unit=per_area)', 'bounds': {'min': 'area_use_min', 'max': 'area_use_max'}}, 'source_use': {'description': 'The carrier flow consumed from outside the system boundaries by a `supply` technology.', 'unit': 'energy', 'foreach': ['nodes', 'techs', 'timesteps'], 'where': 'base_tech=supply', 'bounds': {'min': 0, 'max': inf}}, 'source_cap': {'description': 'The upper limit on a flow that can be consumed from outside the system boundaries by a `supply` technology in each timestep.', 'unit': 'power', 'foreach': ['nodes', 'techs'], 'where': 'base_tech=supply', 'bounds': {'min': 'source_cap_min', 'max': 'source_cap_max'}}, 'storage_cap': {'description': 'The upper limit on a carrier that can be stored by a technology in any timestep.', 'unit': 'energy', 'foreach': ['nodes', 'techs'], 'where': 'include_storage=True OR base_tech=storage', 'domain': 'real', 'bounds': {'min': 'storage_cap_min', 'max': 'storage_cap_max'}, 'active': True}, 'storage': {'description': 'The carrier stored by a `storage` technology in each timestep.', 'unit': 'energy', 'foreach': ['nodes', 'techs', 'timesteps'], 'where': 'include_storage=True OR base_tech=storage', 'bounds': {'min': 0, 'max': inf}}, 'purchased_units': {'description': 'Integer number of a technology that has been purchased,\nfor any technology set to require integer capacity purchasing.\nThis is used to allow installation of fixed capacity units of technologies (\nif `flow_cap_max` == `flow_cap_min`) and/or to set a fixed cost for a technology,\nirrespective of its installed capacity.\nOn top of a fixed technology cost,\na continuous cost for the quantity of installed capacity can still be applied.\n\nSince technology capacity is no longer a continuous decision variable,\nit is possible for these technologies to have a lower bound set on outflow/consumption\nwhich will only be enforced in those timesteps that the technology is operating.\nOtherwise, the same lower bound forces the technology to produce/consume\nthat minimum amount of carrier in *every* timestep.\n', 'unit': 'integer', 'foreach': ['nodes', 'techs'], 'where': 'cap_method=integer', 'domain': 'integer', 'bounds': {'min': 'purchased_units_min', 'max': 'purchased_units_max'}}, 'operating_units': {'description': 'Integer number of a technology that is operating in each timestep, for any technology set to require integer capacity purchasing.', 'unit': 'integer', 'foreach': ['nodes', 'techs', 'timesteps'], 'where': 'integer_dispatch=True AND cap_method=integer', 'domain': 'integer', 'bounds': {'min': 0, 'max': inf}}, 'available_flow_cap': {'description': 'Flow capacity that will be set to zero if the technology is not operating in a given timestep and will be set to the value of the decision variable `flow_cap` otherwise.', 'unit': 'power', 'foreach': ['nodes', 'techs', 'carriers', 'timesteps'], 'where': 'integer_dispatch=True AND flow_cap_max AND NOT flow_cap_per_unit', 'bounds': {'min': 0, 'max': inf}}, 'async_flow_switch': {'description': 'Binary switch to force asynchronous outflow/consumption of technologies with both `flow_in` and `flow_out` defined. This ensures that a technology with carrier flow efficiencies < 100% cannot produce and consume a flow simultaneously to remove unwanted carrier from the system.', 'unit': 'integer', 'foreach': ['nodes', 'techs', 'timesteps'], 'where': 'force_async_flow=True', 'domain': 'integer', 'bounds': {'min': 0, 'max': 1}}, 'unmet_demand': {'description': 'Virtual source of carrier flow to ensure model feasibility. This should only be considered a debugging rather than a modelling tool as it may distort the model in other ways due to the large impact it has on the objective function value. When present in a model in which it has been requested, it indicates an inability for technologies in the model to reach a sufficient combined supply capacity to meet demand.', 'unit': 'energy', 'foreach': ['nodes', 'carriers', 'timesteps'], 'where': 'config.ensure_feasibility=True', 'bounds': {'min': 0, 'max': inf}}, 'unused_supply': {'description': 'Virtual sink of carrier flow to ensure model feasibility. This should only be considered a debugging rather than a modelling tool as it may distort the model in other ways due to the large impact it has on the objective function value. In model results, the negation of this variable is combined with `unmet_demand` and presented as only one variable: `unmet_demand`. When present in a model in which it has been requested, it indicates an inability for technologies in the model to reach a sufficient combined consumption capacity to meet required outflow (e.g. from renewables without the possibility of curtailment).', 'unit': 'energy', 'foreach': ['nodes', 'carriers', 'timesteps'], 'where': 'config.ensure_feasibility=True', 'bounds': {'min': -inf, 'max': 0}}}, 'objectives': {'min_cost_optimisation': {'description': 'Minimise the total cost of installing and operating all technologies in the system. If multiple cost classes are present (e.g., monetary and co2 emissions), the weighted sum of total costs is minimised. Cost class weights can be defined in the indexed parameter `objective_cost_weights`.', 'equations': [{'where': 'any(cost, over=[nodes, techs, costs])', 'expression': 'sum(\n sum(cost, over=[nodes, techs])\n * objective_cost_weights,\n over=costs\n) + $unmet_demand'}, {'where': 'NOT any(cost, over=[nodes, techs, costs])', 'expression': '$unmet_demand'}], 'sub_expressions': {'unmet_demand': [{'where': 'config.ensure_feasibility=True', 'expression': 'sum(\n sum(unmet_demand - unused_supply, over=[carriers, nodes])\n * timestep_weights,\n over=timesteps\n) * bigM'}, {'where': 'NOT config.ensure_feasibility=True', 'expression': '0'}]}, 'sense': 'minimise', 'active': True}}, 'global_expressions': {'flow_out_inc_eff': {'description': 'Outflows after taking efficiency losses into account.', 'foreach': ['nodes', 'techs', 'carriers', 'timesteps'], 'where': 'flow_out', 'equations': [{'where': 'base_tech=transmission', 'expression': 'flow_out / (\n flow_out_eff * flow_out_parasitic_eff *\n flow_out_eff_per_distance ** default_if_empty(distance, 1)\n)'}, {'where': 'NOT base_tech=transmission', 'expression': 'flow_out / (flow_out_eff * flow_out_parasitic_eff)'}]}, 'flow_in_inc_eff': {'description': 'Inflows after taking efficiency losses into account.', 'foreach': ['nodes', 'techs', 'carriers', 'timesteps'], 'where': 'flow_in', 'equations': [{'where': 'base_tech=transmission', 'expression': 'flow_in * flow_in_eff * flow_in_eff_per_distance ** default_if_empty(distance, 1)'}, {'where': 'NOT base_tech=transmission', 'expression': 'flow_in * flow_in_eff'}]}, 'cost_var': {'description': 'The operating costs per timestep of a technology.', 'unit': 'cost_per_time', 'foreach': ['nodes', 'techs', 'costs', 'timesteps'], 'where': 'cost_export OR cost_flow_in OR cost_flow_out', 'equations': [{'expression': 'timestep_weights * ($cost_export + $cost_flow_out + $cost_flow_in)'}], 'sub_expressions': {'cost_export': [{'where': 'flow_export', 'expression': 'sum(cost_export * default_if_empty(flow_export, 0), over=carriers)'}, {'where': 'NOT flow_export', 'expression': '0'}], 'cost_flow_in': [{'where': 'base_tech=supply', 'expression': 'cost_flow_in * source_use'}, {'where': 'NOT base_tech=supply', 'expression': 'sum(cost_flow_in * default_if_empty(flow_in, 0), over=carriers)'}], 'cost_flow_out': [{'expression': 'sum(cost_flow_out * default_if_empty(flow_out, 0), over=carriers)'}]}}, 'cost_investment_flow_cap': {'description': 'The investment costs associated with the nominal/rated capacity of a technology.', 'foreach': ['nodes', 'techs', 'carriers', 'costs'], 'where': 'flow_cap AND (cost_flow_cap OR cost_flow_cap_per_distance)', 'equations': [{'expression': '$cost_sum * flow_cap'}], 'sub_expressions': {'cost_sum': [{'where': 'base_tech=transmission', 'expression': '(cost_flow_cap + cost_flow_cap_per_distance * default_if_empty(distance, 0)) * 0.5'}, {'where': 'NOT base_tech=transmission', 'expression': 'cost_flow_cap'}]}}, 'cost_investment_storage_cap': {'description': 'The investment costs associated with the storage capacity of a technology.', 'foreach': ['nodes', 'techs', 'costs'], 'where': 'cost_storage_cap AND storage_cap', 'equations': [{'expression': 'cost_storage_cap * storage_cap'}]}, 'cost_investment_source_cap': {'description': 'The investment costs associated with the source consumption capacity of a technology.', 'foreach': ['nodes', 'techs', 'costs'], 'where': 'cost_source_cap AND source_cap', 'equations': [{'expression': 'cost_source_cap * source_cap'}]}, 'cost_investment_area_use': {'description': 'The investment costs associated with the area used by a technology.', 'foreach': ['nodes', 'techs', 'costs'], 'where': 'cost_area_use AND area_use', 'equations': [{'expression': 'cost_area_use * area_use'}]}, 'cost_investment_purchase': {'description': 'The investment costs associated with the binary purchase of a technology.', 'foreach': ['nodes', 'techs', 'costs'], 'where': 'cost_purchase AND purchased_units', 'equations': [{'where': 'base_tech=transmission', 'expression': '(cost_purchase + cost_purchase_per_distance * default_if_empty(distance, 0)) * purchased_units * 0.5'}, {'where': 'NOT base_tech=transmission', 'expression': 'cost_purchase * purchased_units'}]}, 'cost_investment': {'description': 'The installation costs of a technology, including annualised investment costs and annual maintenance costs.', 'unit': 'cost', 'foreach': ['nodes', 'techs', 'costs'], 'where': 'cost_investment_flow_cap OR cost_investment_storage_cap OR cost_investment_source_cap OR cost_investment_area_use OR cost_investment_purchase', 'equations': [{'expression': '$annualisation_weight * (\n $depreciation_rate * (\n sum(default_if_empty(cost_investment_flow_cap, 0), over=carriers) +\n default_if_empty(cost_investment_storage_cap, 0) +\n default_if_empty(cost_investment_source_cap, 0) +\n default_if_empty(cost_investment_area_use, 0) +\n default_if_empty(cost_investment_purchase, 0)\n ) * (1 + cost_om_annual_investment_fraction)\n + sum(cost_om_annual * default_if_empty(flow_cap, 0), over=carriers)\n)\n'}], 'sub_expressions': {'annualisation_weight': [{'expression': 'sum(timestep_resolution * timestep_weights, over=timesteps) / 8760'}], 'depreciation_rate': [{'where': 'cost_depreciation_rate', 'expression': 'cost_depreciation_rate'}, {'where': 'NOT cost_depreciation_rate AND cost_interest_rate=0', 'expression': '1 / lifetime'}, {'where': 'NOT cost_depreciation_rate AND cost_interest_rate>0', 'expression': '(cost_interest_rate * ((1 + cost_interest_rate) ** lifetime)) / (((1 + cost_interest_rate) ** lifetime) - 1)'}]}}, 'cost': {'description': 'The total annualised costs of a technology, including installation and operation costs.', 'unit': 'cost', 'foreach': ['nodes', 'techs', 'costs'], 'where': 'cost_investment OR cost_var', 'equations': [{'expression': '$cost_investment + $cost_var_sum'}], 'sub_expressions': {'cost_investment': [{'where': 'cost_investment', 'expression': 'cost_investment'}, {'where': 'NOT cost_investment', 'expression': '0'}], 'cost_var_sum': [{'where': 'cost_var', 'expression': 'sum(cost_var, over=timesteps)'}, {'where': 'NOT cost_var', 'expression': '0'}]}, 'active': True}}}
- name :
- Urban-scale example model
We can sum heat output over all locations and turn the result into a pandas DataFrame.
Note: heat output of transmission technologies (e.g., N1_to_X2
) is the import of heat at nodes.
df_heat = (
model.results.flow_out.sel(carriers="heat")
.sum("nodes", min_count=1, skipna=True)
.to_series()
.dropna()
.unstack("techs")
)
df_heat.head()
techs | N1_to_X2 | N1_to_X3 | X1_to_N1 | boiler | chp |
---|---|---|---|---|---|
timesteps | |||||
2005-07-01 00:00:00 | 242.341998 | 18.751161 | 85.869798 | 0.000000 | 92.861360 |
2005-07-01 01:00:00 | 66.368993 | 0.844722 | 72.541074 | 4.100046 | 78.466297 |
2005-07-01 02:00:00 | 67.582474 | 0.000000 | 72.915564 | 9.626102 | 78.876806 |
2005-07-01 03:00:00 | 67.487047 | 0.000000 | 72.812606 | 37.084989 | 78.877367 |
2005-07-01 04:00:00 | 70.052981 | 0.844807 | 76.515868 | 53.191064 | 83.204646 |
We can also examine total technology costs.
costs = model.results.cost.to_series().dropna()
costs.head()
nodes techs costs N1 N1_to_X2 monetary 0.051679 N1_to_X3 monetary 0.003761 X1_to_N1 monetary 0.154602 X1 X1_to_N1 monetary 0.154602 X1_to_X2 monetary 0.008286 Name: cost, dtype: float64
We can also examine levelized costs for each location and technology, which is calculated in a post-processing step.
lcoes = (
model.results.systemwide_levelised_cost.sel(carriers="electricity")
.to_series()
.dropna()
)
lcoes.head()
techs costs X1_to_X2 monetary 0.000002 X1_to_X3 monetary 0.000002 chp monetary 0.016822 pv monetary 0.044896 supply_grid_power monetary 0.115972 Name: systemwide_levelised_cost, dtype: float64
# We set the color mapping to use in all our plots by extracting the colors defined in the technology definitions of our model.
colors = model.inputs.color.to_series().to_dict()
Plotting flows¶
We do this by combinging in- and out-flows and separating demand from other technologies.
First, we look at the aggregated result across all nodes for electricity
, then we look at each node and carrier separately.
df_electricity = (
(model.results.flow_out.fillna(0) - model.results.flow_in.fillna(0))
.sel(carriers="electricity")
.sum("nodes")
.to_series()
.where(lambda x: x != 0)
.dropna()
.to_frame("Flow in/out (kWh)")
.reset_index()
)
df_electricity_demand = df_electricity[df_electricity.techs == "demand_electricity"]
df_electricity_other = df_electricity[df_electricity.techs != "demand_electricity"]
print(df_electricity.head())
fig1 = px.bar(
df_electricity_other,
x="timesteps",
y="Flow in/out (kWh)",
color="techs",
color_discrete_map=colors,
)
fig1.add_scatter(
x=df_electricity_demand.timesteps,
y=-1 * df_electricity_demand["Flow in/out (kWh)"],
marker_color="black",
name="demand",
)
techs timesteps Flow in/out (kWh) 0 X1_to_X2 2005-07-01 00:00:00 -1.929506 1 X1_to_X2 2005-07-01 01:00:00 -1.570625 2 X1_to_X2 2005-07-01 02:00:00 -1.581138 3 X1_to_X2 2005-07-01 03:00:00 -1.581138 4 X1_to_X2 2005-07-01 04:00:00 -1.688397