import xarray as xr
import pandas as pd
import numpy as np
import calliope
calliope.set_log_verbosity('INFO', include_solver_output=False)
# Initialise the model with the Urban Scale example model
m = calliope.examples.urban_scale()
[2021-07-29 16:01:30] INFO Model: initialising [2021-07-29 16:01:30] INFO Model: preprocessing stage 1 (model_run) [2021-07-29 16:01:31] INFO NumExpr defaulting to 8 threads. [2021-07-29 16:01:31] INFO Model: preprocessing stage 2 (model_data) [2021-07-29 16:01:31] INFO Model: preprocessing complete
# Get information on the model
m.info()
'Model name: Urban-scale example model\nModel size: 4 locations, 9 technologies, 48 timesteps'
m._model_run is a python dictionary. The underscore before the method indicates that it defaults to being hidden (i.e. you wouldn't see it by trying a tab auto-complete and it isn't documented)
# Model run holds all the data from the YAML and CSV files, restructured into one dictionary
m._model_run.keys()
dict_keys(['scenario', 'applied_overrides', 'techs', 'tech_groups', 'locations', 'timeseries_data', 'run', 'model', 'group_constraints', 'sets', 'constraint_sets'])
# All locations now hold all information about a technology at that location
m._model_run['locations']['X2']['techs']['pv']
{'costs': {'monetary': {'export': -0.0491, 'om_prod': -0.0203, 'depreciation_rate': 0.11016807219002081, 'energy_cap': 1350}}, 'constraints': {'energy_cap_max': 250, 'energy_prod': True, 'export_carrier': 'electricity', 'force_resource': True, 'lifetime': 25, 'parasitic_eff': 0.85, 'resource': 'file=pv_resource.csv:per_area', 'resource_area_max': 1500, 'resource_area_per_energy_cap': 7, 'resource_eff': 1.0, 'resource_unit': 'energy_per_area'}}
# This includes location-specific overrides, such as energy_cap_max of 50 for the pv technology at location X3
m._model_run['locations']['X3']['techs']['pv']
{'constraints': {'energy_cap_max': 50, 'energy_prod': True, 'export_carrier': 'electricity', 'force_resource': True, 'lifetime': 25, 'parasitic_eff': 0.85, 'resource': 'file=pv_resource.csv:per_area', 'resource_area_max': 1500, 'resource_area_per_energy_cap': 7, 'resource_eff': 1.0, 'resource_unit': 'energy_per_area'}, 'costs': {'monetary': {'om_annual': -80.5, 'depreciation_rate': 0.11016807219002081, 'energy_cap': 1350}}}
# All sets have also been collated.
# locations and technologies are concatenated into loc::tech sets,
# to create a dense matrix and smaller overall model size
m._model_run['sets']['loc_techs']
['X2::demand_electricity', 'X3::power_lines:X1', 'X2::supply_gas', 'X1::demand_heat', 'X3::boiler', 'X3::demand_heat', 'X3::supply_gas', 'X1::heat_pipes:N1', 'N1::heat_pipes:X3', 'X2::demand_heat', 'X3::demand_electricity', 'X1::supply_grid_power', 'X3::pv', 'N1::heat_pipes:X2', 'X1::chp', 'X1::power_lines:X3', 'N1::heat_pipes:X1', 'X1::pv', 'X2::power_lines:X1', 'X1::power_lines:X2', 'X1::supply_gas', 'X1::demand_electricity', 'X2::heat_pipes:N1', 'X3::heat_pipes:N1', 'X2::pv', 'X2::boiler']
# For every constraint, a set of loc_techs (or loc_tech_carriers) is prepared,
# so we only build the constraint over that set
m._model_run['constraint_sets']['loc_techs_energy_capacity_constraint']
['X2::demand_electricity', 'X3::power_lines:X1', 'X2::supply_gas', 'X1::demand_heat', 'X3::boiler', 'X3::demand_heat', 'X3::supply_gas', 'X1::heat_pipes:N1', 'N1::heat_pipes:X3', 'X2::demand_heat', 'X3::demand_electricity', 'X1::supply_grid_power', 'X3::pv', 'N1::heat_pipes:X2', 'X1::chp', 'X1::power_lines:X3', 'N1::heat_pipes:X1', 'X1::pv', 'X2::power_lines:X1', 'X1::power_lines:X2', 'X1::supply_gas', 'X1::demand_electricity', 'X2::heat_pipes:N1', 'X3::heat_pipes:N1', 'X2::pv', 'X2::boiler']
m._model_run['constraint_sets']['loc_techs_resource_area_constraint']
['X1::pv', 'X2::pv', 'X3::pv']
# timeseries data is stored as dataframes, having been loaded from CSV
m._model_run['timeseries_data']['pv_resource.csv'].head()
per_area | per_cap | |
---|---|---|
2005-07-01 00:00:00 | 0.0 | 0.0 |
2005-07-01 01:00:00 | 0.0 | 0.0 |
2005-07-01 02:00:00 | 0.0 | 0.0 |
2005-07-01 03:00:00 | 0.0 | 0.0 |
2005-07-01 04:00:00 | 0.0 | 0.0 |
m._model_data is an xarray Dataset
# Users would usually access information for the initialised model using m.inputs
m.inputs
<xarray.Dataset> Dimensions: (carrier_tiers: 3, carriers: 3, coordinates: 2, costs: 1, loc_carriers: 10, loc_tech_carriers_conversion_plus: 3, loc_techs: 26, loc_techs_area: 3, loc_techs_conversion: 2, loc_techs_conversion_plus: 1, loc_techs_export: 4, loc_techs_finite_resource: 9, loc_techs_investment_cost: 20, loc_techs_non_conversion: 23, loc_techs_om_cost: 9, loc_techs_supply_plus: 3, loc_techs_transmission: 10, locs: 4, techs: 9, timesteps: 48) Coordinates: (12/20) * carrier_tiers (carrier_tiers) <U5 'out_2' 'in' 'out' * carriers (carriers) <U11 'gas' ... 'electric... * coordinates (coordinates) object 'x' 'y' * costs (costs) object 'monetary' * loc_carriers (loc_carriers) object 'X3::heat' ..... * loc_tech_carriers_conversion_plus (loc_tech_carriers_conversion_plus) object ... ... ... * loc_techs_om_cost (loc_techs_om_cost) object 'X2::sup... * loc_techs_supply_plus (loc_techs_supply_plus) object 'X1:... * loc_techs_transmission (loc_techs_transmission) object 'X3... * locs (locs) object 'N1' 'X2' 'X1' 'X3' * techs (techs) object 'pv' ... 'demand_heat' * timesteps (timesteps) datetime64[ns] 2005-07-... Data variables: (12/38) energy_cap_max (loc_techs) float64 nan ... 600.0 resource (loc_techs_finite_resource, timesteps) float64 ... resource_area_per_energy_cap (loc_techs_area) int64 7 7 7 force_resource (loc_techs_finite_resource) bool Tr... parasitic_eff (loc_techs_supply_plus) float64 0.8... resource_eff (loc_techs_finite_resource) float64 ... ... ... lookup_loc_techs_conversion_plus (carrier_tiers, loc_techs_conversion_plus) object ... lookup_loc_techs_export (loc_techs_export) object 'X1::pv::... lookup_loc_techs_area (locs) object '' 'X2::pv' ... 'X3::pv' timestep_resolution (timesteps) float64 1.0 1.0 ... 1.0 timestep_weights (timesteps) float64 1.0 1.0 ... 1.0 max_demand_timesteps (carriers) datetime64[ns] 2005-07-0... Attributes: calliope_version: 0.6.7-dev applied_overrides: scenario: None defaults: available_area: null\ncarrier_ratios: false\ncharge_... allow_operate_mode: 1
array(['out_2', 'in', 'out'], dtype='<U5')
array(['gas', 'heat', 'electricity'], dtype='<U11')
array(['x', 'y'], dtype=object)
array(['monetary'], dtype=object)
array(['X3::heat', 'X2::heat', 'X2::gas', 'N1::heat', 'X3::electricity', 'X1::heat', 'X3::gas', 'X2::electricity', 'X1::electricity', 'X1::gas'], dtype=object)
array(['X1::chp::gas', 'X1::chp::heat', 'X1::chp::electricity'], dtype=object)
array(['X2::demand_electricity', 'X3::power_lines:X1', 'X2::supply_gas', 'X1::demand_heat', 'X3::boiler', 'X3::demand_heat', 'X3::supply_gas', 'X1::heat_pipes:N1', 'N1::heat_pipes:X3', 'X2::demand_heat', 'X3::demand_electricity', 'X1::supply_grid_power', 'X3::pv', 'N1::heat_pipes:X2', 'X1::chp', 'X1::power_lines:X3', 'N1::heat_pipes:X1', 'X1::pv', 'X2::power_lines:X1', 'X1::power_lines:X2', 'X1::supply_gas', 'X1::demand_electricity', 'X2::heat_pipes:N1', 'X3::heat_pipes:N1', 'X2::pv', 'X2::boiler'], dtype=object)
array(['X1::pv', 'X2::pv', 'X3::pv'], dtype=object)
array(['X3::boiler', 'X2::boiler'], dtype='<U10')
array(['X1::chp'], dtype='<U7')
array(['X1::pv', 'X2::pv', 'X3::pv', 'X1::chp'], dtype=object)
array(['X2::demand_electricity', 'X3::pv', 'X1::demand_heat', 'X3::demand_heat', 'X1::pv', 'X2::demand_heat', 'X1::demand_electricity', 'X3::demand_electricity', 'X2::pv'], dtype=object)
array(['X3::power_lines:X1', 'X2::supply_gas', 'X3::boiler', 'X3::supply_gas', 'X1::heat_pipes:N1', 'N1::heat_pipes:X3', 'X1::supply_grid_power', 'X3::pv', 'N1::heat_pipes:X2', 'X1::chp', 'X1::power_lines:X3', 'N1::heat_pipes:X1', 'X1::pv', 'X2::power_lines:X1', 'X1::power_lines:X2', 'X1::supply_gas', 'X2::heat_pipes:N1', 'X3::heat_pipes:N1', 'X2::pv', 'X2::boiler'], dtype=object)
array(['X2::demand_electricity', 'X3::power_lines:X1', 'X2::supply_gas', 'X1::demand_heat', 'X3::demand_heat', 'X3::supply_gas', 'X1::heat_pipes:N1', 'N1::heat_pipes:X3', 'X2::demand_heat', 'X3::demand_electricity', 'X1::supply_grid_power', 'X3::pv', 'N1::heat_pipes:X2', 'X1::power_lines:X3', 'X1::power_lines:X2', 'N1::heat_pipes:X1', 'X1::pv', 'X2::power_lines:X1', 'X2::heat_pipes:N1', 'X1::supply_gas', 'X1::demand_electricity', 'X3::heat_pipes:N1', 'X2::pv'], dtype=object)
array(['X2::supply_gas', 'X3::pv', 'X3::boiler', 'X1::supply_grid_power', 'X1::chp', 'X3::supply_gas', 'X1::supply_gas', 'X2::pv', 'X2::boiler'], dtype=object)
array(['X1::pv', 'X2::pv', 'X3::pv'], dtype=object)
array(['X3::power_lines:X1', 'X1::power_lines:X3', 'X1::heat_pipes:N1', 'N1::heat_pipes:X1', 'X2::power_lines:X1', 'X1::power_lines:X2', 'N1::heat_pipes:X3', 'X2::heat_pipes:N1', 'X3::heat_pipes:N1', 'N1::heat_pipes:X2'], dtype=object)
array(['N1', 'X2', 'X1', 'X3'], dtype=object)
array(['pv', 'power_lines', 'demand_electricity', 'supply_grid_power', 'boiler', 'chp', 'supply_gas', 'heat_pipes', 'demand_heat'], dtype=object)
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]')
array([ nan, 2000., 2000., nan, 600., nan, 2000., 2000., 2000., nan, nan, 2000., 50., 2000., 1500., 2000., 2000., 250., 2000., 2000., 2000., nan, 2000., 2000., 250., 600.])
array([[-9.45458012e+01, -7.69606192e+01, -7.74757501e+01, -7.74757501e+01, -8.27314956e+01, -1.48533479e+02, -1.89570817e+02, -2.38734711e+02, -2.44284493e+02, -2.31440181e+02, -2.22530771e+02, -2.22593033e+02, -2.04439029e+02, -1.96128922e+02, -2.04488194e+02, -2.25942018e+02, -1.93132717e+02, -2.59507784e+02, -2.49024872e+02, -2.60251628e+02, -2.54605599e+02, -2.05449509e+02, -1.35232572e+02, -9.47389753e+01, -1.02582511e+02, -8.58988086e+01, -8.43534158e+01, -8.66715049e+01, -9.08969886e+01, -1.47760782e+02, -1.99099472e+02, -2.38777508e+02, -2.35119872e+02, -2.31648466e+02, -2.27171841e+02, -2.27213317e+02, -1.99838408e+02, -1.91537233e+02, -1.99895515e+02, -2.21324570e+02, -1.88344877e+02, -2.49962248e+02, -2.48894106e+02, -2.69344347e+02, -2.45412357e+02, -1.96280957e+02, -1.35289242e+02, -1.03741556e+02], [ 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 7.85714300e-03, 2.91428570e-02, 5.55714290e-02, 7.84285710e-02, 9.60000000e-02, 1.08142857e-01, 1.07571429e-01, ... -1.87629121e+01, -1.87629121e+01, -1.87629121e+01, -1.89544182e+01, -1.91459244e+01, -1.87629121e+01, -1.87629121e+01, -1.87629121e+01, -1.87629121e+01, -1.87629121e+01, -1.87629121e+01, -1.87629121e+01], [ 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 7.85714300e-03, 2.91428570e-02, 5.55714290e-02, 7.84285710e-02, 9.60000000e-02, 1.08142857e-01, 1.07571429e-01, 9.00000000e-02, 7.11428570e-02, 6.44285710e-02, 5.07142860e-02, 3.85714290e-02, 2.62857140e-02, 9.71428600e-03, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 8.14285700e-03, 2.87142860e-02, 4.85714290e-02, 6.81428570e-02, 9.01428570e-02, 1.07571429e-01, 1.11285714e-01, 1.02857143e-01, 8.17142860e-02, 5.78571430e-02, 4.11428570e-02, 2.70000000e-02, 1.47142860e-02, 6.14285700e-03, 8.57143000e-04, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00]])
array([7, 7, 7])
array([ True, True, True, True, True, True, True, True, True])
array([0.85, 0.85, 0.85])
array([nan, 1., nan, nan, 1., nan, nan, nan, 1.])
array(['energy', 'energy_per_area', 'energy', 'energy', 'energy_per_area', 'energy', 'energy', 'energy', 'energy_per_area'], dtype=object)
array([nan, 25., 25., nan, 25., nan, 25., 25., 25., nan, nan, 25., 25., 25., 25., 25., 25., 25., 25., 25., 25., nan, 25., 25., 25., 25.])
array([ 1., 1., nan, 1., 1., 1., nan, 1., 1., 1., 1., nan, nan, 1., 1., 1., 1., nan, 1., 1., nan, 1., 1., 1., nan, 1.])
array([nan, 1., 1., nan, 1., nan, 1., 1., 1., nan, nan, 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., nan, 1., 1., 1., 1.])
array(['electricity', 'electricity', 'electricity', 'electricity'], dtype=object)
array([1500, 1500, 1500])
array([ nan, 0.98 , nan, nan, 0.85 , nan, nan, 0.92685937, 0.90368789, nan, nan, nan, nan, 0.92685937, 0.405 , 0.98 , 0.92685937, nan, 0.98 , 0.98 , nan, nan, 0.92685937, 0.90368789, nan, 0.85 ])
array([[ nan, nan, nan, nan, 0.004 , nan, nan, -0.0203, nan]])
array([[0.025, nan, 0.004, 0.1 , nan, 0.025, 0.025, nan, 0.004]])
array([[5.00e-02, 1.00e+00, 7.80e+01, 1.00e+00, 9.00e-01, 1.20e+00, 1.00e+02, 1.35e+03, 9.00e-01, 7.50e+02, 5.00e-02, 9.00e-01, 1.35e+03, 1.00e-01, 1.00e-01, 1.00e+00, 9.00e-01, 1.20e+00, 1.35e+03, 4.31e+01]])
array([[ nan, -80.5, nan, nan, nan, nan, nan, nan, nan]])
array([[0.11016807, 0.11016807, 0.11016807, 0.11016807, 0.11016807, 0.11016807, 0.11016807, 0.11016807, 0.11016807, 0.11016807, 0.11016807, 0.11016807, 0.11016807, 0.11016807, 0.11016807, 0.11016807, 0.11016807, 0.11016807, 0.11016807, 0.11016807]])
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.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 ], [ nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan]]])
array([ 5., 5., 3., 3., 10., 10., 4., 3., 4., 3.])
array(['X1::power_lines:X3', 'X3::power_lines:X1', 'N1::heat_pipes:X1', 'X1::heat_pipes:N1', 'X1::power_lines:X2', 'X2::power_lines:X1', 'X3::heat_pipes:N1', 'N1::heat_pipes:X2', 'N1::heat_pipes:X3', 'X2::heat_pipes:N1'], dtype=object)
array([ nan, 1300., 500., 900.])
array([[5, 8, 2, 5], [7, 7, 7, 3]])
array(['#F9D956', '#6783E3', '#072486', '#C5ABE3', '#8E2999', '#E4AB97', '#C98AAD', '#823739', '#660507'], dtype=object)
array(['supply_power_plus.supply_plus', 'transmission', 'demand', 'supply', 'conversion', 'conversion_plus', 'supply', 'transmission', 'demand'], dtype=object)
array(['Solar photovoltaic power', 'Electrical power distribution', 'Electrical demand', 'National grid import', 'Natural gas boiler', 'Combined heat and power', 'Natural gas import', 'District heat distribution', 'Heat demand'], dtype=object)
array([[1. , 0.8, 1. ], [1. , 1. , 1. ], [1. , 1. , 1. ]])
array(['X3::demand_heat::heat,X3::heat_pipes:N1::heat,X3::boiler::heat', 'X2::demand_heat::heat,X2::heat_pipes:N1::heat,X2::boiler::heat', 'X2::boiler::gas,X2::supply_gas::gas', 'N1::heat_pipes:X2::heat,N1::heat_pipes:X1::heat,N1::heat_pipes:X3::heat', 'X3::power_lines:X1::electricity,X3::demand_electricity::electricity,X3::pv::electricity', 'X1::demand_heat::heat,X1::chp::heat,X1::heat_pipes:N1::heat', 'X3::boiler::gas,X3::supply_gas::gas', 'X2::power_lines:X1::electricity,X2::pv::electricity,X2::demand_electricity::electricity', 'X1::supply_grid_power::electricity,X1::pv::electricity,X1::power_lines:X3::electricity,X1::demand_electricity::electricity,X1::power_lines:X2::electricity,X1::chp::electricity', 'X1::chp::gas,X1::supply_gas::gas'], dtype=object)
array(['X2::demand_electricity::electricity', 'X3::power_lines:X1::electricity', 'X2::supply_gas::gas', 'X1::demand_heat::heat', 'X3::demand_heat::heat', 'X3::supply_gas::gas', 'X1::heat_pipes:N1::heat', 'N1::heat_pipes:X3::heat', 'X2::demand_heat::heat', 'X3::demand_electricity::electricity', 'X1::supply_grid_power::electricity', 'X3::pv::electricity', 'N1::heat_pipes:X2::heat', 'X1::power_lines:X3::electricity', 'X1::power_lines:X2::electricity', 'N1::heat_pipes:X1::heat', 'X1::pv::electricity', 'X2::power_lines:X1::electricity', 'X2::heat_pipes:N1::heat', 'X1::supply_gas::gas', 'X1::demand_electricity::electricity', 'X3::heat_pipes:N1::heat', 'X2::pv::electricity'], dtype=object)
array([[None, None], ['X3::boiler::gas', 'X2::boiler::gas'], ['X3::boiler::heat', 'X2::boiler::heat']], dtype=object)
array(['X1::chp::gas'], dtype=object)
array(['X1::chp::electricity'], dtype=object)
array([['X1::chp::heat'], ['X1::chp::gas'], ['X1::chp::electricity']], dtype=object)
array(['X1::pv::electricity', 'X2::pv::electricity', 'X3::pv::electricity', 'X1::chp::electricity'], dtype=object)
array(['', 'X2::pv', 'X1::pv', 'X3::pv'], dtype=object)
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.])
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.])
array(['2005-07-01T00:00:00.000000000', '2005-07-01T07:00:00.000000000', '2005-07-01T08:00:00.000000000'], dtype='datetime64[ns]')
# This is just a filtered view on the model_data Dataset, which includes all the information
# which will be sent to the solver
m._model_data
<xarray.Dataset> Dimensions: (carrier_tiers: 3, carriers: 3, coordinates: 2, costs: 1, loc_carriers: 10, loc_carriers_system_balance_constraint: 10, loc_carriers_update_system_balance_constraint: 3, loc_tech_carriers_carrier_consumption_max_constraint: 16, loc_tech_carriers_carrier_production_max_constraint: 19, loc_tech_carriers_con: 19, loc_tech_carriers_conversion_all: 4, loc_tech_carriers_conversion_plus: 3, loc_tech_carriers_demand: 6, loc_tech_carriers_export: 4, loc_tech_carriers_export_balance_constraint: 4, loc_tech_carriers_prod: 21, loc_tech_carriers_supply_all: 7, loc_tech_carriers_supply_conversion_all: 11, loc_techs: 26, loc_techs_area: 3, loc_techs_balance_conversion_constraint: 2, loc_techs_balance_conversion_plus_out_2_constraint: 1, loc_techs_balance_conversion_plus_primary_constraint: 1, loc_techs_balance_demand_constraint: 6, loc_techs_balance_supply_plus_constraint: 3, loc_techs_balance_transmission_constraint: 10, loc_techs_carrier_production_max_conversion_plus_constraint: 1, loc_techs_conversion: 2, loc_techs_conversion_all: 3, loc_techs_conversion_plus: 1, loc_techs_cost: 20, loc_techs_cost_constraint: 20, loc_techs_cost_investment_constraint: 20, loc_techs_cost_var_constraint: 6, loc_techs_cost_var_conversion_constraint: 2, loc_techs_cost_var_conversion_plus_constraint: 1, loc_techs_costs_export: 2, loc_techs_demand: 6, loc_techs_energy_capacity_constraint: 26, loc_techs_export: 4, loc_techs_finite_resource: 9, loc_techs_finite_resource_demand: 6, loc_techs_finite_resource_supply_plus: 3, loc_techs_investment_cost: 20, loc_techs_non_conversion: 23, loc_techs_non_transmission: 16, loc_techs_om_cost: 9, loc_techs_om_cost_conversion: 2, loc_techs_om_cost_conversion_plus: 1, loc_techs_om_cost_supply: 4, loc_techs_om_cost_supply_plus: 2, loc_techs_out_2: 1, loc_techs_resource_area_constraint: 3, loc_techs_resource_area_per_energy_capacity_constraint: 3, loc_techs_resource_availability_supply_plus_constraint: 3, loc_techs_resource_max_constraint: 3, loc_techs_supply: 4, loc_techs_supply_all: 7, loc_techs_supply_conversion_all: 10, loc_techs_supply_plus: 3, loc_techs_symmetric_transmission_constraint: 10, loc_techs_transmission: 10, loc_techs_update_costs_var_constraint: 3, locs: 4, locs_resource_area_capacity_per_loc_constraint: 3, resources: 4, techs: 9, techs_conversion: 1, techs_conversion_plus: 1, techs_demand: 2, techs_non_transmission: 7, techs_supply: 2, techs_supply_plus: 1, techs_transmission: 7, techs_transmission_names: 2, timesteps: 48) Coordinates: (12/76) * carrier_tiers (carrier_tiers) <U5 ... * carriers (carriers) <U11 ... * coordinates (coordinates) object ... * costs (costs) object ... * loc_carriers (loc_carriers) object ... * loc_carriers_system_balance_constraint (loc_carriers_system_balance_constraint) <U15 ... ... ... * techs_non_transmission (techs_non_transmission) <U18 ... * techs_supply (techs_supply) <U17 ... * techs_supply_plus (techs_supply_plus) <U2 ... * techs_transmission (techs_transmission) <U14 ... * techs_transmission_names (techs_transmission_names) <U11 ... * timesteps (timesteps) datetime64[ns] ... Data variables: (12/38) energy_cap_max (loc_techs) float64 ... resource (loc_techs_finite_resource, timesteps) float64 ... resource_area_per_energy_cap (loc_techs_area) int64 ... force_resource (loc_techs_finite_resource) bool ... parasitic_eff (loc_techs_supply_plus) float64 ... resource_eff (loc_techs_finite_resource) float64 ... ... ... lookup_loc_techs_conversion_plus (carrier_tiers, loc_techs_conversion_plus) object ... lookup_loc_techs_export (loc_techs_export) object ... lookup_loc_techs_area (locs) object ... timestep_resolution (timesteps) float64 ... timestep_weights (timesteps) float64 ... max_demand_timesteps (carriers) datetime64[ns] ... Attributes: calliope_version: 0.6.7-dev applied_overrides: scenario: None defaults: available_area: null\ncarrier_ratios: false\ncharge_... allow_operate_mode: 1 model_config: calliope_version: 0.6.7\nname: Urban-scale example m... run_config: backend: pyomo\nbigM: 1000000.0\ncyclic_storage: tru...
array(['out_2', 'in', 'out'], dtype='<U5')
array(['gas', 'heat', 'electricity'], dtype='<U11')
array(['x', 'y'], dtype=object)
array(['monetary'], dtype=object)
array(['X3::heat', 'X2::heat', 'X2::gas', 'N1::heat', 'X3::electricity', 'X1::heat', 'X3::gas', 'X2::electricity', 'X1::electricity', 'X1::gas'], dtype=object)
array(['X3::heat', 'X2::heat', 'X2::gas', 'N1::heat', 'X3::electricity', 'X1::heat', 'X3::gas', 'X2::electricity', 'X1::electricity', 'X1::gas'], dtype='<U15')
array(['X3::electricity', 'X2::electricity', 'X1::electricity'], dtype='<U15')
array(['X3::demand_electricity::electricity', 'X1::power_lines:X3::electricity', 'X3::demand_heat::heat', 'X3::power_lines:X1::electricity', 'X1::power_lines:X2::electricity', 'X2::heat_pipes:N1::heat', 'N1::heat_pipes:X3::heat', 'X1::heat_pipes:N1::heat', 'N1::heat_pipes:X1::heat', 'X2::demand_heat::heat', 'X1::demand_electricity::electricity', 'X2::power_lines:X1::electricity', 'X2::demand_electricity::electricity', 'X1::demand_heat::heat', 'X3::heat_pipes:N1::heat', 'N1::heat_pipes:X2::heat'], dtype='<U35')
array(['X1::power_lines:X3::electricity', 'X3::boiler::heat', 'X2::boiler::heat', 'X3::power_lines:X1::electricity', 'X1::supply_gas::gas', 'X1::power_lines:X2::electricity', 'X3::pv::electricity', 'X1::supply_grid_power::electricity', 'X2::heat_pipes:N1::heat', 'X3::supply_gas::gas', 'N1::heat_pipes:X3::heat', 'X1::heat_pipes:N1::heat', 'N1::heat_pipes:X1::heat', 'X1::pv::electricity', 'X2::pv::electricity', 'X2::power_lines:X1::electricity', 'X2::supply_gas::gas', 'X3::heat_pipes:N1::heat', 'N1::heat_pipes:X2::heat'], dtype='<U34')
array(['X3::demand_electricity::electricity', 'X1::power_lines:X3::electricity', 'X3::demand_heat::heat', 'X3::power_lines:X1::electricity', 'X1::power_lines:X2::electricity', 'X2::heat_pipes:N1::heat', 'N1::heat_pipes:X3::heat', 'X1::heat_pipes:N1::heat', 'N1::heat_pipes:X1::heat', 'X2::demand_heat::heat', 'X3::boiler::gas', 'X1::demand_electricity::electricity', 'X1::chp::gas', 'X2::power_lines:X1::electricity', 'X2::demand_electricity::electricity', 'X1::demand_heat::heat', 'X3::heat_pipes:N1::heat', 'X2::boiler::gas', 'N1::heat_pipes:X2::heat'], dtype='<U35')
array(['X3::boiler::heat', 'X2::boiler::heat', 'X1::chp::heat', 'X1::chp::electricity'], dtype='<U20')
array(['X1::chp::gas', 'X1::chp::heat', 'X1::chp::electricity'], dtype=object)
array(['X2::demand_heat::heat', 'X2::demand_electricity::electricity', 'X3::demand_electricity::electricity', 'X3::demand_heat::heat', 'X1::demand_heat::heat', 'X1::demand_electricity::electricity'], dtype='<U35')
array(['X3::pv::electricity', 'X2::pv::electricity', 'X1::pv::electricity', 'X1::chp::electricity'], dtype='<U20')
array(['X3::pv::electricity', 'X2::pv::electricity', 'X1::pv::electricity', 'X1::chp::electricity'], dtype='<U20')
array(['X1::power_lines:X3::electricity', 'X3::boiler::heat', 'X2::boiler::heat', 'X3::power_lines:X1::electricity', 'X1::supply_gas::gas', 'X1::power_lines:X2::electricity', 'X3::pv::electricity', 'X1::supply_grid_power::electricity', 'X2::heat_pipes:N1::heat', 'X3::supply_gas::gas', 'N1::heat_pipes:X3::heat', 'X1::heat_pipes:N1::heat', 'N1::heat_pipes:X1::heat', 'X1::chp::heat', 'X1::chp::electricity', 'X1::pv::electricity', 'X2::pv::electricity', 'X2::power_lines:X1::electricity', 'X2::supply_gas::gas', 'X3::heat_pipes:N1::heat', 'N1::heat_pipes:X2::heat'], dtype='<U34')
array(['X2::supply_gas::gas', 'X3::pv::electricity', 'X1::supply_grid_power::electricity', 'X1::pv::electricity', 'X2::pv::electricity', 'X3::supply_gas::gas', 'X1::supply_gas::gas'], dtype='<U34')
array(['X2::supply_gas::gas', 'X3::pv::electricity', 'X1::supply_grid_power::electricity', 'X1::pv::electricity', 'X2::pv::electricity', 'X3::boiler::heat', 'X3::supply_gas::gas', 'X2::boiler::heat', 'X1::supply_gas::gas', 'X1::chp::heat', 'X1::chp::electricity'], dtype='<U34')
array(['X2::demand_electricity', 'X3::power_lines:X1', 'X2::supply_gas', 'X1::demand_heat', 'X3::boiler', 'X3::demand_heat', 'X3::supply_gas', 'X1::heat_pipes:N1', 'N1::heat_pipes:X3', 'X2::demand_heat', 'X3::demand_electricity', 'X1::supply_grid_power', 'X3::pv', 'N1::heat_pipes:X2', 'X1::chp', 'X1::power_lines:X3', 'N1::heat_pipes:X1', 'X1::pv', 'X2::power_lines:X1', 'X1::power_lines:X2', 'X1::supply_gas', 'X1::demand_electricity', 'X2::heat_pipes:N1', 'X3::heat_pipes:N1', 'X2::pv', 'X2::boiler'], dtype=object)
array(['X1::pv', 'X2::pv', 'X3::pv'], dtype=object)
array(['X3::boiler', 'X2::boiler'], dtype='<U10')
array(['X1::chp'], dtype='<U7')
array(['X1::chp'], dtype='<U7')
array(['X2::demand_electricity', 'X1::demand_heat', 'X3::demand_heat', 'X1::demand_electricity', 'X2::demand_heat', 'X3::demand_electricity'], dtype='<U22')
array(['X1::pv', 'X2::pv', 'X3::pv'], dtype='<U6')
array(['X3::power_lines:X1', 'X1::power_lines:X3', 'X1::heat_pipes:N1', 'N1::heat_pipes:X1', 'X2::power_lines:X1', 'X1::power_lines:X2', 'N1::heat_pipes:X3', 'X2::heat_pipes:N1', 'X3::heat_pipes:N1', 'N1::heat_pipes:X2'], dtype='<U18')
array(['X1::chp'], dtype='<U7')
array(['X3::boiler', 'X2::boiler'], dtype='<U10')
array(['X3::boiler', 'X2::boiler', 'X1::chp'], dtype='<U10')
array(['X1::chp'], dtype='<U7')
array(['X3::power_lines:X1', 'X2::supply_gas', 'X3::boiler', 'X3::supply_gas', 'X1::heat_pipes:N1', 'N1::heat_pipes:X3', 'X1::supply_grid_power', 'X3::pv', 'N1::heat_pipes:X2', 'X1::chp', 'X1::power_lines:X3', 'N1::heat_pipes:X1', 'X1::pv', 'X2::power_lines:X1', 'X1::power_lines:X2', 'X1::supply_gas', 'X2::heat_pipes:N1', 'X3::heat_pipes:N1', 'X2::pv', 'X2::boiler'], dtype='<U21')
array(['X3::power_lines:X1', 'X2::supply_gas', 'X3::boiler', 'X3::supply_gas', 'X1::heat_pipes:N1', 'N1::heat_pipes:X3', 'X1::supply_grid_power', 'X3::pv', 'N1::heat_pipes:X2', 'X1::chp', 'X1::power_lines:X3', 'N1::heat_pipes:X1', 'X1::pv', 'X2::power_lines:X1', 'X1::power_lines:X2', 'X1::supply_gas', 'X2::heat_pipes:N1', 'X3::heat_pipes:N1', 'X2::pv', 'X2::boiler'], dtype='<U21')
array(['X3::power_lines:X1', 'X2::supply_gas', 'X3::boiler', 'X3::supply_gas', 'X1::heat_pipes:N1', 'N1::heat_pipes:X3', 'X1::supply_grid_power', 'X3::pv', 'N1::heat_pipes:X2', 'X1::chp', 'X1::power_lines:X3', 'N1::heat_pipes:X1', 'X1::pv', 'X2::power_lines:X1', 'X1::power_lines:X2', 'X1::supply_gas', 'X2::heat_pipes:N1', 'X3::heat_pipes:N1', 'X2::pv', 'X2::boiler'], dtype='<U21')
array(['X2::supply_gas', 'X3::pv', 'X1::supply_grid_power', 'X3::supply_gas', 'X1::supply_gas', 'X2::pv'], dtype='<U21')
array(['X3::boiler', 'X2::boiler'], dtype='<U10')
array(['X1::chp'], dtype='<U7')
array(['X2::pv', 'X1::chp'], dtype='<U7')
array(['X2::demand_electricity', 'X1::demand_heat', 'X3::demand_heat', 'X1::demand_electricity', 'X2::demand_heat', 'X3::demand_electricity'], dtype='<U22')
array(['X2::demand_electricity', 'X3::power_lines:X1', 'X2::supply_gas', 'X1::demand_heat', 'X3::boiler', 'X3::demand_heat', 'X3::supply_gas', 'X1::heat_pipes:N1', 'N1::heat_pipes:X3', 'X2::demand_heat', 'X3::demand_electricity', 'X1::supply_grid_power', 'X3::pv', 'N1::heat_pipes:X2', 'X1::chp', 'X1::power_lines:X3', 'N1::heat_pipes:X1', 'X1::pv', 'X2::power_lines:X1', 'X1::power_lines:X2', 'X1::supply_gas', 'X1::demand_electricity', 'X2::heat_pipes:N1', 'X3::heat_pipes:N1', 'X2::pv', 'X2::boiler'], dtype='<U22')
array(['X1::pv', 'X2::pv', 'X3::pv', 'X1::chp'], dtype=object)
array(['X2::demand_electricity', 'X3::pv', 'X1::demand_heat', 'X3::demand_heat', 'X1::pv', 'X2::demand_heat', 'X1::demand_electricity', 'X3::demand_electricity', 'X2::pv'], dtype=object)
array(['X2::demand_electricity', 'X1::demand_heat', 'X3::demand_heat', 'X1::demand_electricity', 'X2::demand_heat', 'X3::demand_electricity'], dtype='<U22')
array(['X1::pv', 'X2::pv', 'X3::pv'], dtype='<U6')
array(['X3::power_lines:X1', 'X2::supply_gas', 'X3::boiler', 'X3::supply_gas', 'X1::heat_pipes:N1', 'N1::heat_pipes:X3', 'X1::supply_grid_power', 'X3::pv', 'N1::heat_pipes:X2', 'X1::chp', 'X1::power_lines:X3', 'N1::heat_pipes:X1', 'X1::pv', 'X2::power_lines:X1', 'X1::power_lines:X2', 'X1::supply_gas', 'X2::heat_pipes:N1', 'X3::heat_pipes:N1', 'X2::pv', 'X2::boiler'], dtype=object)
array(['X2::demand_electricity', 'X3::power_lines:X1', 'X2::supply_gas', 'X1::demand_heat', 'X3::demand_heat', 'X3::supply_gas', 'X1::heat_pipes:N1', 'N1::heat_pipes:X3', 'X2::demand_heat', 'X3::demand_electricity', 'X1::supply_grid_power', 'X3::pv', 'N1::heat_pipes:X2', 'X1::power_lines:X3', 'X1::power_lines:X2', 'N1::heat_pipes:X1', 'X1::pv', 'X2::power_lines:X1', 'X2::heat_pipes:N1', 'X1::supply_gas', 'X1::demand_electricity', 'X3::heat_pipes:N1', 'X2::pv'], dtype=object)
array(['X2::demand_electricity', 'X2::supply_gas', 'X3::pv', 'X1::demand_heat', 'X3::boiler', 'X3::demand_heat', 'X1::supply_grid_power', 'X1::chp', 'X3::supply_gas', 'X1::pv', 'X2::demand_heat', 'X1::supply_gas', 'X1::demand_electricity', 'X3::demand_electricity', 'X2::pv', 'X2::boiler'], dtype='<U22')
array(['X2::supply_gas', 'X3::pv', 'X3::boiler', 'X1::supply_grid_power', 'X1::chp', 'X3::supply_gas', 'X1::supply_gas', 'X2::pv', 'X2::boiler'], dtype=object)
array(['X3::boiler', 'X2::boiler'], dtype='<U10')
array(['X1::chp'], dtype='<U7')
array(['X1::supply_grid_power', 'X2::supply_gas', 'X1::supply_gas', 'X3::supply_gas'], dtype='<U21')
array(['X2::pv', 'X3::pv'], dtype='<U6')
array(['X1::chp'], dtype='<U7')
array(['X1::pv', 'X2::pv', 'X3::pv'], dtype='<U6')
array(['X1::pv', 'X2::pv', 'X3::pv'], dtype='<U6')
array(['X1::pv', 'X2::pv', 'X3::pv'], dtype='<U6')
array(['X1::pv', 'X2::pv', 'X3::pv'], dtype='<U6')
array(['X1::supply_gas', 'X2::supply_gas', 'X1::supply_grid_power', 'X3::supply_gas'], dtype='<U21')
array(['X1::pv', 'X2::supply_gas', 'X1::supply_gas', 'X3::pv', 'X2::pv', 'X1::supply_grid_power', 'X3::supply_gas'], dtype='<U21')
array(['X2::supply_gas', 'X3::pv', 'X2::boiler', 'X3::boiler', 'X3::supply_gas', 'X1::chp', 'X1::pv', 'X1::supply_gas', 'X2::pv', 'X1::supply_grid_power'], dtype='<U21')
array(['X1::pv', 'X2::pv', 'X3::pv'], dtype=object)
array(['X3::power_lines:X1', 'X1::power_lines:X3', 'X1::heat_pipes:N1', 'N1::heat_pipes:X1', 'X2::power_lines:X1', 'X1::power_lines:X2', 'N1::heat_pipes:X3', 'X2::heat_pipes:N1', 'X3::heat_pipes:N1', 'N1::heat_pipes:X2'], dtype='<U18')
array(['X3::power_lines:X1', 'X1::power_lines:X3', 'X1::heat_pipes:N1', 'N1::heat_pipes:X1', 'X2::power_lines:X1', 'X1::power_lines:X2', 'N1::heat_pipes:X3', 'X2::heat_pipes:N1', 'X3::heat_pipes:N1', 'N1::heat_pipes:X2'], dtype=object)
array(['X3::pv', 'X1::chp', 'X2::pv'], dtype='<U7')
array(['N1', 'X2', 'X1', 'X3'], dtype=object)
array(['X2', 'X1', 'X3'], dtype='<U2')
array(['gas', 'resource', 'heat', 'electricity'], dtype='<U11')
array(['pv', 'power_lines', 'demand_electricity', 'supply_grid_power', 'boiler', 'chp', 'supply_gas', 'heat_pipes', 'demand_heat'], dtype=object)
array(['boiler'], dtype='<U6')
array(['chp'], dtype='<U3')
array(['demand_electricity', 'demand_heat'], dtype='<U18')
array(['boiler', 'chp', 'demand_heat', 'supply_gas', 'demand_electricity', 'supply_grid_power', 'pv'], dtype='<U18')
array(['supply_grid_power', 'supply_gas'], dtype='<U17')
array(['pv'], dtype='<U2')
array(['heat_pipes:X3', 'heat_pipes:X2', 'power_lines:X3', 'power_lines:X1', 'heat_pipes:X1', 'power_lines:X2', 'heat_pipes:N1'], dtype='<U14')
array(['heat_pipes', 'power_lines'], dtype='<U11')
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]')
array([ nan, 2000., 2000., nan, 600., nan, 2000., 2000., 2000., nan, nan, 2000., 50., 2000., 1500., 2000., 2000., 250., 2000., 2000., 2000., nan, 2000., 2000., 250., 600.])
array([[-9.45458012e+01, -7.69606192e+01, -7.74757501e+01, -7.74757501e+01, -8.27314956e+01, -1.48533479e+02, -1.89570817e+02, -2.38734711e+02, -2.44284493e+02, -2.31440181e+02, -2.22530771e+02, -2.22593033e+02, -2.04439029e+02, -1.96128922e+02, -2.04488194e+02, -2.25942018e+02, -1.93132717e+02, -2.59507784e+02, -2.49024872e+02, -2.60251628e+02, -2.54605599e+02, -2.05449509e+02, -1.35232572e+02, -9.47389753e+01, -1.02582511e+02, -8.58988086e+01, -8.43534158e+01, -8.66715049e+01, -9.08969886e+01, -1.47760782e+02, -1.99099472e+02, -2.38777508e+02, -2.35119872e+02, -2.31648466e+02, -2.27171841e+02, -2.27213317e+02, -1.99838408e+02, -1.91537233e+02, -1.99895515e+02, -2.21324570e+02, -1.88344877e+02, -2.49962248e+02, -2.48894106e+02, -2.69344347e+02, -2.45412357e+02, -1.96280957e+02, -1.35289242e+02, -1.03741556e+02], [ 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 7.85714300e-03, 2.91428570e-02, 5.55714290e-02, 7.84285710e-02, 9.60000000e-02, 1.08142857e-01, 1.07571429e-01, ... -1.87629121e+01, -1.87629121e+01, -1.87629121e+01, -1.89544182e+01, -1.91459244e+01, -1.87629121e+01, -1.87629121e+01, -1.87629121e+01, -1.87629121e+01, -1.87629121e+01, -1.87629121e+01, -1.87629121e+01], [ 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 7.85714300e-03, 2.91428570e-02, 5.55714290e-02, 7.84285710e-02, 9.60000000e-02, 1.08142857e-01, 1.07571429e-01, 9.00000000e-02, 7.11428570e-02, 6.44285710e-02, 5.07142860e-02, 3.85714290e-02, 2.62857140e-02, 9.71428600e-03, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 8.14285700e-03, 2.87142860e-02, 4.85714290e-02, 6.81428570e-02, 9.01428570e-02, 1.07571429e-01, 1.11285714e-01, 1.02857143e-01, 8.17142860e-02, 5.78571430e-02, 4.11428570e-02, 2.70000000e-02, 1.47142860e-02, 6.14285700e-03, 8.57143000e-04, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00]])
array([7, 7, 7])
array([ True, True, True, True, True, True, True, True, True])
array([0.85, 0.85, 0.85])
array([nan, 1., nan, nan, 1., nan, nan, nan, 1.])
array(['energy', 'energy_per_area', 'energy', 'energy', 'energy_per_area', 'energy', 'energy', 'energy', 'energy_per_area'], dtype=object)
array([nan, 25., 25., nan, 25., nan, 25., 25., 25., nan, nan, 25., 25., 25., 25., 25., 25., 25., 25., 25., 25., nan, 25., 25., 25., 25.])
array([ 1., 1., nan, 1., 1., 1., nan, 1., 1., 1., 1., nan, nan, 1., 1., 1., 1., nan, 1., 1., nan, 1., 1., 1., nan, 1.])
array([nan, 1., 1., nan, 1., nan, 1., 1., 1., nan, nan, 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., nan, 1., 1., 1., 1.])
array(['electricity', 'electricity', 'electricity', 'electricity'], dtype=object)
array([1500, 1500, 1500])
array([ nan, 0.98 , nan, nan, 0.85 , nan, nan, 0.92685937, 0.90368789, nan, nan, nan, nan, 0.92685937, 0.405 , 0.98 , 0.92685937, nan, 0.98 , 0.98 , nan, nan, 0.92685937, 0.90368789, nan, 0.85 ])
array([[ nan, nan, nan, nan, 0.004 , nan, nan, -0.0203, nan]])
array([[0.025, nan, 0.004, 0.1 , nan, 0.025, 0.025, nan, 0.004]])
array([[5.00e-02, 1.00e+00, 7.80e+01, 1.00e+00, 9.00e-01, 1.20e+00, 1.00e+02, 1.35e+03, 9.00e-01, 7.50e+02, 5.00e-02, 9.00e-01, 1.35e+03, 1.00e-01, 1.00e-01, 1.00e+00, 9.00e-01, 1.20e+00, 1.35e+03, 4.31e+01]])
array([[ nan, -80.5, nan, nan, nan, nan, nan, nan, nan]])
array([[0.11016807, 0.11016807, 0.11016807, 0.11016807, 0.11016807, 0.11016807, 0.11016807, 0.11016807, 0.11016807, 0.11016807, 0.11016807, 0.11016807, 0.11016807, 0.11016807, 0.11016807, 0.11016807, 0.11016807, 0.11016807, 0.11016807, 0.11016807]])
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.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 ], [ nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan]]])
array([ 5., 5., 3., 3., 10., 10., 4., 3., 4., 3.])
array(['X1::power_lines:X3', 'X3::power_lines:X1', 'N1::heat_pipes:X1', 'X1::heat_pipes:N1', 'X1::power_lines:X2', 'X2::power_lines:X1', 'X3::heat_pipes:N1', 'N1::heat_pipes:X2', 'N1::heat_pipes:X3', 'X2::heat_pipes:N1'], dtype=object)
array([ nan, 1300., 500., 900.])
array([[5, 8, 2, 5], [7, 7, 7, 3]])
array(['#F9D956', '#6783E3', '#072486', '#C5ABE3', '#8E2999', '#E4AB97', '#C98AAD', '#823739', '#660507'], dtype=object)
array(['supply_power_plus.supply_plus', 'transmission', 'demand', 'supply', 'conversion', 'conversion_plus', 'supply', 'transmission', 'demand'], dtype=object)
array(['Solar photovoltaic power', 'Electrical power distribution', 'Electrical demand', 'National grid import', 'Natural gas boiler', 'Combined heat and power', 'Natural gas import', 'District heat distribution', 'Heat demand'], dtype=object)
array([[1. , 0.8, 1. ], [1. , 1. , 1. ], [1. , 1. , 1. ]])
array(['X3::demand_heat::heat,X3::heat_pipes:N1::heat,X3::boiler::heat', 'X2::demand_heat::heat,X2::heat_pipes:N1::heat,X2::boiler::heat', 'X2::boiler::gas,X2::supply_gas::gas', 'N1::heat_pipes:X2::heat,N1::heat_pipes:X1::heat,N1::heat_pipes:X3::heat', 'X3::power_lines:X1::electricity,X3::demand_electricity::electricity,X3::pv::electricity', 'X1::demand_heat::heat,X1::chp::heat,X1::heat_pipes:N1::heat', 'X3::boiler::gas,X3::supply_gas::gas', 'X2::power_lines:X1::electricity,X2::pv::electricity,X2::demand_electricity::electricity', 'X1::supply_grid_power::electricity,X1::pv::electricity,X1::power_lines:X3::electricity,X1::demand_electricity::electricity,X1::power_lines:X2::electricity,X1::chp::electricity', 'X1::chp::gas,X1::supply_gas::gas'], dtype=object)
array(['X2::demand_electricity::electricity', 'X3::power_lines:X1::electricity', 'X2::supply_gas::gas', 'X1::demand_heat::heat', 'X3::demand_heat::heat', 'X3::supply_gas::gas', 'X1::heat_pipes:N1::heat', 'N1::heat_pipes:X3::heat', 'X2::demand_heat::heat', 'X3::demand_electricity::electricity', 'X1::supply_grid_power::electricity', 'X3::pv::electricity', 'N1::heat_pipes:X2::heat', 'X1::power_lines:X3::electricity', 'X1::power_lines:X2::electricity', 'N1::heat_pipes:X1::heat', 'X1::pv::electricity', 'X2::power_lines:X1::electricity', 'X2::heat_pipes:N1::heat', 'X1::supply_gas::gas', 'X1::demand_electricity::electricity', 'X3::heat_pipes:N1::heat', 'X2::pv::electricity'], dtype=object)
array([[None, None], ['X3::boiler::gas', 'X2::boiler::gas'], ['X3::boiler::heat', 'X2::boiler::heat']], dtype=object)
array(['X1::chp::gas'], dtype=object)
array(['X1::chp::electricity'], dtype=object)
array([['X1::chp::heat'], ['X1::chp::gas'], ['X1::chp::electricity']], dtype=object)
array(['X1::pv::electricity', 'X2::pv::electricity', 'X3::pv::electricity', 'X1::chp::electricity'], dtype=object)
array(['', 'X2::pv', 'X1::pv', 'X3::pv'], dtype=object)
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.])
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.])
array(['2005-07-01T00:00:00.000000000', '2005-07-01T07:00:00.000000000', '2005-07-01T08:00:00.000000000'], dtype='datetime64[ns]')
# If timeseries aggregation of any kind has taken place, then m._model_data_original can be accessed to see the
# model data prior to aggregation
m._model_data_original # In this case, it is the same as m._model_data
<xarray.Dataset> Dimensions: (carrier_tiers: 3, carriers: 3, coordinates: 2, costs: 1, loc_carriers: 10, loc_carriers_system_balance_constraint: 10, loc_carriers_update_system_balance_constraint: 3, loc_tech_carriers_carrier_consumption_max_constraint: 16, loc_tech_carriers_carrier_production_max_constraint: 19, loc_tech_carriers_con: 19, loc_tech_carriers_conversion_all: 4, loc_tech_carriers_conversion_plus: 3, loc_tech_carriers_demand: 6, loc_tech_carriers_export: 4, loc_tech_carriers_export_balance_constraint: 4, loc_tech_carriers_prod: 21, loc_tech_carriers_supply_all: 7, loc_tech_carriers_supply_conversion_all: 11, loc_techs: 26, loc_techs_area: 3, loc_techs_balance_conversion_constraint: 2, loc_techs_balance_conversion_plus_out_2_constraint: 1, loc_techs_balance_conversion_plus_primary_constraint: 1, loc_techs_balance_demand_constraint: 6, loc_techs_balance_supply_plus_constraint: 3, loc_techs_balance_transmission_constraint: 10, loc_techs_carrier_production_max_conversion_plus_constraint: 1, loc_techs_conversion: 2, loc_techs_conversion_all: 3, loc_techs_conversion_plus: 1, loc_techs_cost: 20, loc_techs_cost_constraint: 20, loc_techs_cost_investment_constraint: 20, loc_techs_cost_var_constraint: 6, loc_techs_cost_var_conversion_constraint: 2, loc_techs_cost_var_conversion_plus_constraint: 1, loc_techs_costs_export: 2, loc_techs_demand: 6, loc_techs_energy_capacity_constraint: 26, loc_techs_export: 4, loc_techs_finite_resource: 9, loc_techs_finite_resource_demand: 6, loc_techs_finite_resource_supply_plus: 3, loc_techs_investment_cost: 20, loc_techs_non_conversion: 23, loc_techs_non_transmission: 16, loc_techs_om_cost: 9, loc_techs_om_cost_conversion: 2, loc_techs_om_cost_conversion_plus: 1, loc_techs_om_cost_supply: 4, loc_techs_om_cost_supply_plus: 2, loc_techs_out_2: 1, loc_techs_resource_area_constraint: 3, loc_techs_resource_area_per_energy_capacity_constraint: 3, loc_techs_resource_availability_supply_plus_constraint: 3, loc_techs_resource_max_constraint: 3, loc_techs_supply: 4, loc_techs_supply_all: 7, loc_techs_supply_conversion_all: 10, loc_techs_supply_plus: 3, loc_techs_symmetric_transmission_constraint: 10, loc_techs_transmission: 10, loc_techs_update_costs_var_constraint: 3, locs: 4, locs_resource_area_capacity_per_loc_constraint: 3, resources: 4, techs: 9, techs_conversion: 1, techs_conversion_plus: 1, techs_demand: 2, techs_non_transmission: 7, techs_supply: 2, techs_supply_plus: 1, techs_transmission: 7, techs_transmission_names: 2, timesteps: 48) Coordinates: (12/76) * carriers (carriers) <U11 ... * timesteps (timesteps) datetime64[ns] ... * locs (locs) object ... * loc_techs_export (loc_techs_export) object ... * loc_techs_conversion_plus (loc_techs_conversion_plus) <U7 ... * loc_carriers (loc_carriers) object ... ... ... * loc_techs_cost_var_conversion_constraint (loc_techs_cost_var_conversion_constraint) <U10 ... * loc_techs_balance_conversion_plus_primary_constraint (loc_techs_balance_conversion_plus_primary_constraint) <U7 ... * loc_techs_carrier_production_max_conversion_plus_constraint (loc_techs_carrier_production_max_conversion_plus_constraint) <U7 ... * loc_techs_cost_var_conversion_plus_constraint (loc_techs_cost_var_conversion_plus_constraint) <U7 ... * loc_techs_balance_conversion_plus_out_2_constraint (loc_techs_balance_conversion_plus_out_2_constraint) <U7 ... * loc_techs_symmetric_transmission_constraint (loc_techs_symmetric_transmission_constraint) <U18 ... Data variables: (12/38) energy_cap_max (loc_techs) float64 ... resource (loc_techs_finite_resource, timesteps) float64 ... resource_area_per_energy_cap (loc_techs_area) int64 ... force_resource (loc_techs_finite_resource) bool ... parasitic_eff (loc_techs_supply_plus) float64 ... resource_eff (loc_techs_finite_resource) float64 ... ... ... lookup_loc_techs_conversion_plus (loc_techs_conversion_plus, carrier_tiers) object ... lookup_loc_techs_export (loc_techs_export) object ... lookup_loc_techs_area (locs) object ... timestep_resolution (timesteps) float64 ... timestep_weights (timesteps) float64 ... max_demand_timesteps (carriers) datetime64[ns] ... Attributes: calliope_version: 0.6.7-dev applied_overrides: scenario: None defaults: available_area: null\ncarrier_ratios: false\ncharge_... allow_operate_mode: 1
array(['gas', 'heat', 'electricity'], dtype='<U11')
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]')
array(['N1', 'X2', 'X1', 'X3'], dtype=object)
array(['X1::pv', 'X2::pv', 'X3::pv', 'X1::chp'], dtype=object)
array(['X1::chp'], dtype='<U7')
array(['X3::heat', 'X2::heat', 'X2::gas', 'N1::heat', 'X3::electricity', 'X1::heat', 'X3::gas', 'X2::electricity', 'X1::electricity', 'X1::gas'], dtype=object)
array(['X2::demand_electricity', 'X3::power_lines:X1', 'X2::supply_gas', 'X1::demand_heat', 'X3::demand_heat', 'X3::supply_gas', 'X1::heat_pipes:N1', 'N1::heat_pipes:X3', 'X2::demand_heat', 'X3::demand_electricity', 'X1::supply_grid_power', 'X3::pv', 'N1::heat_pipes:X2', 'X1::power_lines:X3', 'X1::power_lines:X2', 'N1::heat_pipes:X1', 'X1::pv', 'X2::power_lines:X1', 'X2::heat_pipes:N1', 'X1::supply_gas', 'X1::demand_electricity', 'X3::heat_pipes:N1', 'X2::pv'], dtype=object)
array(['out_2', 'in', 'out'], dtype='<U5')
array(['x', 'y'], dtype=object)
array(['monetary'], dtype=object)
array(['X1::chp::gas', 'X1::chp::heat', 'X1::chp::electricity'], dtype=object)
array(['X2::demand_electricity', 'X3::power_lines:X1', 'X2::supply_gas', 'X1::demand_heat', 'X3::boiler', 'X3::demand_heat', 'X3::supply_gas', 'X1::heat_pipes:N1', 'N1::heat_pipes:X3', 'X2::demand_heat', 'X3::demand_electricity', 'X1::supply_grid_power', 'X3::pv', 'N1::heat_pipes:X2', 'X1::chp', 'X1::power_lines:X3', 'N1::heat_pipes:X1', 'X1::pv', 'X2::power_lines:X1', 'X1::power_lines:X2', 'X1::supply_gas', 'X1::demand_electricity', 'X2::heat_pipes:N1', 'X3::heat_pipes:N1', 'X2::pv', 'X2::boiler'], dtype=object)
array(['X1::pv', 'X2::pv', 'X3::pv'], dtype=object)
array(['X2::demand_electricity', 'X3::pv', 'X1::demand_heat', 'X3::demand_heat', 'X1::pv', 'X2::demand_heat', 'X1::demand_electricity', 'X3::demand_electricity', 'X2::pv'], dtype=object)
array(['X3::power_lines:X1', 'X2::supply_gas', 'X3::boiler', 'X3::supply_gas', 'X1::heat_pipes:N1', 'N1::heat_pipes:X3', 'X1::supply_grid_power', 'X3::pv', 'N1::heat_pipes:X2', 'X1::chp', 'X1::power_lines:X3', 'N1::heat_pipes:X1', 'X1::pv', 'X2::power_lines:X1', 'X1::power_lines:X2', 'X1::supply_gas', 'X2::heat_pipes:N1', 'X3::heat_pipes:N1', 'X2::pv', 'X2::boiler'], dtype=object)
array(['X2::supply_gas', 'X3::pv', 'X3::boiler', 'X1::supply_grid_power', 'X1::chp', 'X3::supply_gas', 'X1::supply_gas', 'X2::pv', 'X2::boiler'], dtype=object)
array(['X1::pv', 'X2::pv', 'X3::pv'], dtype=object)
array(['X3::power_lines:X1', 'X1::power_lines:X3', 'X1::heat_pipes:N1', 'N1::heat_pipes:X1', 'X2::power_lines:X1', 'X1::power_lines:X2', 'N1::heat_pipes:X3', 'X2::heat_pipes:N1', 'X3::heat_pipes:N1', 'N1::heat_pipes:X2'], dtype=object)
array(['pv', 'power_lines', 'demand_electricity', 'supply_grid_power', 'boiler', 'chp', 'supply_gas', 'heat_pipes', 'demand_heat'], dtype=object)
array(['gas', 'resource', 'heat', 'electricity'], dtype='<U11')
array(['boiler', 'chp', 'demand_heat', 'supply_gas', 'demand_electricity', 'supply_grid_power', 'pv'], dtype='<U18')
array(['demand_electricity', 'demand_heat'], dtype='<U18')
array(['supply_grid_power', 'supply_gas'], dtype='<U17')
array(['pv'], dtype='<U2')
array(['boiler'], dtype='<U6')
array(['chp'], dtype='<U3')
array(['heat_pipes', 'power_lines'], dtype='<U11')
array(['heat_pipes:X3', 'heat_pipes:X2', 'power_lines:X3', 'power_lines:X1', 'heat_pipes:X1', 'power_lines:X2', 'heat_pipes:N1'], dtype='<U14')
array(['X3::demand_electricity::electricity', 'X1::power_lines:X3::electricity', 'X3::demand_heat::heat', 'X3::power_lines:X1::electricity', 'X1::power_lines:X2::electricity', 'X2::heat_pipes:N1::heat', 'N1::heat_pipes:X3::heat', 'X1::heat_pipes:N1::heat', 'N1::heat_pipes:X1::heat', 'X2::demand_heat::heat', 'X3::boiler::gas', 'X1::demand_electricity::electricity', 'X1::chp::gas', 'X2::power_lines:X1::electricity', 'X2::demand_electricity::electricity', 'X1::demand_heat::heat', 'X3::heat_pipes:N1::heat', 'X2::boiler::gas', 'N1::heat_pipes:X2::heat'], dtype='<U35')
array(['X3::boiler::heat', 'X2::boiler::heat', 'X1::chp::heat', 'X1::chp::electricity'], dtype='<U20')
array(['X2::demand_heat::heat', 'X2::demand_electricity::electricity', 'X3::demand_electricity::electricity', 'X3::demand_heat::heat', 'X1::demand_heat::heat', 'X1::demand_electricity::electricity'], dtype='<U35')
array(['X3::pv::electricity', 'X2::pv::electricity', 'X1::pv::electricity', 'X1::chp::electricity'], dtype='<U20')
array(['X1::power_lines:X3::electricity', 'X3::boiler::heat', 'X2::boiler::heat', 'X3::power_lines:X1::electricity', 'X1::supply_gas::gas', 'X1::power_lines:X2::electricity', 'X3::pv::electricity', 'X1::supply_grid_power::electricity', 'X2::heat_pipes:N1::heat', 'X3::supply_gas::gas', 'N1::heat_pipes:X3::heat', 'X1::heat_pipes:N1::heat', 'N1::heat_pipes:X1::heat', 'X1::chp::heat', 'X1::chp::electricity', 'X1::pv::electricity', 'X2::pv::electricity', 'X2::power_lines:X1::electricity', 'X2::supply_gas::gas', 'X3::heat_pipes:N1::heat', 'N1::heat_pipes:X2::heat'], dtype='<U34')
array(['X2::supply_gas::gas', 'X3::pv::electricity', 'X1::supply_grid_power::electricity', 'X1::pv::electricity', 'X2::pv::electricity', 'X3::supply_gas::gas', 'X1::supply_gas::gas'], dtype='<U34')
array(['X2::supply_gas::gas', 'X3::pv::electricity', 'X1::supply_grid_power::electricity', 'X1::pv::electricity', 'X2::pv::electricity', 'X3::boiler::heat', 'X3::supply_gas::gas', 'X2::boiler::heat', 'X1::supply_gas::gas', 'X1::chp::heat', 'X1::chp::electricity'], dtype='<U34')
array(['X3::boiler', 'X2::boiler'], dtype='<U10')
array(['X3::boiler', 'X2::boiler', 'X1::chp'], dtype='<U10')
array(['X3::power_lines:X1', 'X2::supply_gas', 'X3::boiler', 'X3::supply_gas', 'X1::heat_pipes:N1', 'N1::heat_pipes:X3', 'X1::supply_grid_power', 'X3::pv', 'N1::heat_pipes:X2', 'X1::chp', 'X1::power_lines:X3', 'N1::heat_pipes:X1', 'X1::pv', 'X2::power_lines:X1', 'X1::power_lines:X2', 'X1::supply_gas', 'X2::heat_pipes:N1', 'X3::heat_pipes:N1', 'X2::pv', 'X2::boiler'], dtype='<U21')
array(['X2::pv', 'X1::chp'], dtype='<U7')
array(['X2::demand_electricity', 'X1::demand_heat', 'X3::demand_heat', 'X1::demand_electricity', 'X2::demand_heat', 'X3::demand_electricity'], dtype='<U22')
array(['X2::demand_electricity', 'X1::demand_heat', 'X3::demand_heat', 'X1::demand_electricity', 'X2::demand_heat', 'X3::demand_electricity'], dtype='<U22')
array(['X1::pv', 'X2::pv', 'X3::pv'], dtype='<U6')
array(['X2::demand_electricity', 'X2::supply_gas', 'X3::pv', 'X1::demand_heat', 'X3::boiler', 'X3::demand_heat', 'X1::supply_grid_power', 'X1::chp', 'X3::supply_gas', 'X1::pv', 'X2::demand_heat', 'X1::supply_gas', 'X1::demand_electricity', 'X3::demand_electricity', 'X2::pv', 'X2::boiler'], dtype='<U22')
array(['X3::boiler', 'X2::boiler'], dtype='<U10')
array(['X1::chp'], dtype='<U7')
array(['X1::supply_grid_power', 'X2::supply_gas', 'X1::supply_gas', 'X3::supply_gas'], dtype='<U21')
array(['X2::pv', 'X3::pv'], dtype='<U6')
array(['X1::chp'], dtype='<U7')
array(['X1::supply_gas', 'X2::supply_gas', 'X1::supply_grid_power', 'X3::supply_gas'], dtype='<U21')
array(['X1::pv', 'X2::supply_gas', 'X1::supply_gas', 'X3::pv', 'X2::pv', 'X1::supply_grid_power', 'X3::supply_gas'], dtype='<U21')
array(['X2::supply_gas', 'X3::pv', 'X2::boiler', 'X3::boiler', 'X3::supply_gas', 'X1::chp', 'X1::pv', 'X1::supply_gas', 'X2::pv', 'X1::supply_grid_power'], dtype='<U21')
array(['X3::heat', 'X2::heat', 'X2::gas', 'N1::heat', 'X3::electricity', 'X1::heat', 'X3::gas', 'X2::electricity', 'X1::electricity', 'X1::gas'], dtype='<U15')
array(['X2::demand_electricity', 'X1::demand_heat', 'X3::demand_heat', 'X1::demand_electricity', 'X2::demand_heat', 'X3::demand_electricity'], dtype='<U22')
array(['X1::pv', 'X2::pv', 'X3::pv'], dtype='<U6')
array(['X3::power_lines:X1', 'X1::power_lines:X3', 'X1::heat_pipes:N1', 'N1::heat_pipes:X1', 'X2::power_lines:X1', 'X1::power_lines:X2', 'N1::heat_pipes:X3', 'X2::heat_pipes:N1', 'X3::heat_pipes:N1', 'N1::heat_pipes:X2'], dtype='<U18')
array(['X1::pv', 'X2::pv', 'X3::pv'], dtype='<U6')
array(['X3::power_lines:X1', 'X2::supply_gas', 'X3::boiler', 'X3::supply_gas', 'X1::heat_pipes:N1', 'N1::heat_pipes:X3', 'X1::supply_grid_power', 'X3::pv', 'N1::heat_pipes:X2', 'X1::chp', 'X1::power_lines:X3', 'N1::heat_pipes:X1', 'X1::pv', 'X2::power_lines:X1', 'X1::power_lines:X2', 'X1::supply_gas', 'X2::heat_pipes:N1', 'X3::heat_pipes:N1', 'X2::pv', 'X2::boiler'], dtype='<U21')
array(['X3::power_lines:X1', 'X2::supply_gas', 'X3::boiler', 'X3::supply_gas', 'X1::heat_pipes:N1', 'N1::heat_pipes:X3', 'X1::supply_grid_power', 'X3::pv', 'N1::heat_pipes:X2', 'X1::chp', 'X1::power_lines:X3', 'N1::heat_pipes:X1', 'X1::pv', 'X2::power_lines:X1', 'X1::power_lines:X2', 'X1::supply_gas', 'X2::heat_pipes:N1', 'X3::heat_pipes:N1', 'X2::pv', 'X2::boiler'], dtype='<U21')
array(['X2::supply_gas', 'X3::pv', 'X1::supply_grid_power', 'X3::supply_gas', 'X1::supply_gas', 'X2::pv'], dtype='<U21')
array(['X3::electricity', 'X2::electricity', 'X1::electricity'], dtype='<U15')
array(['X3::pv::electricity', 'X2::pv::electricity', 'X1::pv::electricity', 'X1::chp::electricity'], dtype='<U20')
array(['X3::pv', 'X1::chp', 'X2::pv'], dtype='<U7')
array(['X1::pv', 'X2::pv', 'X3::pv'], dtype='<U6')
array(['X1::pv', 'X2::pv', 'X3::pv'], dtype='<U6')
array(['X2', 'X1', 'X3'], dtype='<U2')
array(['X2::demand_electricity', 'X3::power_lines:X1', 'X2::supply_gas', 'X1::demand_heat', 'X3::boiler', 'X3::demand_heat', 'X3::supply_gas', 'X1::heat_pipes:N1', 'N1::heat_pipes:X3', 'X2::demand_heat', 'X3::demand_electricity', 'X1::supply_grid_power', 'X3::pv', 'N1::heat_pipes:X2', 'X1::chp', 'X1::power_lines:X3', 'N1::heat_pipes:X1', 'X1::pv', 'X2::power_lines:X1', 'X1::power_lines:X2', 'X1::supply_gas', 'X1::demand_electricity', 'X2::heat_pipes:N1', 'X3::heat_pipes:N1', 'X2::pv', 'X2::boiler'], dtype='<U22')
array(['X1::power_lines:X3::electricity', 'X3::boiler::heat', 'X2::boiler::heat', 'X3::power_lines:X1::electricity', 'X1::supply_gas::gas', 'X1::power_lines:X2::electricity', 'X3::pv::electricity', 'X1::supply_grid_power::electricity', 'X2::heat_pipes:N1::heat', 'X3::supply_gas::gas', 'N1::heat_pipes:X3::heat', 'X1::heat_pipes:N1::heat', 'N1::heat_pipes:X1::heat', 'X1::pv::electricity', 'X2::pv::electricity', 'X2::power_lines:X1::electricity', 'X2::supply_gas::gas', 'X3::heat_pipes:N1::heat', 'N1::heat_pipes:X2::heat'], dtype='<U34')
array(['X3::demand_electricity::electricity', 'X1::power_lines:X3::electricity', 'X3::demand_heat::heat', 'X3::power_lines:X1::electricity', 'X1::power_lines:X2::electricity', 'X2::heat_pipes:N1::heat', 'N1::heat_pipes:X3::heat', 'X1::heat_pipes:N1::heat', 'N1::heat_pipes:X1::heat', 'X2::demand_heat::heat', 'X1::demand_electricity::electricity', 'X2::power_lines:X1::electricity', 'X2::demand_electricity::electricity', 'X1::demand_heat::heat', 'X3::heat_pipes:N1::heat', 'N1::heat_pipes:X2::heat'], dtype='<U35')
array(['X1::pv', 'X2::pv', 'X3::pv'], dtype='<U6')
array(['X3::boiler', 'X2::boiler'], dtype='<U10')
array(['X3::boiler', 'X2::boiler'], dtype='<U10')
array(['X1::chp'], dtype='<U7')
array(['X1::chp'], dtype='<U7')
array(['X1::chp'], dtype='<U7')
array(['X1::chp'], dtype='<U7')
array(['X3::power_lines:X1', 'X1::power_lines:X3', 'X1::heat_pipes:N1', 'N1::heat_pipes:X1', 'X2::power_lines:X1', 'X1::power_lines:X2', 'N1::heat_pipes:X3', 'X2::heat_pipes:N1', 'X3::heat_pipes:N1', 'N1::heat_pipes:X2'], dtype='<U18')
array([ nan, 2000., 2000., nan, 600., nan, 2000., 2000., 2000., nan, nan, 2000., 50., 2000., 1500., 2000., 2000., 250., 2000., 2000., 2000., nan, 2000., 2000., 250., 600.])
array([[-9.45458012e+01, -7.69606192e+01, -7.74757501e+01, -7.74757501e+01, -8.27314956e+01, -1.48533479e+02, -1.89570817e+02, -2.38734711e+02, -2.44284493e+02, -2.31440181e+02, -2.22530771e+02, -2.22593033e+02, -2.04439029e+02, -1.96128922e+02, -2.04488194e+02, -2.25942018e+02, -1.93132717e+02, -2.59507784e+02, -2.49024872e+02, -2.60251628e+02, -2.54605599e+02, -2.05449509e+02, -1.35232572e+02, -9.47389753e+01, -1.02582511e+02, -8.58988086e+01, -8.43534158e+01, -8.66715049e+01, -9.08969886e+01, -1.47760782e+02, -1.99099472e+02, -2.38777508e+02, -2.35119872e+02, -2.31648466e+02, -2.27171841e+02, -2.27213317e+02, -1.99838408e+02, -1.91537233e+02, -1.99895515e+02, -2.21324570e+02, -1.88344877e+02, -2.49962248e+02, -2.48894106e+02, -2.69344347e+02, -2.45412357e+02, -1.96280957e+02, -1.35289242e+02, -1.03741556e+02], [ 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 7.85714300e-03, 2.91428570e-02, 5.55714290e-02, 7.84285710e-02, 9.60000000e-02, 1.08142857e-01, 1.07571429e-01, ... -1.87629121e+01, -1.87629121e+01, -1.87629121e+01, -1.89544182e+01, -1.91459244e+01, -1.87629121e+01, -1.87629121e+01, -1.87629121e+01, -1.87629121e+01, -1.87629121e+01, -1.87629121e+01, -1.87629121e+01], [ 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 7.85714300e-03, 2.91428570e-02, 5.55714290e-02, 7.84285710e-02, 9.60000000e-02, 1.08142857e-01, 1.07571429e-01, 9.00000000e-02, 7.11428570e-02, 6.44285710e-02, 5.07142860e-02, 3.85714290e-02, 2.62857140e-02, 9.71428600e-03, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 8.14285700e-03, 2.87142860e-02, 4.85714290e-02, 6.81428570e-02, 9.01428570e-02, 1.07571429e-01, 1.11285714e-01, 1.02857143e-01, 8.17142860e-02, 5.78571430e-02, 4.11428570e-02, 2.70000000e-02, 1.47142860e-02, 6.14285700e-03, 8.57143000e-04, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00]])
array([7, 7, 7])
array([ True, True, True, True, True, True, True, True, True])
array([0.85, 0.85, 0.85])
array([nan, 1., nan, nan, 1., nan, nan, nan, 1.])
array(['energy', 'energy_per_area', 'energy', 'energy', 'energy_per_area', 'energy', 'energy', 'energy', 'energy_per_area'], dtype=object)
array([nan, 25., 25., nan, 25., nan, 25., 25., 25., nan, nan, 25., 25., 25., 25., 25., 25., 25., 25., 25., 25., nan, 25., 25., 25., 25.])
array([ 1., 1., nan, 1., 1., 1., nan, 1., 1., 1., 1., nan, nan, 1., 1., 1., 1., nan, 1., 1., nan, 1., 1., 1., nan, 1.])
array([nan, 1., 1., nan, 1., nan, 1., 1., 1., nan, nan, 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., nan, 1., 1., 1., 1.])
array(['electricity', 'electricity', 'electricity', 'electricity'], dtype=object)
array([1500, 1500, 1500])
array([ nan, 0.98 , nan, nan, 0.85 , nan, nan, 0.92685937, 0.90368789, nan, nan, nan, nan, 0.92685937, 0.405 , 0.98 , 0.92685937, nan, 0.98 , 0.98 , nan, nan, 0.92685937, 0.90368789, nan, 0.85 ])
array([[ nan, nan, nan, nan, 0.004 , nan, nan, -0.0203, nan]])
array([[0.025, nan, 0.004, 0.1 , nan, 0.025, 0.025, nan, 0.004]])
array([[5.00e-02, 1.00e+00, 7.80e+01, 1.00e+00, 9.00e-01, 1.20e+00, 1.00e+02, 1.35e+03, 9.00e-01, 7.50e+02, 5.00e-02, 9.00e-01, 1.35e+03, 1.00e-01, 1.00e-01, 1.00e+00, 9.00e-01, 1.20e+00, 1.35e+03, 4.31e+01]])
array([[ nan, -80.5, nan, nan, nan, nan, nan, nan, nan]])
array([[0.11016807, 0.11016807, 0.11016807, 0.11016807, 0.11016807, 0.11016807, 0.11016807, 0.11016807, 0.11016807, 0.11016807, 0.11016807, 0.11016807, 0.11016807, 0.11016807, 0.11016807, 0.11016807, 0.11016807, 0.11016807, 0.11016807, 0.11016807]])
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.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 , -0.0491 ], [ nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan]]])
array([ 5., 5., 3., 3., 10., 10., 4., 3., 4., 3.])
array(['X1::power_lines:X3', 'X3::power_lines:X1', 'N1::heat_pipes:X1', 'X1::heat_pipes:N1', 'X1::power_lines:X2', 'X2::power_lines:X1', 'X3::heat_pipes:N1', 'N1::heat_pipes:X2', 'N1::heat_pipes:X3', 'X2::heat_pipes:N1'], dtype=object)
array([ nan, 1300., 500., 900.])
array([[5, 7], [8, 7], [2, 7], [5, 3]])
array(['#F9D956', '#6783E3', '#072486', '#C5ABE3', '#8E2999', '#E4AB97', '#C98AAD', '#823739', '#660507'], dtype=object)
array(['supply_power_plus.supply_plus', 'transmission', 'demand', 'supply', 'conversion', 'conversion_plus', 'supply', 'transmission', 'demand'], dtype=object)
array(['Solar photovoltaic power', 'Electrical power distribution', 'Electrical demand', 'National grid import', 'Natural gas boiler', 'Combined heat and power', 'Natural gas import', 'District heat distribution', 'Heat demand'], dtype=object)
array([[1. , 0.8, 1. ], [1. , 1. , 1. ], [1. , 1. , 1. ]])
array(['X3::demand_heat::heat,X3::heat_pipes:N1::heat,X3::boiler::heat', 'X2::demand_heat::heat,X2::heat_pipes:N1::heat,X2::boiler::heat', 'X2::boiler::gas,X2::supply_gas::gas', 'N1::heat_pipes:X2::heat,N1::heat_pipes:X1::heat,N1::heat_pipes:X3::heat', 'X3::power_lines:X1::electricity,X3::demand_electricity::electricity,X3::pv::electricity', 'X1::demand_heat::heat,X1::chp::heat,X1::heat_pipes:N1::heat', 'X3::boiler::gas,X3::supply_gas::gas', 'X2::power_lines:X1::electricity,X2::pv::electricity,X2::demand_electricity::electricity', 'X1::supply_grid_power::electricity,X1::pv::electricity,X1::power_lines:X3::electricity,X1::demand_electricity::electricity,X1::power_lines:X2::electricity,X1::chp::electricity', 'X1::chp::gas,X1::supply_gas::gas'], dtype=object)
array(['X2::demand_electricity::electricity', 'X3::power_lines:X1::electricity', 'X2::supply_gas::gas', 'X1::demand_heat::heat', 'X3::demand_heat::heat', 'X3::supply_gas::gas', 'X1::heat_pipes:N1::heat', 'N1::heat_pipes:X3::heat', 'X2::demand_heat::heat', 'X3::demand_electricity::electricity', 'X1::supply_grid_power::electricity', 'X3::pv::electricity', 'N1::heat_pipes:X2::heat', 'X1::power_lines:X3::electricity', 'X1::power_lines:X2::electricity', 'N1::heat_pipes:X1::heat', 'X1::pv::electricity', 'X2::power_lines:X1::electricity', 'X2::heat_pipes:N1::heat', 'X1::supply_gas::gas', 'X1::demand_electricity::electricity', 'X3::heat_pipes:N1::heat', 'X2::pv::electricity'], dtype=object)
array([[None, 'X3::boiler::gas', 'X3::boiler::heat'], [None, 'X2::boiler::gas', 'X2::boiler::heat']], dtype=object)
array(['X1::chp::gas'], dtype=object)
array(['X1::chp::electricity'], dtype=object)
array([['X1::chp::heat', 'X1::chp::gas', 'X1::chp::electricity']], dtype=object)
array(['X1::pv::electricity', 'X2::pv::electricity', 'X3::pv::electricity', 'X1::chp::electricity'], dtype=object)
array(['', 'X2::pv', 'X1::pv', 'X3::pv'], dtype=object)
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.])
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.])
array(['2005-07-01T00:00:00.000000000', '2005-07-01T07:00:00.000000000', '2005-07-01T08:00:00.000000000'], dtype='datetime64[ns]')
# We can find the same PV energy_cap_max data as seen in m._model_run
m._model_data.energy_cap_max.loc[{'loc_techs': 'X2::pv'}]
<xarray.DataArray 'energy_cap_max' ()> array(250.) Coordinates: loc_techs <U6 'X2::pv' Attributes: is_result: 0
array(250.)
array('X2::pv', dtype='<U6')
m._model_data.energy_cap_max.loc[{'loc_techs': 'X3::pv'}]
<xarray.DataArray 'energy_cap_max' ()> array(50.) Coordinates: loc_techs <U6 'X3::pv' Attributes: is_result: 0
array(50.)
array('X3::pv', dtype='<U6')
# We can also see the constraint-specific set of loc::techs for setting the energy capacity constraint
m._model_data.loc_techs_energy_capacity_constraint
<xarray.DataArray 'loc_techs_energy_capacity_constraint' (loc_techs_energy_capacity_constraint: 26)> array(['X2::demand_electricity', 'X3::power_lines:X1', 'X2::supply_gas', 'X1::demand_heat', 'X3::boiler', 'X3::demand_heat', 'X3::supply_gas', 'X1::heat_pipes:N1', 'N1::heat_pipes:X3', 'X2::demand_heat', 'X3::demand_electricity', 'X1::supply_grid_power', 'X3::pv', 'N1::heat_pipes:X2', 'X1::chp', 'X1::power_lines:X3', 'N1::heat_pipes:X1', 'X1::pv', 'X2::power_lines:X1', 'X1::power_lines:X2', 'X1::supply_gas', 'X1::demand_electricity', 'X2::heat_pipes:N1', 'X3::heat_pipes:N1', 'X2::pv', 'X2::boiler'], dtype='<U22') Coordinates: * loc_techs_energy_capacity_constraint (loc_techs_energy_capacity_constraint) <U22 ...
array(['X2::demand_electricity', 'X3::power_lines:X1', 'X2::supply_gas', 'X1::demand_heat', 'X3::boiler', 'X3::demand_heat', 'X3::supply_gas', 'X1::heat_pipes:N1', 'N1::heat_pipes:X3', 'X2::demand_heat', 'X3::demand_electricity', 'X1::supply_grid_power', 'X3::pv', 'N1::heat_pipes:X2', 'X1::chp', 'X1::power_lines:X3', 'N1::heat_pipes:X1', 'X1::pv', 'X2::power_lines:X1', 'X1::power_lines:X2', 'X1::supply_gas', 'X1::demand_electricity', 'X2::heat_pipes:N1', 'X3::heat_pipes:N1', 'X2::pv', 'X2::boiler'], dtype='<U22')
array(['X2::demand_electricity', 'X3::power_lines:X1', 'X2::supply_gas', 'X1::demand_heat', 'X3::boiler', 'X3::demand_heat', 'X3::supply_gas', 'X1::heat_pipes:N1', 'N1::heat_pipes:X3', 'X2::demand_heat', 'X3::demand_electricity', 'X1::supply_grid_power', 'X3::pv', 'N1::heat_pipes:X2', 'X1::chp', 'X1::power_lines:X3', 'N1::heat_pipes:X1', 'X1::pv', 'X2::power_lines:X1', 'X1::power_lines:X2', 'X1::supply_gas', 'X1::demand_electricity', 'X2::heat_pipes:N1', 'X3::heat_pipes:N1', 'X2::pv', 'X2::boiler'], dtype='<U22')
# It is these constraint sets that we cannot see in m.inputs
m.inputs.loc_techs_energy_capacity_constraint
--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-17-42f363389220> in <module> 1 # It is these constraint sets that we cannot see in m.inputs ----> 2 m.inputs.loc_techs_energy_capacity_constraint ~/miniconda3/envs/calliope/lib/python3.8/site-packages/xarray/core/common.py in __getattr__(self, name) 237 with suppress(KeyError): 238 return source[name] --> 239 raise AttributeError( 240 "{!r} object has no attribute {!r}".format(type(self).__name__, name) 241 ) AttributeError: 'Dataset' object has no attribute 'loc_techs_energy_capacity_constraint'
m.run()
[2021-07-29 16:01:51] INFO Backend: starting model run [2021-07-29 16:01:52] INFO Loading sets [2021-07-29 16:01:52] INFO Loading parameters [2021-07-29 16:01:52] INFO constraints are loaded in the following order: ['capacity', 'dispatch', 'policy', 'energy_balance', 'costs', 'network', 'conversion', 'group', 'conversion_plus', 'export', 'milp'] [2021-07-29 16:01:52] INFO creating capacity constraints [2021-07-29 16:01:52] INFO creating dispatch constraints [2021-07-29 16:01:52] INFO creating policy constraints [2021-07-29 16:01:52] INFO creating energy_balance constraints [2021-07-29 16:01:52] INFO creating costs constraints [2021-07-29 16:01:52] INFO creating network constraints [2021-07-29 16:01:52] INFO creating conversion constraints [2021-07-29 16:01:52] INFO creating group constraints [2021-07-29 16:01:52] INFO creating conversion_plus constraints [2021-07-29 16:01:52] INFO creating export constraints [2021-07-29 16:01:52] INFO creating milp constraints [2021-07-29 16:01:52] INFO Backend: model generated. Time since start of model run: 0:00:00.631226 [2021-07-29 16:01:52] INFO Backend: sending model to solver [2021-07-29 16:01:52] INFO Backend: solver finished running. Time since start of model run: 0:00:00.981061 [2021-07-29 16:01:52] INFO Backend: loaded results [2021-07-29 16:01:52] INFO Backend: generated solution array. Time since start of model run: 0:00:01.057160 [2021-07-29 16:01:52] INFO Postprocessing: started [2021-07-29 16:01:53] INFO Postprocessing: All values < 1e-10 set to 0 in system_balance [2021-07-29 16:01:53] INFO Postprocessing: ended. Time since start of model run: 0:00:01.166295
# Results are processed and merged into m.model data, and can be viewed in m.results
m.results
<xarray.Dataset> Dimensions: (carriers: 3, costs: 1, loc_carriers: 10, loc_carriers_system_balance_constraint: 10, loc_tech_carriers_con: 19, loc_tech_carriers_export: 4, loc_tech_carriers_prod: 21, loc_techs: 26, loc_techs_area: 3, loc_techs_balance_demand_constraint: 6, loc_techs_cost: 20, loc_techs_cost_investment_constraint: 20, loc_techs_investment_cost: 20, loc_techs_om_cost: 9, loc_techs_supply_plus: 3, techs: 16, timesteps: 48) Coordinates: (12/17) * carriers (carriers) <U11 'electricity' ...... * loc_carriers (loc_carriers) object 'N1::heat' ... * loc_carriers_system_balance_constraint (loc_carriers_system_balance_constraint) object ... * loc_tech_carriers_con (loc_tech_carriers_con) object 'N... * loc_tech_carriers_export (loc_tech_carriers_export) object ... * loc_tech_carriers_prod (loc_tech_carriers_prod) object '... ... ... * techs (techs) object 'boiler' ... 'supp... * costs (costs) object 'monetary' * loc_techs (loc_techs) object 'X2::demand_el... * loc_techs_area (loc_techs_area) object 'X1::pv' ... * loc_techs_supply_plus (loc_techs_supply_plus) object 'X... * timesteps (timesteps) datetime64[ns] 2005-0... Data variables: (12/19) energy_cap (loc_techs) float64 269.3 ... 192.8 carrier_prod (loc_tech_carriers_prod, timesteps) float64 ... carrier_con (loc_tech_carriers_con, timesteps) float64 ... cost (costs, loc_techs_cost) float64 0... resource_area (loc_techs_area) float64 0.0 ... ... resource_con (loc_techs_supply_plus, timesteps) float64 ... ... ... cost_investment_rhs (costs, loc_techs_cost_investment_constraint) float64 ... cost_var_rhs (costs, loc_techs_om_cost, timesteps) float64 ... capacity_factor (timesteps, loc_tech_carriers_prod) float64 ... systemwide_capacity_factor (carriers, techs) float64 0.0 ...... systemwide_levelised_cost (carriers, costs, techs) float64 ... total_levelised_cost (carriers, costs) float64 0.08069... Attributes: termination_condition: optimal objective_function_value: 842.3529094335402 solution_time: 1.05716 time_finished: 2021-07-29 16:01:52 calliope_version: 0.6.7-dev applied_overrides: scenario: None defaults: available_area: null\ncarrier_ratios: false\nc... allow_operate_mode: 1 model_config: calliope_version: 0.6.7\nname: Urban-scale exa... run_config: backend: pyomo\nbigM: 1000000.0\ncyclic_storag...
array(['electricity', 'gas', 'heat'], dtype='<U11')
array(['N1::heat', 'X1::electricity', 'X1::gas', 'X1::heat', 'X2::electricity', 'X2::gas', 'X2::heat', 'X3::electricity', 'X3::gas', 'X3::heat'], dtype=object)
array(['N1::heat', 'X1::electricity', 'X1::gas', 'X1::heat', 'X2::electricity', 'X2::gas', 'X2::heat', 'X3::electricity', 'X3::gas', 'X3::heat'], dtype=object)
array(['N1::heat_pipes:X1::heat', 'N1::heat_pipes:X2::heat', 'N1::heat_pipes:X3::heat', 'X1::chp::gas', 'X1::demand_electricity::electricity', 'X1::demand_heat::heat', 'X1::heat_pipes:N1::heat', 'X1::power_lines:X2::electricity', 'X1::power_lines:X3::electricity', 'X2::boiler::gas', 'X2::demand_electricity::electricity', 'X2::demand_heat::heat', 'X2::heat_pipes:N1::heat', 'X2::power_lines:X1::electricity', 'X3::boiler::gas', 'X3::demand_electricity::electricity', 'X3::demand_heat::heat', 'X3::heat_pipes:N1::heat', 'X3::power_lines:X1::electricity'], dtype=object)
array(['X1::chp::electricity', 'X1::pv::electricity', 'X2::pv::electricity', 'X3::pv::electricity'], dtype=object)
array(['N1::heat_pipes:X1::heat', 'N1::heat_pipes:X2::heat', 'N1::heat_pipes:X3::heat', 'X1::chp::electricity', 'X1::chp::heat', 'X1::heat_pipes:N1::heat', 'X1::power_lines:X2::electricity', 'X1::power_lines:X3::electricity', 'X1::pv::electricity', 'X1::supply_gas::gas', 'X1::supply_grid_power::electricity', 'X2::boiler::heat', 'X2::heat_pipes:N1::heat', 'X2::power_lines:X1::electricity', 'X2::pv::electricity', 'X2::supply_gas::gas', 'X3::boiler::heat', 'X3::heat_pipes:N1::heat', 'X3::power_lines:X1::electricity', 'X3::pv::electricity', 'X3::supply_gas::gas'], dtype=object)
array(['X1::demand_electricity', 'X1::demand_heat', 'X2::demand_electricity', 'X2::demand_heat', 'X3::demand_electricity', 'X3::demand_heat'], dtype=object)
array(['N1::heat_pipes:X1', 'N1::heat_pipes:X2', 'N1::heat_pipes:X3', 'X1::chp', 'X1::heat_pipes:N1', 'X1::power_lines:X2', 'X1::power_lines:X3', 'X1::pv', 'X1::supply_gas', 'X1::supply_grid_power', 'X2::boiler', 'X2::heat_pipes:N1', 'X2::power_lines:X1', 'X2::pv', 'X2::supply_gas', 'X3::boiler', 'X3::heat_pipes:N1', 'X3::power_lines:X1', 'X3::pv', 'X3::supply_gas'], dtype=object)
array(['N1::heat_pipes:X1', 'N1::heat_pipes:X2', 'N1::heat_pipes:X3', 'X1::chp', 'X1::heat_pipes:N1', 'X1::power_lines:X2', 'X1::power_lines:X3', 'X1::pv', 'X1::supply_gas', 'X1::supply_grid_power', 'X2::boiler', 'X2::heat_pipes:N1', 'X2::power_lines:X1', 'X2::pv', 'X2::supply_gas', 'X3::boiler', 'X3::heat_pipes:N1', 'X3::power_lines:X1', 'X3::pv', 'X3::supply_gas'], dtype=object)
array(['N1::heat_pipes:X1', 'N1::heat_pipes:X2', 'N1::heat_pipes:X3', 'X1::chp', 'X1::heat_pipes:N1', 'X1::power_lines:X2', 'X1::power_lines:X3', 'X1::pv', 'X1::supply_gas', 'X1::supply_grid_power', 'X2::boiler', 'X2::heat_pipes:N1', 'X2::power_lines:X1', 'X2::pv', 'X2::supply_gas', 'X3::boiler', 'X3::heat_pipes:N1', 'X3::power_lines:X1', 'X3::pv', 'X3::supply_gas'], dtype=object)
array(['X1::chp', 'X1::supply_gas', 'X1::supply_grid_power', 'X2::boiler', 'X2::pv', 'X2::supply_gas', 'X3::boiler', 'X3::pv', 'X3::supply_gas'], dtype=object)
array(['boiler', 'chp', 'demand_electricity', 'demand_heat', 'heat_pipes', 'heat_pipes:N1', 'heat_pipes:X1', 'heat_pipes:X2', 'heat_pipes:X3', 'power_lines', 'power_lines:X1', 'power_lines:X2', 'power_lines:X3', 'pv', 'supply_gas', 'supply_grid_power'], dtype=object)
array(['monetary'], dtype=object)
array(['X2::demand_electricity', 'X3::power_lines:X1', 'X2::supply_gas', 'X1::demand_heat', 'X3::boiler', 'X3::demand_heat', 'X3::supply_gas', 'X1::heat_pipes:N1', 'N1::heat_pipes:X3', 'X2::demand_heat', 'X3::demand_electricity', 'X1::supply_grid_power', 'X3::pv', 'N1::heat_pipes:X2', 'X1::chp', 'X1::power_lines:X3', 'N1::heat_pipes:X1', 'X1::pv', 'X2::power_lines:X1', 'X1::power_lines:X2', 'X1::supply_gas', 'X1::demand_electricity', 'X2::heat_pipes:N1', 'X3::heat_pipes:N1', 'X2::pv', 'X2::boiler'], dtype=object)
array(['X1::pv', 'X2::pv', 'X3::pv'], dtype=object)
array(['X1::pv', 'X2::pv', 'X3::pv'], dtype=object)
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]')
array([2.6934435e+02, 4.5778336e+01, 2.2685938e+02, 1.7197109e+00, 1.5600000e-02, 9.3982291e+00, 1.8352941e-02, 5.9805562e+02, 1.0382599e+01, 3.6513767e+02, 6.4927357e+01, 3.3620147e+01, 5.0000000e+01, 1.9024262e+02, 2.6094670e+02, 4.5778336e+01, 5.9805562e+02, 0.0000000e+00, 2.7451170e+02, 2.7451170e+02, 6.4431283e+02, 1.3079378e+00, 1.9024262e+02, 1.0382599e+01, 6.3309509e+01, 1.9283047e+02])
array([[ 1.8347552e+02, 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], [ 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, ..., 0.0000000e+00, 0.0000000e+00, 0.0000000e+00], ..., [ 1.8762912e+01, 1.8762912e+01, 1.8762912e+01, ..., 1.8762912e+01, 1.8762912e+01, 1.8762912e+01], [-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]])
array([[-1.1361811e+02, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, -2.7045467e+02, -2.5484356e+02, -1.2560759e+02, -1.5322612e+02, -4.4831025e+02, -2.1324441e+02, -3.7774524e+02, -8.6187421e+01, -1.1055513e+02, -7.8601058e+01, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, -1.4637166e+01, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, -6.5461745e+01, 0.0000000e+00, 0.0000000e+00, -1.5890406e+02, -4.5796449e+02, -2.0981434e+02, -4.2081827e+02, -9.3580646e+01, -1.2820907e+02, -9.0680386e+01, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00], [-6.9840142e+01, -7.1606325e+01, -7.2915564e+01, -7.2812606e+01, -7.5581024e+01, -1.2491161e+02, -1.5259680e+02, -1.8590437e+02, -1.8870860e+02, -1.9024262e+02, -1.5988090e+02, -1.2204832e+02, -1.1778066e+02, -1.1760093e+02, -1.2275740e+02, -1.9024262e+02, -1.1397022e+02, -1.3861363e+02, -1.8061940e+02, -1.7630104e+02, -1.8180682e+02, -1.6903901e+02, -1.1675699e+02, -8.5134121e+01, -8.9840988e+01, -7.9301394e+01, -7.7004849e+01, -7.9369632e+01, -8.1303212e+01, -1.2298933e+02, -1.5739583e+02, -1.8205536e+02, ... 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00], [ 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, -1.5095879e+00, -8.0545879e+00, -1.3239588e+01, -1.4344588e+01, -1.1837088e+01, -5.5470880e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00]])
array([[1.6246019e-01, 5.1678896e-02, 3.7605400e-03, 1.5499880e+02, 1.6246019e-01, 8.2855959e-03, 6.9086452e-04, 0.0000000e+00, 5.6915988e+02, 1.4735890e+01, 1.1713117e+01, 5.1678896e-02, 8.2855959e-03, 3.0598098e+01, 4.1987552e+01, 2.4964167e-03, 3.7605400e-03, 6.9086452e-04, 1.8692301e+01, 1.1022844e-02]])
array([ 0. , 443.16656, 350. ])
array([[ 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. ], [ 0. , 0. , 0. , 0. , 0. , 3.482023 , 12.91514 , 24.627399 , 34.75692 , 42.54399 , 47.925298 , 47.67206 , 39.884991 , 31.528135 , 28.552588 , 22.474876 , 17.093568 , 11.648949 , 4.3050467 , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 3.6086419 , 12.725211 , 21.525233 , 30.198636 , 39.9483 , 47.67206 , 49.318107 , 45.582846 , 36.213039 , 25.640351 , 18.233138 , 11.965497 , 6.5208795 , 2.7223088 , 0.37985712, 0. , 0. , 0. , 0. ], [ 0. , 0. , 0. , 0. , 0. , 2.7500001 , 10.2 , 19.45 , 27.45 , 33.6 , 37.85 , 37.65 , 31.5 , 24.9 , 22.55 , 17.75 , 13.5 , 9.1999999 , 3.4000001 , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 2.8499999 , 10.05 , 17. , 23.85 , 31.55 , 37.65 , 38.95 , 36. , 28.6 , 20.25 , 14.4 , 9.45 , 5.1500001 , 2.1499999 , 0.30000005, 0. , 0. , 0. , 0. ]])
array([ 0. , 49.318107, 38.95 ])
array([[ 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. ], [ 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. ], [ 0. , 0. , 0. , 0. , 0. , 2.9597196, 10.977869 , 0. , 0. , 25.636813 , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 3.0673456, 10.81643 , 18.296448 , 25.66884 , 33.956055 , 36.38208 , 0. , 6.2331516, 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. ], [ 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. ]])
array([[[ 4.6430680e-01, 3.9233148e-01, 3.9438403e-01, 3.9438684e-01, 4.1602323e-01, 7.2230558e-01, 8.8511024e-01, 1.0437868e+00, 1.0437868e+00, 1.0437868e+00, 8.7860512e-01, 8.7511111e-01, 8.3877504e-01, 7.4073125e-01, 7.8816536e-01, 9.1537350e-01, 7.8479581e-01, 1.0437868e+00, 1.0437868e+00, 1.0437868e+00, 1.0437868e+00, 9.1955008e-01, 6.3185784e-01, 4.6551101e-01, 4.9710970e-01, 4.2881389e-01, 4.2245614e-01, 4.3192053e-01, 4.4935177e-01, 6.7207208e-01, 8.5729701e-01, 9.9506101e-01, 9.5651533e-01, 9.1676056e-01, 8.6133265e-01, 7.0288311e-01, 6.3927236e-01, 6.3705454e-01, 7.3600419e-01, 8.7063503e-01, 7.7636511e-01, 1.0437868e+00, 1.0437868e+00, 1.0437868e+00, 1.0437868e+00, 8.8212742e-01, 6.3208915e-01, 5.0225623e-01], [ 7.1652284e+00, 6.0544982e+00, 6.0861733e+00, 6.0862166e+00, 6.4201116e+00, 1.1146691e+01, 1.3659109e+01, 1.6107821e+01, 1.6107821e+01, 1.6107821e+01, 1.3558721e+01, 1.3504801e+01, 1.2944059e+01, 1.1431038e+01, 1.2163046e+01, 1.4126134e+01, 1.2111046e+01, 1.6107821e+01, 1.6107821e+01, 1.6107821e+01, 1.6107821e+01, 1.4190588e+01, 9.7508927e+00, 7.1838118e+00, 7.6714460e+00, 6.6174983e+00, 6.5193848e+00, 6.6654403e+00, 6.9344409e+00, 1.0371483e+01, 1.3229892e+01, 1.5355880e+01, ... 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00], [ 0.0000000e+00, 4.5882353e-04, 4.5882353e-04, 4.5882353e-04, 4.5882353e-04, 4.5882353e-04, 4.5882353e-04, 4.5882353e-04, 4.5882353e-04, 4.5882353e-04, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 4.5882353e-04, 4.5882353e-04, 4.5882353e-04, 0.0000000e+00, 4.5882353e-04, 4.5882353e-04, 4.5882353e-04, 4.5882353e-04, 4.5882353e-04, 4.5882353e-04, 4.5882353e-04, 4.5882353e-04, 4.5882353e-04, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 4.5882353e-04, 4.5882353e-04, 4.5882353e-04]]])
array([[1.6246019e-01, 5.1678896e-02, 3.7605400e-03, 1.1814244e+02, 1.6246019e-01, 8.2855959e-03, 6.9086452e-04, 0.0000000e+00, 3.8894632e-01, 2.0295161e+00, 5.0170198e+00, 5.1678896e-02, 8.2855959e-03, 5.1593572e+01, 1.3694608e-01, 7.3453430e-04, 3.7605400e-03, 6.9086452e-04, 1.8692301e+01, 1.1078949e-05]])
array([[0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.], [0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.], [0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.], [0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.], [0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.], [0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.], [0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.], [0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.], [0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.], [0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]])
array([[ 5.40299999e-06, -7.50000004e-07, 0.00000000e+00, 0.00000000e+00, 2.79999998e-07, 4.20000001e-06, 9.99999996e-07, -1.30000001e-06, -2.79999999e-06, 7.20000003e-06, 8.29999999e-06, -1.19000000e-05, -1.09999999e-06, -2.80000002e-06, -1.10000002e-06, 1.05000001e-05, 5.99000006e-06, -9.19999989e-07, -3.59700003e-06, -7.39999998e-06, -5.96999983e-07, 9.40000008e-07, 0.00000000e+00, -5.29999992e-07, 3.25500001e-06, 0.00000000e+00, 2.70000009e-07, 0.00000000e+00, -7.00000006e-08, 0.00000000e+00, 0.00000000e+00, -4.43000000e-06, 0.00000000e+00, 2.11000003e-06, -2.59699998e-06, 2.40300001e-06, -8.60000013e-07, -5.23999999e-06, -2.59699998e-06, 5.40299994e-06, -7.10000000e-06, 2.50300003e-06, 1.40299998e-06, 1.84999999e-06, 1.40299998e-06, 4.45000000e-06, 0.00000000e+00, -1.50000000e-07], [ 0.00000000e+00, -1.00000079e-08, -3.90000011e-07, -2.39999991e-07, 2.61000001e-06, 8.47999999e-06, 4.70000003e-07, 8.10000046e-07, 4.35000001e-06, 4.92000001e-06, -5.02999998e-06, 5.51000002e-06, ... 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00], [ 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 9.99999994e-09, 0.00000000e+00, 0.00000000e+00]])
array([[-4.55564001e-01, -4.05798008e-01, -3.93291395e-01, -3.93992241e-01, -4.40085390e-01, -5.67820520e-01, -7.32534533e-01, -7.13803086e-01, -6.89991654e-01, -7.07650084e-01, -7.23601032e-01, -7.04059494e-01, -6.77476247e-01, -6.62892364e-01, -6.83060115e-01, -7.80370371e-01, -9.40634343e-01, -9.78388210e-01, -1.02206286e+00, -1.16951880e+00, -1.30793776e+00, -1.09933437e+00, -8.26212381e-01, -5.59498838e-01, -4.55564001e-01, -4.05798008e-01, -3.93291395e-01, -3.93992241e-01, -4.40085390e-01, -5.67820520e-01, -7.32534533e-01, -7.13803086e-01, -6.89991654e-01, -7.07650084e-01, -7.23601032e-01, -7.04059494e-01, -6.77476247e-01, -6.62892364e-01, -6.83060115e-01, -7.80370371e-01, -9.40634343e-01, -9.78388210e-01, -1.02206286e+00, -1.16951880e+00, -1.30793776e+00, -1.09933437e+00, -8.26212381e-01, -5.59498838e-01], [-2.15376486e-01, -2.00837540e-01, -2.07305695e-01, -3.18949064e-01, -6.50733617e-01, -1.03938435e+00, -1.18156736e+00, -1.28540329e+00, -1.20911744e+00, -1.21991243e+00, -7.36295125e-01, -5.72356325e-01, ... -1.87629121e+01, -1.87629121e+01, -1.87629121e+01, -1.89544182e+01, -1.91459244e+01, -1.87629121e+01, -1.87629121e+01, -1.87629121e+01, -1.87629121e+01, -1.87629121e+01, -1.87629121e+01, -1.87629121e+01], [-1.56000000e-02, -8.60322027e-01, -1.56000000e-02, -1.56000000e-02, -8.60406948e-01, -7.26332670e+00, -9.39822908e+00, -5.79284175e+00, -3.32258511e+00, -1.92726389e+00, -1.62161880e+00, -1.37951739e+00, -1.17358434e+00, -1.40568903e+00, -1.17113535e+00, -1.25635276e+00, -7.78178300e-01, -8.60429186e-01, -1.56000000e-02, -8.60416964e-01, -1.56000000e-02, -8.60321406e-01, -1.56000000e-02, -8.34671551e-01, -4.12287220e-02, -1.56000000e-02, -8.60291287e-01, -1.56000000e-02, -8.60386481e-01, -1.56000000e-02, -1.56000000e-02, -8.60290111e-01, -1.56000000e-02, -8.60293236e-01, -1.56000000e-02, -1.56000000e-02, -8.60402016e-01, -8.60351757e-01, -1.56000000e-02, -1.56000000e-02, -8.60335361e-01, -1.56000000e-02, -1.56000000e-02, -8.60291122e-01, -1.56000000e-02, -8.60300165e-01, -1.56000000e-02, -8.60289856e-01]])
array([[1.62460195e-01, 5.16788943e-02, 3.76054000e-03, 1.18142445e+02, 1.62460195e-01, 8.28559583e-03, 6.90864524e-04, 0.00000000e+00, 3.88946314e-01, 2.02951604e+00, 5.01701975e+00, 5.16788943e-02, 8.28559583e-03, 5.15935718e+01, 1.36946085e-01, 7.34534303e-04, 3.76054000e-03, 6.90864524e-04, 1.86923007e+01, 1.10789487e-05]])
array([[[ 4.64306800e-01, 3.92331484e-01, 3.94384032e-01, 3.94386836e-01, 4.16023240e-01, 7.22305600e-01, 8.85110240e-01, 1.04378680e+00, 1.04378680e+00, 1.04378680e+00, 8.78605120e-01, 8.75111120e-01, 8.38775040e-01, 7.40731240e-01, 7.88165360e-01, 9.15373520e-01, 7.84795800e-01, 1.04378680e+00, 1.04378680e+00, 1.04378680e+00, 1.04378680e+00, 9.19550080e-01, 6.31857840e-01, 4.65511000e-01, 4.97109680e-01, 4.28813880e-01, 4.22456120e-01, 4.31920520e-01, 4.49351760e-01, 6.72072080e-01, 8.57297000e-01, 9.95061000e-01, 9.56515320e-01, 9.16760560e-01, 8.61332640e-01, 7.02883120e-01, 6.39272360e-01, 6.37054520e-01, 7.36004200e-01, 8.70635040e-01, 7.76365120e-01, 1.04378680e+00, 1.04378680e+00, 1.04378680e+00, 1.04378680e+00, 8.82127400e-01, 6.32089160e-01, 5.02256240e-01], [ 7.16522850e+00, 6.05449825e+00, 6.08617325e+00, 6.08621650e+00, 6.42011150e+00, 1.11466910e+01, 1.36591085e+01, 1.61078207e+01, 1.61078207e+01, 1.61078207e+01, 1.35587210e+01, 1.35048010e+01, ... 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00], [ 0.00000000e+00, 4.58823525e-04, 4.58823525e-04, 4.58823525e-04, 4.58823525e-04, 4.58823525e-04, 4.58823525e-04, 4.58823525e-04, 4.58823525e-04, 4.58823525e-04, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 4.58823525e-04, 4.58823525e-04, 4.58823525e-04, 0.00000000e+00, 4.58823525e-04, 4.58823525e-04, 4.58823525e-04, 4.58823525e-04, 4.58823525e-04, 4.58823525e-04, 4.58823525e-04, 4.58823525e-04, 4.58823525e-04, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 4.58823525e-04, 4.58823525e-04, 4.58823525e-04]]])
array([[ 0.30678672, 0. , 0. , ..., 0.40986444, -0. , 0. ], [ 0.12129486, 0. , 0. , ..., 0.40986444, -0. , 1. ], [ 0.12192104, 0. , 0. , ..., 0.40986444, -0. , 1. ], ..., [ 0.27261045, 0. , 0. , ..., 0.40986444, -0. , 1. ], [ 0.19529969, 0. , 0. , ..., 0.40986444, -0. , 1. ], [ 0.15525652, 0. , 0. , ..., 0.40986444, -0. , 1. ]])
array([[0. , 0.73562989, nan, nan, nan, 0. , 0. , 0. , 0. , nan, 0.59660361, 0. , 0.02432095, 0.20185729, 0. , 0.07873735], [0. , 0. , nan, nan, nan, 0. , 0. , 0. , 0. , nan, 0. , 0. , 0. , 0. , 0.58409777, 0. ], [0.15375983, 0.58850391, nan, nan, nan, 0.24806143, 0.35278664, 0.01369202, 0.01930144, nan, 0. , 0. , 0. , 0. , 0. , 0. ]])
array([[[ inf, 1.68219339e-02, nan, nan, nan, inf, inf, inf, inf, nan, 9.78666175e-07, inf, 1.29274001e-05, 4.48962739e-02, inf, 1.15972428e-01]], [[ inf, inf, nan, nan, nan, inf, inf, inf, inf, nan, inf, inf, inf, inf, 2.50215310e-02, inf]], [[8.23133186e-03, 2.10274174e-02, nan, nan, nan, 2.29130409e-05, 1.60417599e-05, 4.13329737e-04, 3.90942807e-04, nan, inf, inf, inf, inf, inf, inf]]])
array([[0.08069267], [0.0344869 ], [0.09578106]])
# As with inputs, the results dataset is a filtered view of m._model_data.
# All variables in `m.results` have the attribute `is_result` = 1
m._model_data.energy_cap
<xarray.DataArray 'energy_cap' (loc_techs: 26)> array([2.6934435e+02, 4.5778336e+01, 2.2685938e+02, 1.7197109e+00, 1.5600000e-02, 9.3982291e+00, 1.8352941e-02, 5.9805562e+02, 1.0382599e+01, 3.6513767e+02, 6.4927357e+01, 3.3620147e+01, 5.0000000e+01, 1.9024262e+02, 2.6094670e+02, 4.5778336e+01, 5.9805562e+02, 0.0000000e+00, 2.7451170e+02, 2.7451170e+02, 6.4431283e+02, 1.3079378e+00, 1.9024262e+02, 1.0382599e+01, 6.3309509e+01, 1.9283047e+02]) Coordinates: * loc_techs (loc_techs) object 'X2::demand_electricity' ... 'X2::boiler' Attributes: is_result: 1
array([2.6934435e+02, 4.5778336e+01, 2.2685938e+02, 1.7197109e+00, 1.5600000e-02, 9.3982291e+00, 1.8352941e-02, 5.9805562e+02, 1.0382599e+01, 3.6513767e+02, 6.4927357e+01, 3.3620147e+01, 5.0000000e+01, 1.9024262e+02, 2.6094670e+02, 4.5778336e+01, 5.9805562e+02, 0.0000000e+00, 2.7451170e+02, 2.7451170e+02, 6.4431283e+02, 1.3079378e+00, 1.9024262e+02, 1.0382599e+01, 6.3309509e+01, 1.9283047e+02])
array(['X2::demand_electricity', 'X3::power_lines:X1', 'X2::supply_gas', 'X1::demand_heat', 'X3::boiler', 'X3::demand_heat', 'X3::supply_gas', 'X1::heat_pipes:N1', 'N1::heat_pipes:X3', 'X2::demand_heat', 'X3::demand_electricity', 'X1::supply_grid_power', 'X3::pv', 'N1::heat_pipes:X2', 'X1::chp', 'X1::power_lines:X3', 'N1::heat_pipes:X1', 'X1::pv', 'X2::power_lines:X1', 'X1::power_lines:X2', 'X1::supply_gas', 'X1::demand_electricity', 'X2::heat_pipes:N1', 'X3::heat_pipes:N1', 'X2::pv', 'X2::boiler'], dtype=object)
# Data can also be reformatted to be easier to read (removes dimension concatenation).
# Conversion to a pandas DataFrame is a good idea for greater readibility.
m.get_formatted_array('energy_cap').to_pandas()
techs | boiler | chp | demand_electricity | demand_heat | heat_pipes:N1 | heat_pipes:X1 | heat_pipes:X2 | heat_pipes:X3 | power_lines:X1 | power_lines:X2 | power_lines:X3 | pv | supply_gas | supply_grid_power |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
locs | ||||||||||||||
N1 | NaN | NaN | NaN | NaN | NaN | 598.05562 | 190.24262 | 10.382599 | NaN | NaN | NaN | NaN | NaN | NaN |
X1 | NaN | 260.9467 | 1.307938 | 1.719711 | 598.055620 | NaN | NaN | NaN | NaN | 274.5117 | 45.778336 | 0.000000 | 644.312830 | 33.620147 |
X2 | 192.83047 | NaN | 269.344350 | 365.137670 | 190.242620 | NaN | NaN | NaN | 274.511700 | NaN | NaN | 63.309509 | 226.859380 | NaN |
X3 | 0.01560 | NaN | 64.927357 | 9.398229 | 10.382599 | NaN | NaN | NaN | 45.778336 | NaN | NaN | 50.000000 | 0.018353 | NaN |
# >2 dimensions cannot be easily viewed in a pandas dataframe, unless a MultiIndex is used.
# To view a 4-dimensional result, we can use `to_series()`
m.get_formatted_array('carrier_prod').to_series().dropna() # drop_na() removes all NaN values
carriers locs techs timesteps electricity X1 chp 2005-07-01 00:00:00 116.076700 2005-07-01 01:00:00 98.082871 2005-07-01 02:00:00 98.596008 2005-07-01 03:00:00 98.596709 2005-07-01 04:00:00 104.005810 ... heat X3 heat_pipes:N1 2005-07-02 19:00:00 0.860291 2005-07-02 20:00:00 0.015600 2005-07-02 21:00:00 0.844700 2005-07-02 22:00:00 0.000000 2005-07-02 23:00:00 0.844690 Name: carrier_prod, Length: 1008, dtype: float64
m._backend_model is a Pyomo data structure, attached to which are Pyomo objects including Sets, Parameters, Constraints, and Variables
# A set
m._backend_model.loc_techs_energy_capacity_constraint.pprint()
loc_techs_energy_capacity_constraint : Size=1, Index=None, Ordered=Insertion Key : Dimen : Domain : Size : Members None : 1 : Any : 26 : {'X2::demand_electricity', 'X3::power_lines:X1', 'X2::supply_gas', 'X1::demand_heat', 'X3::boiler', 'X3::demand_heat', 'X3::supply_gas', 'X1::heat_pipes:N1', 'N1::heat_pipes:X3', 'X2::demand_heat', 'X3::demand_electricity', 'X1::supply_grid_power', 'X3::pv', 'N1::heat_pipes:X2', 'X1::chp', 'X1::power_lines:X3', 'N1::heat_pipes:X1', 'X1::pv', 'X2::power_lines:X1', 'X1::power_lines:X2', 'X1::supply_gas', 'X1::demand_electricity', 'X2::heat_pipes:N1', 'X3::heat_pipes:N1', 'X2::pv', 'X2::boiler'}
# A Parameter
m._backend_model.energy_cap_max.pprint()
energy_cap_max : Size=26, Index=loc_techs, Domain=NonNegativeReals, Default=inf, Mutable=True Key : Value N1::heat_pipes:X1 : 2000.0 N1::heat_pipes:X2 : 2000.0 N1::heat_pipes:X3 : 2000.0 X1::chp : 1500.0 X1::demand_electricity : inf X1::demand_heat : inf X1::heat_pipes:N1 : 2000.0 X1::power_lines:X2 : 2000.0 X1::power_lines:X3 : 2000.0 X1::pv : 250.0 X1::supply_gas : 2000.0 X1::supply_grid_power : 2000.0 X2::boiler : 600.0 X2::demand_electricity : inf X2::demand_heat : inf X2::heat_pipes:N1 : 2000.0 X2::power_lines:X1 : 2000.0 X2::pv : 250.0 X2::supply_gas : 2000.0 X3::boiler : 600.0 X3::demand_electricity : inf X3::demand_heat : inf X3::heat_pipes:N1 : 2000.0 X3::power_lines:X1 : 2000.0 X3::pv : 50.0 X3::supply_gas : 2000.0
# A constraint
m._backend_model.energy_capacity_constraint.pprint()
energy_capacity_constraint : Size=20, Index=loc_techs_energy_capacity_constraint, Active=True Key : Lower : Body : Upper : Active N1::heat_pipes:X1 : 0.0 : energy_cap['N1::heat_pipes:X1'] : energy_cap_max['N1::heat_pipes:X1'] : True N1::heat_pipes:X2 : 0.0 : energy_cap['N1::heat_pipes:X2'] : energy_cap_max['N1::heat_pipes:X2'] : True N1::heat_pipes:X3 : 0.0 : energy_cap['N1::heat_pipes:X3'] : energy_cap_max['N1::heat_pipes:X3'] : True X1::chp : 0.0 : energy_cap['X1::chp'] : energy_cap_max['X1::chp'] : True X1::heat_pipes:N1 : 0.0 : energy_cap['X1::heat_pipes:N1'] : energy_cap_max['X1::heat_pipes:N1'] : True X1::power_lines:X2 : 0.0 : energy_cap['X1::power_lines:X2'] : energy_cap_max['X1::power_lines:X2'] : True X1::power_lines:X3 : 0.0 : energy_cap['X1::power_lines:X3'] : energy_cap_max['X1::power_lines:X3'] : True X1::pv : 0.0 : energy_cap['X1::pv'] : energy_cap_max['X1::pv'] : True X1::supply_gas : 0.0 : energy_cap['X1::supply_gas'] : energy_cap_max['X1::supply_gas'] : True X1::supply_grid_power : 0.0 : energy_cap['X1::supply_grid_power'] : energy_cap_max['X1::supply_grid_power'] : True X2::boiler : 0.0 : energy_cap['X2::boiler'] : energy_cap_max['X2::boiler'] : True X2::heat_pipes:N1 : 0.0 : energy_cap['X2::heat_pipes:N1'] : energy_cap_max['X2::heat_pipes:N1'] : True X2::power_lines:X1 : 0.0 : energy_cap['X2::power_lines:X1'] : energy_cap_max['X2::power_lines:X1'] : True X2::pv : 0.0 : energy_cap['X2::pv'] : energy_cap_max['X2::pv'] : True X2::supply_gas : 0.0 : energy_cap['X2::supply_gas'] : energy_cap_max['X2::supply_gas'] : True X3::boiler : 0.0 : energy_cap['X3::boiler'] : energy_cap_max['X3::boiler'] : True X3::heat_pipes:N1 : 0.0 : energy_cap['X3::heat_pipes:N1'] : energy_cap_max['X3::heat_pipes:N1'] : True X3::power_lines:X1 : 0.0 : energy_cap['X3::power_lines:X1'] : energy_cap_max['X3::power_lines:X1'] : True X3::pv : 0.0 : energy_cap['X3::pv'] : energy_cap_max['X3::pv'] : True X3::supply_gas : 0.0 : energy_cap['X3::supply_gas'] : energy_cap_max['X3::supply_gas'] : True
# A variable
m._backend_model.energy_cap.pprint()
energy_cap : Size=26, Index=loc_techs Key : Lower : Value : Upper : Fixed : Stale : Domain N1::heat_pipes:X1 : 0 : 598.05562 : None : False : False : NonNegativeReals N1::heat_pipes:X2 : 0 : 190.24262 : None : False : False : NonNegativeReals N1::heat_pipes:X3 : 0 : 10.382599 : None : False : False : NonNegativeReals X1::chp : 0 : 260.9467 : None : False : False : NonNegativeReals X1::demand_electricity : 0 : 1.3079378 : None : False : False : NonNegativeReals X1::demand_heat : 0 : 1.7197109 : None : False : False : NonNegativeReals X1::heat_pipes:N1 : 0 : 598.05562 : None : False : False : NonNegativeReals X1::power_lines:X2 : 0 : 274.5117 : None : False : False : NonNegativeReals X1::power_lines:X3 : 0 : 45.778336 : None : False : False : NonNegativeReals X1::pv : 0 : 0.0 : None : False : False : NonNegativeReals X1::supply_gas : 0 : 644.31283 : None : False : False : NonNegativeReals X1::supply_grid_power : 0 : 33.620147 : None : False : False : NonNegativeReals X2::boiler : 0 : 192.83047 : None : False : False : NonNegativeReals X2::demand_electricity : 0 : 269.34435 : None : False : False : NonNegativeReals X2::demand_heat : 0 : 365.13767 : None : False : False : NonNegativeReals X2::heat_pipes:N1 : 0 : 190.24262 : None : False : False : NonNegativeReals X2::power_lines:X1 : 0 : 274.5117 : None : False : False : NonNegativeReals X2::pv : 0 : 63.309509 : None : False : False : NonNegativeReals X2::supply_gas : 0 : 226.85938 : None : False : False : NonNegativeReals X3::boiler : 0 : 0.0156 : None : False : False : NonNegativeReals X3::demand_electricity : 0 : 64.927357 : None : False : False : NonNegativeReals X3::demand_heat : 0 : 9.3982291 : None : False : False : NonNegativeReals X3::heat_pipes:N1 : 0 : 10.382599 : None : False : False : NonNegativeReals X3::power_lines:X1 : 0 : 45.778336 : None : False : False : NonNegativeReals X3::pv : 0 : 50.0 : None : False : False : NonNegativeReals X3::supply_gas : 0 : 0.018352941 : None : False : False : NonNegativeReals
There are a few interface methods available to the standard user, i.e. avoiding m._backend_model
# The inputs as used by Pyomo can be printed. This includes filled default data where necessary
pd.concat(
(m.backend.access_model_inputs()['energy_cap_max'].to_pandas().rename('backend'), # get the data from Pyomo
m.inputs['energy_cap_max'].to_pandas().rename('pre-run')), # get the data from model_data (via inputs)
axis=1, sort=True
)
backend | pre-run | |
---|---|---|
loc_techs | ||
N1::heat_pipes:X1 | 2000.0 | 2000.0 |
N1::heat_pipes:X2 | 2000.0 | 2000.0 |
N1::heat_pipes:X3 | 2000.0 | 2000.0 |
X1::chp | 1500.0 | 1500.0 |
X1::demand_electricity | inf | NaN |
X1::demand_heat | inf | NaN |
X1::heat_pipes:N1 | 2000.0 | 2000.0 |
X1::power_lines:X2 | 2000.0 | 2000.0 |
X1::power_lines:X3 | 2000.0 | 2000.0 |
X1::pv | 250.0 | 250.0 |
X1::supply_gas | 2000.0 | 2000.0 |
X1::supply_grid_power | 2000.0 | 2000.0 |
X2::boiler | 600.0 | 600.0 |
X2::demand_electricity | inf | NaN |
X2::demand_heat | inf | NaN |
X2::heat_pipes:N1 | 2000.0 | 2000.0 |
X2::power_lines:X1 | 2000.0 | 2000.0 |
X2::pv | 250.0 | 250.0 |
X2::supply_gas | 2000.0 | 2000.0 |
X3::boiler | 600.0 | 600.0 |
X3::demand_electricity | inf | NaN |
X3::demand_heat | inf | NaN |
X3::heat_pipes:N1 | 2000.0 | 2000.0 |
X3::power_lines:X1 | 2000.0 | 2000.0 |
X3::pv | 50.0 | 50.0 |
X3::supply_gas | 2000.0 | 2000.0 |
# We can activate and deactivate constraints, such as switching off the energy capacity constraint
m.backend.activate_constraint('energy_capacity_constraint', False) # set to True to activate
m._backend_model.energy_capacity_constraint.pprint()
energy_capacity_constraint : Size=20, Index=loc_techs_energy_capacity_constraint, Active=False Key : Lower : Body : Upper : Active N1::heat_pipes:X1 : 0.0 : energy_cap['N1::heat_pipes:X1'] : energy_cap_max['N1::heat_pipes:X1'] : False N1::heat_pipes:X2 : 0.0 : energy_cap['N1::heat_pipes:X2'] : energy_cap_max['N1::heat_pipes:X2'] : False N1::heat_pipes:X3 : 0.0 : energy_cap['N1::heat_pipes:X3'] : energy_cap_max['N1::heat_pipes:X3'] : False X1::chp : 0.0 : energy_cap['X1::chp'] : energy_cap_max['X1::chp'] : False X1::heat_pipes:N1 : 0.0 : energy_cap['X1::heat_pipes:N1'] : energy_cap_max['X1::heat_pipes:N1'] : False X1::power_lines:X2 : 0.0 : energy_cap['X1::power_lines:X2'] : energy_cap_max['X1::power_lines:X2'] : False X1::power_lines:X3 : 0.0 : energy_cap['X1::power_lines:X3'] : energy_cap_max['X1::power_lines:X3'] : False X1::pv : 0.0 : energy_cap['X1::pv'] : energy_cap_max['X1::pv'] : False X1::supply_gas : 0.0 : energy_cap['X1::supply_gas'] : energy_cap_max['X1::supply_gas'] : False X1::supply_grid_power : 0.0 : energy_cap['X1::supply_grid_power'] : energy_cap_max['X1::supply_grid_power'] : False X2::boiler : 0.0 : energy_cap['X2::boiler'] : energy_cap_max['X2::boiler'] : False X2::heat_pipes:N1 : 0.0 : energy_cap['X2::heat_pipes:N1'] : energy_cap_max['X2::heat_pipes:N1'] : False X2::power_lines:X1 : 0.0 : energy_cap['X2::power_lines:X1'] : energy_cap_max['X2::power_lines:X1'] : False X2::pv : 0.0 : energy_cap['X2::pv'] : energy_cap_max['X2::pv'] : False X2::supply_gas : 0.0 : energy_cap['X2::supply_gas'] : energy_cap_max['X2::supply_gas'] : False X3::boiler : 0.0 : energy_cap['X3::boiler'] : energy_cap_max['X3::boiler'] : False X3::heat_pipes:N1 : 0.0 : energy_cap['X3::heat_pipes:N1'] : energy_cap_max['X3::heat_pipes:N1'] : False X3::power_lines:X1 : 0.0 : energy_cap['X3::power_lines:X1'] : energy_cap_max['X3::power_lines:X1'] : False X3::pv : 0.0 : energy_cap['X3::pv'] : energy_cap_max['X3::pv'] : False X3::supply_gas : 0.0 : energy_cap['X3::supply_gas'] : energy_cap_max['X3::supply_gas'] : False
# Rerun the model with this constraint switched off.
# This will dump results to a new dataset, *NOT* to m._model_data (or m.results)
new_model = m.backend.rerun()
[2021-07-29 16:02:07] INFO model_creation [2021-07-29 16:02:07] INFO Backend: starting model run [2021-07-29 16:02:07] INFO Backend: sending model to solver [2021-07-29 16:02:07] INFO Backend: solver finished running. Time since start of model run: 0:00:00.369686 [2021-07-29 16:02:07] INFO Backend: loaded results [2021-07-29 16:02:07] INFO Backend: generated solution array. Time since start of model run: 0:00:00.459862 [2021-07-29 16:02:07] INFO Postprocessing: started [2021-07-29 16:02:07] INFO Postprocessing: All values < 1e-10 set to 0 in system_balance [2021-07-29 16:02:07] INFO Postprocessing: ended. Time since start of model run: 0:00:00.566121 [2021-07-29 16:02:07] WARNING /Users/brynmorp/Repos/calliope-project/calliope/calliope/exceptions.py:60: ModelWarning: The results of rerunning the backend model are only available within the Calliope model returned by this function call. [2021-07-29 16:02:07] INFO Model: initialising [2021-07-29 16:02:07] INFO Model: loaded model_data
# The results are now updated, which we can compare to our old results
pd.concat((new_model.results.energy_cap.to_pandas().rename('new'), m.results.energy_cap.to_pandas().rename('old')),
axis=1, sort=True)
new | old | |
---|---|---|
loc_techs | ||
N1::heat_pipes:X1 | 577.990760 | 598.055620 |
N1::heat_pipes:X2 | 184.854000 | 190.242620 |
N1::heat_pipes:X3 | 10.382599 | 10.382599 |
X1::chp | 253.679380 | 260.946700 |
X1::demand_electricity | 1.307938 | 1.307938 |
X1::demand_heat | 1.719711 | 1.719711 |
X1::heat_pipes:N1 | 577.990760 | 598.055620 |
X1::power_lines:X2 | 274.841170 | 274.511700 |
X1::power_lines:X3 | 66.370659 | 45.778336 |
X1::pv | 0.000000 | 0.000000 |
X1::supply_gas | 626.368830 | 644.312830 |
X1::supply_grid_power | 40.808044 | 33.620147 |
X2::boiler | 197.824970 | 192.830470 |
X2::demand_electricity | 269.344350 | 269.344350 |
X2::demand_heat | 365.137670 | 365.137670 |
X2::heat_pipes:N1 | 184.854000 | 190.242620 |
X2::power_lines:X1 | 274.841170 | 274.511700 |
X2::pv | 0.000000 | 63.309509 |
X2::supply_gas | 232.735260 | 226.859380 |
X3::boiler | 0.015600 | 0.015600 |
X3::demand_electricity | 64.927357 | 64.927357 |
X3::demand_heat | 9.398229 | 9.398229 |
X3::heat_pipes:N1 | 10.382599 | 10.382599 |
X3::power_lines:X1 | 66.370659 | 45.778336 |
X3::pv | 128.571430 | 50.000000 |
X3::supply_gas | 0.018353 | 0.018353 |
# We can also see that the Pyomo backend_model has updated to the new values
m._backend_model.energy_cap.pprint()
energy_cap : Size=26, Index=loc_techs Key : Lower : Value : Upper : Fixed : Stale : Domain N1::heat_pipes:X1 : 0 : 577.99076 : None : False : False : NonNegativeReals N1::heat_pipes:X2 : 0 : 184.854 : None : False : False : NonNegativeReals N1::heat_pipes:X3 : 0 : 10.382599 : None : False : False : NonNegativeReals X1::chp : 0 : 253.67938 : None : False : False : NonNegativeReals X1::demand_electricity : 0 : 1.3079378 : None : False : False : NonNegativeReals X1::demand_heat : 0 : 1.7197109 : None : False : False : NonNegativeReals X1::heat_pipes:N1 : 0 : 577.99076 : None : False : False : NonNegativeReals X1::power_lines:X2 : 0 : 274.84117 : None : False : False : NonNegativeReals X1::power_lines:X3 : 0 : 66.370659 : None : False : False : NonNegativeReals X1::pv : 0 : 0.0 : None : False : False : NonNegativeReals X1::supply_gas : 0 : 626.36883 : None : False : False : NonNegativeReals X1::supply_grid_power : 0 : 40.808044 : None : False : False : NonNegativeReals X2::boiler : 0 : 197.82497 : None : False : False : NonNegativeReals X2::demand_electricity : 0 : 269.34435 : None : False : False : NonNegativeReals X2::demand_heat : 0 : 365.13767 : None : False : False : NonNegativeReals X2::heat_pipes:N1 : 0 : 184.854 : None : False : False : NonNegativeReals X2::power_lines:X1 : 0 : 274.84117 : None : False : False : NonNegativeReals X2::pv : 0 : 0.0 : None : False : False : NonNegativeReals X2::supply_gas : 0 : 232.73526 : None : False : False : NonNegativeReals X3::boiler : 0 : 0.0156 : None : False : False : NonNegativeReals X3::demand_electricity : 0 : 64.927357 : None : False : False : NonNegativeReals X3::demand_heat : 0 : 9.3982291 : None : False : False : NonNegativeReals X3::heat_pipes:N1 : 0 : 10.382599 : None : False : False : NonNegativeReals X3::power_lines:X1 : 0 : 66.370659 : None : False : False : NonNegativeReals X3::pv : 0 : 128.57143 : None : False : False : NonNegativeReals X3::supply_gas : 0 : 0.018352941 : None : False : False : NonNegativeReals
# With the original data (i.e. capacity constraint is active), we can plot the capacities
m.plot.capacity()
[2021-07-29 16:02:13] WARNING /Users/brynmorp/Repos/calliope-project/calliope/calliope/postprocess/plotting/plotting.py:105: FutureWarning: Plotting will no longer be available as a method of the Calliope model object infuture versions of Calliope. In the meantime, as of v0.6.6, plotting is untested; this functionality should now be used with caution. We expect to reintroduce it as a seperate module in v0.7.0.