import calliope
# We increase logging verbosity
calliope.set_log_verbosity('INFO', include_solver_output=False)
model = calliope.examples.urban_scale()
[2022-02-07 16:53:31] INFO Model: initialising [2022-02-07 16:53:31] INFO Model: preprocessing stage 1 (model_run) [2022-02-07 16:53:32] INFO Model: preprocessing stage 2 (model_data) [2022-02-07 16:53:32] INFO Model: preprocessing complete
# Model inputs can be viewed at `model.inputs`.
# Variables are indexed over any combination of `techs`, `locs`, `carriers`, `costs` and `timesteps`,
# although `techs`, `locs`, and `carriers` are often concatenated.
# e.g. `chp`, `X1`, `heat` -> `X1::chp::heat`
model.inputs
<xarray.Dataset> Dimensions: (loc_techs_supply_plus: 3, loc_techs: 26, loc_techs_finite_resource: 9, timesteps: 48, loc_techs_area: 3, loc_techs_export: 4, costs: 1, loc_techs_investment_cost: 20, loc_techs_om_cost: 9, loc_techs_transmission: 10, locs: 4, coordinates: 2, techs: 9, carrier_tiers: 3, loc_tech_carriers_conversion_plus: 3, loc_carriers: 10, loc_techs_non_conversion: 23, loc_techs_conversion: 2, loc_techs_conversion_plus: 1, carriers: 3) Coordinates: (12/20) * carrier_tiers (carrier_tiers) <U5 'in' 'out_2' 'out' * carriers (carriers) <U11 'electricity' ... '... * coordinates (coordinates) object 'x' 'y' * costs (costs) object 'monetary' * loc_carriers (loc_carriers) object 'X3::gas' ...... * loc_tech_carriers_conversion_plus (loc_tech_carriers_conversion_plus) object ... ... ... * loc_techs_om_cost (loc_techs_om_cost) object 'X1::sup... * loc_techs_supply_plus (loc_techs_supply_plus) object 'X1:... * loc_techs_transmission (loc_techs_transmission) object 'X1... * locs (locs) object 'X1' 'N1' 'X3' 'X2' * techs (techs) object 'demand_heat' ... 'h... * timesteps (timesteps) datetime64[ns] 2005-07-... Data variables: (12/38) parasitic_eff (loc_techs_supply_plus) float64 0.8... energy_cap_max (loc_techs) float64 250.0 ... 2e+03 resource_eff (loc_techs_finite_resource) float64 ... energy_con (loc_techs) float64 nan 1.0 ... nan force_resource (loc_techs_finite_resource) bool Tr... resource (loc_techs_finite_resource, timesteps) 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 'X1::pv' '' ... 'X2::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.8-dev applied_overrides: scenario: None defaults: available_area: null\ncarrier_ratios: null\ncharge_r... allow_operate_mode: 1
array(['in', 'out_2', 'out'], dtype='<U5')
array(['electricity', 'heat', 'gas'], dtype='<U11')
array(['x', 'y'], dtype=object)
array(['monetary'], dtype=object)
array(['X3::gas', 'X3::heat', 'X2::electricity', 'N1::heat', 'X2::heat', 'X1::heat', 'X1::electricity', 'X2::gas', 'X3::electricity', 'X1::gas'], dtype=object)
array(['X1::chp::electricity', 'X1::chp::gas', 'X1::chp::heat'], dtype=object)
array(['X1::pv', 'X1::power_lines:X3', 'X3::demand_electricity', 'N1::heat_pipes:X2', 'X2::pv', 'X1::chp', 'X2::heat_pipes:N1', 'X3::boiler', 'X3::pv', 'X2::power_lines:X1', 'X2::demand_heat', 'X1::supply_grid_power', 'X1::heat_pipes:N1', 'X2::boiler', 'X2::demand_electricity', 'X3::heat_pipes:N1', 'X3::demand_heat', 'X3::power_lines:X1', 'X1::demand_electricity', 'X1::power_lines:X2', 'X1::supply_gas', 'X2::supply_gas', 'X1::demand_heat', 'N1::heat_pipes:X3', 'N1::heat_pipes:X1', 'X3::supply_gas'], dtype=object)
array(['X1::pv', 'X3::pv', 'X2::pv'], dtype=object)
array(['X3::boiler', 'X2::boiler'], dtype='<U10')
array(['X1::chp'], dtype='<U7')
array(['X1::pv', 'X1::chp', 'X3::pv', 'X2::pv'], dtype=object)
array(['X2::demand_electricity', 'X3::demand_heat', 'X1::pv', 'X1::demand_electricity', 'X3::demand_electricity', 'X2::pv', 'X3::pv', 'X1::demand_heat', 'X2::demand_heat'], dtype=object)
array(['X1::pv', 'X1::power_lines:X3', 'N1::heat_pipes:X2', 'X2::pv', 'X1::chp', 'X2::heat_pipes:N1', 'X3::boiler', 'X3::pv', 'X2::power_lines:X1', 'X1::supply_grid_power', 'X1::heat_pipes:N1', 'X2::boiler', 'X3::heat_pipes:N1', 'X3::power_lines:X1', 'X1::power_lines:X2', 'X1::supply_gas', 'X2::supply_gas', 'N1::heat_pipes:X3', 'N1::heat_pipes:X1', 'X3::supply_gas'], dtype=object)
array(['X1::pv', 'X1::power_lines:X3', 'X3::demand_electricity', 'N1::heat_pipes:X2', 'X2::pv', 'X2::heat_pipes:N1', 'X3::pv', 'X2::power_lines:X1', 'X2::demand_heat', 'X1::supply_grid_power', 'X1::heat_pipes:N1', 'X2::demand_electricity', 'X3::heat_pipes:N1', 'X3::demand_heat', 'X3::power_lines:X1', 'X1::demand_electricity', 'X1::power_lines:X2', 'X1::supply_gas', 'X2::supply_gas', 'X1::demand_heat', 'N1::heat_pipes:X3', 'N1::heat_pipes:X1', 'X3::supply_gas'], dtype=object)
array(['X1::supply_grid_power', 'X2::boiler', 'X1::supply_gas', 'X2::pv', 'X2::supply_gas', 'X1::chp', 'X3::boiler', 'X3::pv', 'X3::supply_gas'], dtype=object)
array(['X1::pv', 'X3::pv', 'X2::pv'], dtype=object)
array(['X1::heat_pipes:N1', 'X3::heat_pipes:N1', 'X1::power_lines:X3', 'X1::power_lines:X2', 'N1::heat_pipes:X2', 'X2::heat_pipes:N1', 'N1::heat_pipes:X3', 'X2::power_lines:X1', 'N1::heat_pipes:X1', 'X3::power_lines:X1'], dtype=object)
array(['X1', 'N1', 'X3', 'X2'], dtype=object)
array(['demand_heat', 'boiler', 'power_lines', 'supply_grid_power', 'pv', 'chp', 'demand_electricity', 'supply_gas', 'heat_pipes'], 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([0.85, 0.85, 0.85])
array([ 250., 2000., nan, 2000., 250., 1500., 2000., 600., 50., 2000., nan, 2000., 2000., 600., nan, 2000., nan, 2000., nan, 2000., 2000., 2000., nan, 2000., 2000., 2000.])
array([nan, nan, 1., nan, nan, 1., 1., nan, nan])
array([nan, 1., 1., 1., nan, 1., 1., 1., nan, 1., 1., nan, 1., 1., 1., 1., 1., 1., 1., 1., nan, nan, 1., 1., 1., nan])
array([ True, True, True, True, True, True, True, True, True])
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], [-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, ... -5.28681742e-01, -4.87107778e-01, -4.91097294e-01, -5.40067692e-01, -6.41509806e-01, -7.41097764e-01, -7.61821662e-01, -7.07074543e-01, -6.34091830e-01, -5.23707169e-01, -4.00787037e-01, -2.72040308e-01], [-6.47319908e+01, -7.04534393e+01, -7.71929758e+01, -1.04556436e+02, -1.23228444e+02, -1.67668819e+02, -2.64887092e+02, -3.65137675e+02, -2.58172589e+02, -1.90585578e+02, -1.48187116e+02, -1.13121625e+02, -1.09166107e+02, -1.08999523e+02, -1.13778846e+02, -8.21624174e+01, -1.05634371e+02, -1.28475341e+02, -1.67408783e+02, -1.63406268e+02, -1.68509356e+02, -2.42732229e+02, -1.55373912e+02, -9.81262560e+01, -8.32699616e+01, -8.88243408e+01, -9.14132670e+01, -1.08043612e+02, -1.26498438e+02, -1.60887899e+02, -2.52423895e+02, -3.51663241e+02, -2.48154419e+02, -1.88012759e+02, -1.47321309e+02, -1.11706592e+02, -1.08499086e+02, -1.08153801e+02, -1.05261025e+02, -8.46144166e+01, -1.04549875e+02, -1.22646451e+02, -1.66442507e+02, -1.61099889e+02, -1.66931078e+02, -2.40034833e+02, -1.43576460e+02, -8.60820143e+01]])
array([7, 7, 7])
array(['energy', 'energy', 'energy_per_area', 'energy', 'energy', 'energy_per_area', 'energy_per_area', 'energy', 'energy'], dtype=object)
array([ nan, 0.98 , nan, 0.92685937, nan, 0.405 , 0.92685937, 0.85 , nan, 0.98 , nan, nan, 0.92685937, 0.85 , nan, 0.90368789, nan, 0.98 , nan, 0.98 , nan, nan, nan, 0.90368789, 0.92685937, nan])
array(['electricity', 'electricity', 'electricity', 'electricity'], dtype=object)
array([25., 25., nan, 25., 25., 25., 25., 25., 25., 25., nan, 25., 25., 25., nan, 25., nan, 25., nan, 25., 25., 25., nan, 25., 25., 25.])
array([1500, 1500, 1500])
array([ 1., 1., nan, 1., 1., 1., 1., 1., 1., 1., nan, 1., 1., 1., nan, 1., nan, 1., nan, 1., 1., 1., nan, 1., 1., 1.])
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], ... [ nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan], [ nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, 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([[0.1 , 0.004, 0.025, nan, 0.025, nan, 0.004, nan, 0.025]])
array([[ nan, nan, nan, -0.0203, nan, 0.004 , nan, nan, nan]])
array([[ nan, nan, nan, nan, nan, nan, nan, -80.5, nan]])
array([[1.35e+03, 5.00e-02, 9.00e-01, 1.35e+03, 7.50e+02, 9.00e-01, 7.80e+01, 1.35e+03, 1.00e-01, 1.00e+02, 9.00e-01, 4.31e+01, 1.20e+00, 5.00e-02, 1.00e-01, 1.00e+00, 1.00e+00, 1.20e+00, 9.00e-01, 1.00e+00]])
array([ 3., 4., 5., 10., 3., 3., 4., 10., 3., 5.])
array(['N1::heat_pipes:X1', 'N1::heat_pipes:X3', 'X3::power_lines:X1', 'X2::power_lines:X1', 'X2::heat_pipes:N1', 'N1::heat_pipes:X2', 'X3::heat_pipes:N1', 'X1::power_lines:X2', 'X1::heat_pipes:N1', 'X1::power_lines:X3'], dtype=object)
array([ 500., nan, 900., 1300.])
array([[2, 5, 5, 8], [7, 7, 3, 7]])
array(['#660507', '#8E2999', '#6783E3', '#C5ABE3', '#F9D956', '#E4AB97', '#072486', '#C98AAD', '#823739'], dtype=object)
array(['demand', 'conversion', 'transmission', 'supply', 'supply_power_plus.supply_plus', 'conversion_plus', 'demand', 'supply', 'transmission'], dtype=object)
array(['Heat demand', 'Natural gas boiler', 'Electrical power distribution', 'National grid import', 'Solar photovoltaic power', 'Combined heat and power', 'Electrical demand', 'Natural gas import', 'District heat distribution'], dtype=object)
array([[1. , 1. , 1. ], [1. , 1. , 0.8], [1. , 1. , 1. ]])
array(['X3::boiler::gas,X3::supply_gas::gas', 'X3::demand_heat::heat,X3::boiler::heat,X3::heat_pipes:N1::heat', 'X2::pv::electricity,X2::demand_electricity::electricity,X2::power_lines:X1::electricity', 'N1::heat_pipes:X3::heat,N1::heat_pipes:X2::heat,N1::heat_pipes:X1::heat', 'X2::heat_pipes:N1::heat,X2::demand_heat::heat,X2::boiler::heat', 'X1::demand_heat::heat,X1::heat_pipes:N1::heat,X1::chp::heat', 'X1::power_lines:X3::electricity,X1::chp::electricity,X1::demand_electricity::electricity,X1::pv::electricity,X1::supply_grid_power::electricity,X1::power_lines:X2::electricity', 'X2::boiler::gas,X2::supply_gas::gas', 'X3::pv::electricity,X3::power_lines:X1::electricity,X3::demand_electricity::electricity', 'X1::supply_gas::gas,X1::chp::gas'], dtype=object)
array(['X1::pv::electricity', 'X1::power_lines:X3::electricity', 'X3::demand_electricity::electricity', 'N1::heat_pipes:X2::heat', 'X2::pv::electricity', 'X2::heat_pipes:N1::heat', 'X3::pv::electricity', 'X2::power_lines:X1::electricity', 'X2::demand_heat::heat', 'X1::supply_grid_power::electricity', 'X1::heat_pipes:N1::heat', 'X2::demand_electricity::electricity', 'X3::heat_pipes:N1::heat', 'X3::demand_heat::heat', 'X3::power_lines:X1::electricity', 'X1::demand_electricity::electricity', 'X1::power_lines:X2::electricity', 'X1::supply_gas::gas', 'X2::supply_gas::gas', 'X1::demand_heat::heat', 'N1::heat_pipes:X3::heat', 'N1::heat_pipes:X1::heat', 'X3::supply_gas::gas'], dtype=object)
array([['X3::boiler::gas', 'X2::boiler::gas'], [None, None], ['X3::boiler::heat', 'X2::boiler::heat']], dtype=object)
array(['X1::chp::gas'], dtype=object)
array(['X1::chp::electricity'], dtype=object)
array([['X1::chp::gas'], ['X1::chp::heat'], ['X1::chp::electricity']], dtype=object)
array(['X1::pv::electricity', 'X1::chp::electricity', 'X3::pv::electricity', 'X2::pv::electricity'], dtype=object)
array(['X1::pv', '', 'X3::pv', 'X2::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-01T08:00:00.000000000', '2005-07-01T07:00:00.000000000', '2005-07-01T00:00:00.000000000'], dtype='datetime64[ns]')
# Individual data variables can be accessed easily, `to_pandas()` reformats the data to look nicer
model.inputs.resource.to_pandas()
timesteps | 2005-07-01 00:00:00 | 2005-07-01 01:00:00 | 2005-07-01 02:00:00 | 2005-07-01 03:00:00 | 2005-07-01 04:00:00 | 2005-07-01 05:00:00 | 2005-07-01 06:00:00 | 2005-07-01 07:00:00 | 2005-07-01 08:00:00 | 2005-07-01 09:00:00 | ... | 2005-07-02 14:00:00 | 2005-07-02 15:00:00 | 2005-07-02 16:00:00 | 2005-07-02 17:00:00 | 2005-07-02 18:00:00 | 2005-07-02 19:00:00 | 2005-07-02 20:00:00 | 2005-07-02 21:00:00 | 2005-07-02 22:00:00 | 2005-07-02 23:00:00 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
loc_techs_finite_resource | |||||||||||||||||||||
X2::demand_electricity | -94.545801 | -76.960619 | -77.475750 | -77.475750 | -82.731496 | -148.533479 | -189.570817 | -238.734711 | -244.284493 | -231.440181 | ... | -199.895515 | -221.324570 | -188.344877 | -249.962248 | -248.894106 | -269.344347 | -245.412357 | -196.280957 | -135.289242 | -103.741556 |
X3::demand_heat | -0.015600 | -0.860322 | -0.015600 | -0.015600 | -0.860407 | -7.263327 | -9.398229 | -5.792842 | -3.322585 | -1.927264 | ... | -0.015600 | -0.015600 | -0.860335 | -0.015600 | -0.015600 | -0.860291 | -0.015600 | -0.860300 | -0.015600 | -0.860290 |
X1::pv | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.007857 | 0.029143 | 0.055571 | 0.078429 | 0.096000 | ... | 0.057857 | 0.041143 | 0.027000 | 0.014714 | 0.006143 | 0.000857 | 0.000000 | 0.000000 | 0.000000 | 0.000000 |
X1::demand_electricity | -0.455564 | -0.405798 | -0.393291 | -0.393992 | -0.440085 | -0.567821 | -0.732535 | -0.713803 | -0.689992 | -0.707650 | ... | -0.683060 | -0.780370 | -0.940634 | -0.978388 | -1.022063 | -1.169519 | -1.307938 | -1.099334 | -0.826212 | -0.559499 |
X3::demand_electricity | -18.762912 | -18.762912 | -18.762912 | -18.762912 | -18.762912 | -30.212425 | -35.233307 | -61.395269 | -63.642962 | -62.679665 | ... | -18.762912 | -18.954418 | -19.145924 | -18.762912 | -18.762912 | -18.762912 | -18.762912 | -18.762912 | -18.762912 | -18.762912 |
X2::pv | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.007857 | 0.029143 | 0.055571 | 0.078429 | 0.096000 | ... | 0.057857 | 0.041143 | 0.027000 | 0.014714 | 0.006143 | 0.000857 | 0.000000 | 0.000000 | 0.000000 | 0.000000 |
X3::pv | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.007857 | 0.029143 | 0.055571 | 0.078429 | 0.096000 | ... | 0.057857 | 0.041143 | 0.027000 | 0.014714 | 0.006143 | 0.000857 | 0.000000 | 0.000000 | 0.000000 | 0.000000 |
X1::demand_heat | -0.215376 | -0.200838 | -0.207306 | -0.318949 | -0.650734 | -1.039384 | -1.181567 | -1.285403 | -1.209117 | -1.219912 | ... | -0.491097 | -0.540068 | -0.641510 | -0.741098 | -0.761822 | -0.707075 | -0.634092 | -0.523707 | -0.400787 | -0.272040 |
X2::demand_heat | -64.731991 | -70.453439 | -77.192976 | -104.556436 | -123.228444 | -167.668819 | -264.887092 | -365.137675 | -258.172589 | -190.585578 | ... | -105.261025 | -84.614417 | -104.549875 | -122.646451 | -166.442507 | -161.099889 | -166.931078 | -240.034833 | -143.576460 | -86.082014 |
9 rows × 48 columns
# To reformat the array, deconcatenating loc_techs / loc_tech_carriers, you can use model.get_formatted_array()
# You can then apply loc/tech/carrier only operations, like summing information over locations:
model.get_formatted_array('resource').sum('locs').to_pandas()
timesteps | 2005-07-01 00:00:00 | 2005-07-01 01:00:00 | 2005-07-01 02:00:00 | 2005-07-01 03:00:00 | 2005-07-01 04:00:00 | 2005-07-01 05:00:00 | 2005-07-01 06:00:00 | 2005-07-01 07:00:00 | 2005-07-01 08:00:00 | 2005-07-01 09:00:00 | ... | 2005-07-02 14:00:00 | 2005-07-02 15:00:00 | 2005-07-02 16:00:00 | 2005-07-02 17:00:00 | 2005-07-02 18:00:00 | 2005-07-02 19:00:00 | 2005-07-02 20:00:00 | 2005-07-02 21:00:00 | 2005-07-02 22:00:00 | 2005-07-02 23:00:00 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
techs | |||||||||||||||||||||
demand_electricity | -113.764277 | -96.129329 | -96.631954 | -96.632654 | -101.934493 | -179.313724 | -225.536658 | -300.843784 | -308.617446 | -294.827496 | ... | -219.341487 | -241.059359 | -208.431436 | -269.703548 | -268.679081 | -289.276777 | -265.483207 | -216.143204 | -154.878366 | -123.063967 |
demand_heat | -64.962967 | -71.514599 | -77.415882 | -104.890985 | -124.739585 | -175.971530 | -275.466888 | -372.215920 | -262.704292 | -193.732754 | ... | -105.767723 | -85.170084 | -106.051720 | -123.403148 | -167.219928 | -162.667255 | -167.580770 | -241.418840 | -143.992847 | -87.214344 |
pv | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.023571 | 0.087429 | 0.166714 | 0.235286 | 0.288000 | ... | 0.173571 | 0.123429 | 0.081000 | 0.044143 | 0.018429 | 0.002571 | 0.000000 | 0.000000 | 0.000000 | 0.000000 |
3 rows × 48 columns
# Solve the model. Results are loaded into `model.results`.
# By including logging (see package importing), we can see the timing of parts of the run, as well as the solver's log
model.run()
[2022-02-07 16:53:32] INFO Backend: starting model run [2022-02-07 16:53:33] INFO Loading sets [2022-02-07 16:53:33] INFO Loading parameters [2022-02-07 16:53:33] INFO constraints are loaded in the following order: ['capacity', 'dispatch', 'policy', 'energy_balance', 'costs', 'network', 'conversion', 'group', 'conversion_plus', 'export', 'milp'] [2022-02-07 16:53:33] INFO creating capacity constraints [2022-02-07 16:53:33] INFO creating dispatch constraints [2022-02-07 16:53:33] INFO creating policy constraints [2022-02-07 16:53:33] INFO creating energy_balance constraints [2022-02-07 16:53:33] INFO creating costs constraints [2022-02-07 16:53:33] INFO creating network constraints [2022-02-07 16:53:33] INFO creating conversion constraints [2022-02-07 16:53:33] INFO creating group constraints [2022-02-07 16:53:33] INFO creating conversion_plus constraints [2022-02-07 16:53:33] INFO creating export constraints [2022-02-07 16:53:33] INFO creating milp constraints [2022-02-07 16:53:33] INFO Backend: model generated. Time since start of model run: 0:00:00.506894 [2022-02-07 16:53:33] INFO Backend: sending model to solver [2022-02-07 16:53:33] INFO Backend: solver finished running. Time since start of model run: 0:00:00.897613 [2022-02-07 16:53:33] INFO Backend: loaded results [2022-02-07 16:53:33] INFO Backend: generated solution array. Time since start of model run: 0:00:00.997607 [2022-02-07 16:53:33] INFO Postprocessing: started [2022-02-07 16:53:34] INFO Postprocessing: All values < 1e-10 set to 0 in system_balance [2022-02-07 16:53:34] INFO Postprocessing: ended. Time since start of model run: 0:00:01.158167
# Model results are held in the same structure as model inputs.
# The results consist of the optimal values for all decision variables, including capacities and carrier flow
# There are also results, like system capacity factor and levelised costs, which are calculated in postprocessing
# before being added to the results Dataset
model.results
<xarray.Dataset> Dimensions: (loc_techs: 26, loc_tech_carriers_prod: 21, timesteps: 48, loc_tech_carriers_con: 19, costs: 1, loc_techs_cost: 20, loc_techs_area: 3, loc_techs_supply_plus: 3, loc_tech_carriers_export: 4, loc_techs_om_cost: 9, loc_techs_investment_cost: 20, loc_carriers: 10, loc_carriers_system_balance_constraint: 10, loc_techs_balance_demand_constraint: 6, loc_techs_cost_investment_constraint: 20, carriers: 3, techs: 16) Coordinates: (12/17) * 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 '... * loc_techs_balance_demand_constraint (loc_techs_balance_demand_constraint) object ... ... ... * techs (techs) object 'boiler' ... 'supp... * carriers (carriers) <U11 'electricity' ...... * costs (costs) object 'monetary' * loc_techs (loc_techs) object 'X1::pv' ... '... * loc_techs_area (loc_techs_area) object 'X1::pv' ... * timesteps (timesteps) datetime64[ns] 2005-0... Data variables: (12/19) energy_cap (loc_techs) float64 0.0 ... 0.01835 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: 0.997607 time_finished: 2022-02-07 16:53:33 calliope_version: 0.6.8-dev applied_overrides: scenario: None defaults: available_area: null\ncarrier_ratios: null\nch... allow_operate_mode: 1 model_config: calliope_version: 0.6.8\nname: Urban-scale exa... run_config: backend: pyomo\nbigM: 1000000.0\ncyclic_storag...
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(['X1::pv', 'X2::pv', 'X3::pv'], 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(['electricity', 'gas', 'heat'], dtype='<U11')
array(['monetary'], dtype=object)
array(['X1::pv', 'X1::power_lines:X3', 'X3::demand_electricity', 'N1::heat_pipes:X2', 'X2::pv', 'X1::chp', 'X2::heat_pipes:N1', 'X3::boiler', 'X3::pv', 'X2::power_lines:X1', 'X2::demand_heat', 'X1::supply_grid_power', 'X1::heat_pipes:N1', 'X2::boiler', 'X2::demand_electricity', 'X3::heat_pipes:N1', 'X3::demand_heat', 'X3::power_lines:X1', 'X1::demand_electricity', 'X1::power_lines:X2', 'X1::supply_gas', 'X2::supply_gas', 'X1::demand_heat', 'N1::heat_pipes:X3', 'N1::heat_pipes:X1', 'X3::supply_gas'], dtype=object)
array(['X1::pv', 'X3::pv', 'X2::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([0.0000000e+00, 4.5778336e+01, 6.4927357e+01, 1.9024262e+02, 6.3309509e+01, 2.6094670e+02, 1.9024262e+02, 1.5600000e-02, 5.0000000e+01, 2.7451170e+02, 3.6513767e+02, 3.3620147e+01, 5.9805562e+02, 1.9283047e+02, 2.6934435e+02, 1.0382599e+01, 9.3982291e+00, 4.5778336e+01, 1.3079378e+00, 2.7451170e+02, 6.4431283e+02, 2.2685938e+02, 1.7197109e+00, 1.0382599e+01, 5.9805562e+02, 1.8352941e-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. , 350. , 443.16656])
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.40299997e-06, -7.49999998e-07, 0.00000000e+00, 0.00000000e+00, 2.79999995e-07, 4.20000001e-06, 9.99999997e-07, -1.30000001e-06, -2.79999998e-06, 7.20000003e-06, 8.29999999e-06, -1.19000000e-05, -1.09999999e-06, -2.80000002e-06, -1.10000005e-06, 1.04999999e-05, 5.99000006e-06, -9.19999934e-07, -3.59700005e-06, -7.40000000e-06, -5.96999996e-07, 9.40000007e-07, 0.00000000e+00, -5.29999994e-07, 3.25500000e-06, 0.00000000e+00, 2.70000015e-07, 0.00000000e+00, -6.99999987e-08, 0.00000000e+00, 0.00000000e+00, -4.43000002e-06, 0.00000000e+00, 2.11000003e-06, -2.59699999e-06, 2.40300000e-06, -8.60000014e-07, -5.23999999e-06, -2.59699999e-06, 5.40299993e-06, -7.10000000e-06, 2.50300002e-06, 1.40299997e-06, 1.84999999e-06, 1.40299997e-06, 4.45000001e-06, 0.00000000e+00, -1.50000005e-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]])
# We can sum heat output over all locations and turn the result into a pandas DataFrame
df_heat = model.get_formatted_array('carrier_prod').loc[{'carriers':'heat'}].sum('locs').to_pandas().T
#The information about the dataframe tells us about the amount of data it holds in the index and in each column
df_heat.info()
<class 'pandas.core.frame.DataFrame'> DatetimeIndex: 48 entries, 2005-07-01 00:00:00 to 2005-07-02 23:00:00 Data columns (total 12 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 boiler 48 non-null float64 1 chp 48 non-null float64 2 heat_pipes:N1 48 non-null float64 3 heat_pipes:X1 48 non-null float64 4 heat_pipes:X2 48 non-null float64 5 heat_pipes:X3 48 non-null float64 6 power_lines:X1 48 non-null float64 7 power_lines:X2 48 non-null float64 8 power_lines:X3 48 non-null float64 9 pv 48 non-null float64 10 supply_gas 48 non-null float64 11 supply_grid_power 48 non-null float64 dtypes: float64(12) memory usage: 5.9 KB
# Using .head() to see the first few rows of heat generation and demand
# Note: carrier production in heat_pipes:N1 is heat received by the heat network at any location connected to `N1`
df_heat.head()
techs | boiler | chp | 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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|
timesteps | ||||||||||||
2005-07-01 00:00:00 | 0.000000 | 92.861360 | 170.055601 | 183.475520 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
2005-07-01 01:00:00 | 4.100046 | 78.466297 | 67.213715 | 72.541074 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
2005-07-01 02:00:00 | 9.626102 | 78.876806 | 67.582474 | 72.915564 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
2005-07-01 03:00:00 | 37.084989 | 78.877367 | 67.487047 | 72.812606 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
2005-07-01 04:00:00 | 53.191064 | 83.204646 | 70.897788 | 76.515868 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
# We can plot this by using the timeseries plotting functionality.
# The top-left dropdown gives us the chance to scroll through other timeseries data too.
model.plot.timeseries()
[2022-02-07 16:53:35] 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.