diff --git a/.gitignore b/.gitignore
index 169c1a587..49fa19800 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,7 @@
*.pyc
*.log
+*.nc4
+*.nc
results/
.idea/
.venv/
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 9bf4a8909..f30c2b5cb 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -20,4 +20,4 @@ repos:
rev: 0.8.2
hooks:
- id: nbstripout
- files: ^docs/examples.*\.ipynb$
+ files: ^docs/.*\.ipynb$
diff --git a/docs/notebooks/01-quickstart.ipynb b/docs/notebooks/01-quickstart.ipynb
index ba4becd0c..1500bce77 100644
--- a/docs/notebooks/01-quickstart.ipynb
+++ b/docs/notebooks/01-quickstart.ipynb
@@ -4,7 +4,19 @@
"cell_type": "markdown",
"id": "0",
"metadata": {},
- "source": "# Quickstart\n\nHeat a small workshop with a gas boiler - the minimal working example.\n\nThis notebook introduces the **core concepts** of flixopt:\n\n- **FlowSystem**: The container for your energy system model\n- **Bus**: Balance nodes where energy flows meet\n- **Effect**: Quantities to track and optimize (costs, emissions)\n- **Components**: Equipment like boilers, sources, and sinks\n- **Flow**: Connections between components and buses"
+ "source": [
+ "# Quickstart\n",
+ "\n",
+ "Heat a small workshop with a gas boiler - the minimal working example.\n",
+ "\n",
+ "This notebook introduces the **core concepts** of flixopt:\n",
+ "\n",
+ "- **FlowSystem**: The container for your energy system model\n",
+ "- **Bus**: Balance nodes where energy flows meet\n",
+ "- **Effect**: Quantities to track and optimize (costs, emissions)\n",
+ "- **Components**: Equipment like boilers, sources, and sinks\n",
+ "- **Flow**: Connections between components and buses"
+ ]
},
{
"cell_type": "markdown",
diff --git a/docs/notebooks/02-heat-system.ipynb b/docs/notebooks/02-heat-system.ipynb
index f1392c72f..3ff933ec3 100644
--- a/docs/notebooks/02-heat-system.ipynb
+++ b/docs/notebooks/02-heat-system.ipynb
@@ -4,7 +4,18 @@
"cell_type": "markdown",
"id": "0",
"metadata": {},
- "source": "# Heat System\n\nDistrict heating with thermal storage and time-varying prices.\n\nThis notebook introduces:\n\n- **Storage**: Thermal buffer tanks with charging/discharging\n- **Time series data**: Using real demand profiles\n- **Multiple components**: Combining boiler, storage, and loads\n- **Result visualization**: Heatmaps, balance plots, and charge states"
+ "source": [
+ "# Heat System\n",
+ "\n",
+ "District heating with thermal storage and time-varying prices.\n",
+ "\n",
+ "This notebook introduces:\n",
+ "\n",
+ "- **Storage**: Thermal buffer tanks with charging/discharging\n",
+ "- **Time series data**: Using real demand profiles\n",
+ "- **Multiple components**: Combining boiler, storage, and loads\n",
+ "- **Result visualization**: Heatmaps, balance plots, and charge states"
+ ]
},
{
"cell_type": "markdown",
@@ -149,7 +160,49 @@
"id": "9",
"metadata": {},
"outputs": [],
- "source": "flow_system = fx.FlowSystem(timesteps)\nflow_system.add_carriers(\n fx.Carrier('gas', '#3498db', 'kW'),\n fx.Carrier('heat', '#e74c3c', 'kW'),\n)\nflow_system.add_elements(\n # === Buses ===\n fx.Bus('Gas', carrier='gas'),\n fx.Bus('Heat', carrier='heat'),\n # === Effect ===\n fx.Effect('costs', '€', 'Operating Costs', is_standard=True, is_objective=True),\n # === Gas Supply with time-varying price ===\n fx.Source(\n 'GasGrid',\n outputs=[fx.Flow('Gas', bus='Gas', size=500, effects_per_flow_hour=gas_price)],\n ),\n # === Gas Boiler: 150 kW, 92% efficiency ===\n fx.linear_converters.Boiler(\n 'Boiler',\n thermal_efficiency=0.92,\n thermal_flow=fx.Flow('Heat', bus='Heat', size=150),\n fuel_flow=fx.Flow('Gas', bus='Gas'),\n ),\n # === Thermal Storage: 500 kWh tank ===\n fx.Storage(\n 'ThermalStorage',\n capacity_in_flow_hours=500, # 500 kWh capacity\n initial_charge_state=250, # Start half-full\n minimal_final_charge_state=200, # End with at least 200 kWh\n eta_charge=0.98, # 98% charging efficiency\n eta_discharge=0.98, # 98% discharging efficiency\n relative_loss_per_hour=0.005, # 0.5% heat loss per hour\n charging=fx.Flow('Charge', bus='Heat', size=100), # Max 100 kW charging\n discharging=fx.Flow('Discharge', bus='Heat', size=100), # Max 100 kW discharging\n ),\n # === Office Heat Demand ===\n fx.Sink(\n 'Office',\n inputs=[fx.Flow('Heat', bus='Heat', size=1, fixed_relative_profile=heat_demand)],\n ),\n)"
+ "source": [
+ "flow_system = fx.FlowSystem(timesteps)\n",
+ "flow_system.add_carriers(\n",
+ " fx.Carrier('gas', '#3498db', 'kW'),\n",
+ " fx.Carrier('heat', '#e74c3c', 'kW'),\n",
+ ")\n",
+ "flow_system.add_elements(\n",
+ " # === Buses ===\n",
+ " fx.Bus('Gas', carrier='gas'),\n",
+ " fx.Bus('Heat', carrier='heat'),\n",
+ " # === Effect ===\n",
+ " fx.Effect('costs', '€', 'Operating Costs', is_standard=True, is_objective=True),\n",
+ " # === Gas Supply with time-varying price ===\n",
+ " fx.Source(\n",
+ " 'GasGrid',\n",
+ " outputs=[fx.Flow('Gas', bus='Gas', size=500, effects_per_flow_hour=gas_price)],\n",
+ " ),\n",
+ " # === Gas Boiler: 150 kW, 92% efficiency ===\n",
+ " fx.linear_converters.Boiler(\n",
+ " 'Boiler',\n",
+ " thermal_efficiency=0.92,\n",
+ " thermal_flow=fx.Flow('Heat', bus='Heat', size=150),\n",
+ " fuel_flow=fx.Flow('Gas', bus='Gas'),\n",
+ " ),\n",
+ " # === Thermal Storage: 500 kWh tank ===\n",
+ " fx.Storage(\n",
+ " 'ThermalStorage',\n",
+ " capacity_in_flow_hours=500, # 500 kWh capacity\n",
+ " initial_charge_state=250, # Start half-full\n",
+ " minimal_final_charge_state=200, # End with at least 200 kWh\n",
+ " eta_charge=0.98, # 98% charging efficiency\n",
+ " eta_discharge=0.98, # 98% discharging efficiency\n",
+ " relative_loss_per_hour=0.005, # 0.5% heat loss per hour\n",
+ " charging=fx.Flow('Charge', bus='Heat', size=100), # Max 100 kW charging\n",
+ " discharging=fx.Flow('Discharge', bus='Heat', size=100), # Max 100 kW discharging\n",
+ " ),\n",
+ " # === Office Heat Demand ===\n",
+ " fx.Sink(\n",
+ " 'Office',\n",
+ " inputs=[fx.Flow('Heat', bus='Heat', size=1, fixed_relative_profile=heat_demand)],\n",
+ " ),\n",
+ ")"
+ ]
},
{
"cell_type": "markdown",
diff --git a/docs/notebooks/03-investment-optimization.ipynb b/docs/notebooks/03-investment-optimization.ipynb
index ff62fe037..349c84ccf 100644
--- a/docs/notebooks/03-investment-optimization.ipynb
+++ b/docs/notebooks/03-investment-optimization.ipynb
@@ -4,7 +4,18 @@
"cell_type": "markdown",
"id": "0",
"metadata": {},
- "source": "# Sizing\n\nSize a solar heating system - let the optimizer decide equipment sizes.\n\nThis notebook introduces:\n\n- **InvestParameters**: Define investment decisions with size bounds and costs\n- **Investment costs**: Fixed costs and size-dependent costs\n- **Optimal sizing**: Let the optimizer find the best equipment sizes\n- **Trade-off analysis**: Balance investment vs. operating costs"
+ "source": [
+ "# Sizing\n",
+ "\n",
+ "Size a solar heating system - let the optimizer decide equipment sizes.\n",
+ "\n",
+ "This notebook introduces:\n",
+ "\n",
+ "- **InvestParameters**: Define investment decisions with size bounds and costs\n",
+ "- **Investment costs**: Fixed costs and size-dependent costs\n",
+ "- **Optimal sizing**: Let the optimizer find the best equipment sizes\n",
+ "- **Trade-off analysis**: Balance investment vs. operating costs"
+ ]
},
{
"cell_type": "markdown",
@@ -171,7 +182,71 @@
"id": "10",
"metadata": {},
"outputs": [],
- "source": "flow_system = fx.FlowSystem(timesteps)\nflow_system.add_carriers(\n fx.Carrier('gas', '#3498db', 'kW'),\n fx.Carrier('heat', '#e74c3c', 'kW'),\n)\nflow_system.add_elements(\n # === Buses ===\n fx.Bus('Heat', carrier='heat'),\n fx.Bus('Gas', carrier='gas'),\n # === Effects ===\n fx.Effect('costs', '€', 'Total Costs', is_standard=True, is_objective=True),\n # === Gas Supply ===\n fx.Source(\n 'GasGrid',\n outputs=[fx.Flow('Gas', bus='Gas', size=500, effects_per_flow_hour=GAS_PRICE)],\n ),\n # === Gas Boiler (existing, fixed size) ===\n fx.linear_converters.Boiler(\n 'GasBoiler',\n thermal_efficiency=0.92,\n thermal_flow=fx.Flow('Heat', bus='Heat', size=200), # 200 kW existing\n fuel_flow=fx.Flow('Gas', bus='Gas'),\n ),\n # === Solar Collectors (size to be optimized) ===\n fx.Source(\n 'SolarCollectors',\n outputs=[\n fx.Flow(\n 'Heat',\n bus='Heat',\n # Investment optimization: find optimal size between 0-500 kW\n size=fx.InvestParameters(\n minimum_size=0,\n maximum_size=500,\n effects_of_investment_per_size={'costs': SOLAR_COST_WEEKLY},\n ),\n # Solar output depends on radiation profile\n fixed_relative_profile=solar_profile,\n )\n ],\n ),\n # === Buffer Tank (size to be optimized) ===\n fx.Storage(\n 'BufferTank',\n # Investment optimization: find optimal capacity between 0-2000 kWh\n capacity_in_flow_hours=fx.InvestParameters(\n minimum_size=0,\n maximum_size=2000,\n effects_of_investment_per_size={'costs': TANK_COST_WEEKLY},\n ),\n initial_charge_state=0,\n eta_charge=0.95,\n eta_discharge=0.95,\n relative_loss_per_hour=0.01, # 1% loss per hour\n charging=fx.Flow('Charge', bus='Heat', size=200),\n discharging=fx.Flow('Discharge', bus='Heat', size=200),\n ),\n # === Pool Heat Demand ===\n fx.Sink(\n 'Pool',\n inputs=[fx.Flow('Heat', bus='Heat', size=1, fixed_relative_profile=pool_demand)],\n ),\n)"
+ "source": [
+ "flow_system = fx.FlowSystem(timesteps)\n",
+ "flow_system.add_carriers(\n",
+ " fx.Carrier('gas', '#3498db', 'kW'),\n",
+ " fx.Carrier('heat', '#e74c3c', 'kW'),\n",
+ ")\n",
+ "flow_system.add_elements(\n",
+ " # === Buses ===\n",
+ " fx.Bus('Heat', carrier='heat'),\n",
+ " fx.Bus('Gas', carrier='gas'),\n",
+ " # === Effects ===\n",
+ " fx.Effect('costs', '€', 'Total Costs', is_standard=True, is_objective=True),\n",
+ " # === Gas Supply ===\n",
+ " fx.Source(\n",
+ " 'GasGrid',\n",
+ " outputs=[fx.Flow('Gas', bus='Gas', size=500, effects_per_flow_hour=GAS_PRICE)],\n",
+ " ),\n",
+ " # === Gas Boiler (existing, fixed size) ===\n",
+ " fx.linear_converters.Boiler(\n",
+ " 'GasBoiler',\n",
+ " thermal_efficiency=0.92,\n",
+ " thermal_flow=fx.Flow('Heat', bus='Heat', size=200), # 200 kW existing\n",
+ " fuel_flow=fx.Flow('Gas', bus='Gas'),\n",
+ " ),\n",
+ " # === Solar Collectors (size to be optimized) ===\n",
+ " fx.Source(\n",
+ " 'SolarCollectors',\n",
+ " outputs=[\n",
+ " fx.Flow(\n",
+ " 'Heat',\n",
+ " bus='Heat',\n",
+ " # Investment optimization: find optimal size between 0-500 kW\n",
+ " size=fx.InvestParameters(\n",
+ " minimum_size=0,\n",
+ " maximum_size=500,\n",
+ " effects_of_investment_per_size={'costs': SOLAR_COST_WEEKLY},\n",
+ " ),\n",
+ " # Solar output depends on radiation profile\n",
+ " fixed_relative_profile=solar_profile,\n",
+ " )\n",
+ " ],\n",
+ " ),\n",
+ " # === Buffer Tank (size to be optimized) ===\n",
+ " fx.Storage(\n",
+ " 'BufferTank',\n",
+ " # Investment optimization: find optimal capacity between 0-2000 kWh\n",
+ " capacity_in_flow_hours=fx.InvestParameters(\n",
+ " minimum_size=0,\n",
+ " maximum_size=2000,\n",
+ " effects_of_investment_per_size={'costs': TANK_COST_WEEKLY},\n",
+ " ),\n",
+ " initial_charge_state=0,\n",
+ " eta_charge=0.95,\n",
+ " eta_discharge=0.95,\n",
+ " relative_loss_per_hour=0.01, # 1% loss per hour\n",
+ " charging=fx.Flow('Charge', bus='Heat', size=200),\n",
+ " discharging=fx.Flow('Discharge', bus='Heat', size=200),\n",
+ " ),\n",
+ " # === Pool Heat Demand ===\n",
+ " fx.Sink(\n",
+ " 'Pool',\n",
+ " inputs=[fx.Flow('Heat', bus='Heat', size=1, fixed_relative_profile=pool_demand)],\n",
+ " ),\n",
+ ")"
+ ]
},
{
"cell_type": "markdown",
@@ -207,7 +282,14 @@
"id": "14",
"metadata": {},
"outputs": [],
- "source": "solar_size = flow_system.statistics.sizes['SolarCollectors(Heat)'].item()\ntank_size = flow_system.statistics.sizes['BufferTank'].item()\n\nprint('=== Optimal Investment Decisions ===')\nprint(f'Solar collectors: {solar_size:.1f} kW')\nprint(f'Buffer tank: {tank_size:.1f} kWh')\nprint(f'Tank-to-solar ratio: {tank_size / solar_size:.1f} kWh/kW' if solar_size > 0 else 'N/A')"
+ "source": [
+ "solar_size = flow_system.statistics.sizes['SolarCollectors(Heat)'].item()\n",
+ "tank_size = flow_system.statistics.sizes['BufferTank'].item()\n",
+ "\n",
+ "print(\n",
+ " f'Optimal sizes: Solar {solar_size:.0f} kW, Tank {tank_size:.0f} kWh (ratio: {tank_size / solar_size:.1f} kWh/kW)'\n",
+ ")"
+ ]
},
{
"cell_type": "markdown",
@@ -249,12 +331,9 @@
"tank_invest = tank_size * TANK_COST_WEEKLY\n",
"gas_costs = total_costs - solar_invest - tank_invest\n",
"\n",
- "print('=== Weekly Cost Breakdown ===')\n",
- "print(f'Solar investment: {solar_invest:.2f} € ({solar_invest / total_costs * 100:.1f}%)')\n",
- "print(f'Tank investment: {tank_invest:.2f} € ({tank_invest / total_costs * 100:.1f}%)')\n",
- "print(f'Gas operating: {gas_costs:.2f} € ({gas_costs / total_costs * 100:.1f}%)')\n",
- "print('─────────────────────────────')\n",
- "print(f'Total: {total_costs:.2f} €')"
+ "print(\n",
+ " f'Weekly costs: Solar {solar_invest:.1f}€ ({solar_invest / total_costs * 100:.0f}%) + Tank {tank_invest:.1f}€ ({tank_invest / total_costs * 100:.0f}%) + Gas {gas_costs:.1f}€ ({gas_costs / total_costs * 100:.0f}%) = {total_costs:.1f}€'\n",
+ ")"
]
},
{
@@ -317,13 +396,9 @@
"gas_only_cost = total_demand / 0.92 * GAS_PRICE # All heat from gas boiler\n",
"\n",
"savings = gas_only_cost - total_costs\n",
- "savings_pct = savings / gas_only_cost * 100\n",
- "\n",
- "print('=== Comparison with Gas-Only ===')\n",
- "print(f'Gas-only cost: {gas_only_cost:.2f} €/week')\n",
- "print(f'With solar: {total_costs:.2f} €/week')\n",
- "print(f'Savings: {savings:.2f} €/week ({savings_pct:.1f}%)')\n",
- "print(f'Annual savings: {savings * 52:.0f} €/year')"
+ "print(\n",
+ " f'Solar saves {savings:.1f}€/week ({savings / gas_only_cost * 100:.0f}%) vs gas-only ({gas_only_cost:.1f}€) → {savings * 52:.0f}€/year'\n",
+ ")"
]
},
{
diff --git a/docs/notebooks/04-operational-constraints.ipynb b/docs/notebooks/04-operational-constraints.ipynb
index 9090b172b..fbb611d1c 100644
--- a/docs/notebooks/04-operational-constraints.ipynb
+++ b/docs/notebooks/04-operational-constraints.ipynb
@@ -1,8 +1,9 @@
{
"cells": [
{
- "metadata": {},
"cell_type": "markdown",
+ "id": "0",
+ "metadata": {},
"source": [
"# Constraints\n",
"\n",
@@ -14,20 +15,22 @@
"- **Startup costs**: Penalties for turning equipment on\n",
"- **Minimum uptime/downtime**: Prevent rapid cycling\n",
"- **Minimum load**: Equipment can't run below a certain output"
- ],
- "id": "217ee38bd32426e5"
+ ]
},
{
- "metadata": {},
"cell_type": "markdown",
- "source": "## Setup",
- "id": "73f6d18d567c6329"
+ "id": "1",
+ "metadata": {},
+ "source": [
+ "## Setup"
+ ]
},
{
- "metadata": {},
"cell_type": "code",
- "outputs": [],
"execution_count": null,
+ "id": "2",
+ "metadata": {},
+ "outputs": [],
"source": [
"import numpy as np\n",
"import pandas as pd\n",
@@ -37,12 +40,12 @@
"import flixopt as fx\n",
"\n",
"fx.CONFIG.notebook()"
- ],
- "id": "e8a50bb05c1400f2"
+ ]
},
{
- "metadata": {},
"cell_type": "markdown",
+ "id": "3",
+ "metadata": {},
"source": [
"## System Description\n",
"\n",
@@ -53,20 +56,22 @@
"- **Steam demand**: Varies with production schedule (high during shifts, low overnight)\n",
"\n",
"The main boiler is more efficient but has operational constraints. The backup is less efficient but flexible."
- ],
- "id": "54d9decc2ccf8235"
+ ]
},
{
- "metadata": {},
"cell_type": "markdown",
- "source": "## Define Time Horizon and Demand",
- "id": "65694ad43e7a1f42"
+ "id": "4",
+ "metadata": {},
+ "source": [
+ "## Define Time Horizon and Demand"
+ ]
},
{
- "metadata": {},
"cell_type": "code",
- "outputs": [],
"execution_count": null,
+ "id": "5",
+ "metadata": {},
+ "outputs": [],
"source": [
"# 3 days, hourly resolution\n",
"timesteps = pd.date_range('2024-03-11', periods=72, freq='h')\n",
@@ -94,28 +99,32 @@
"\n",
"print(f'Peak demand: {steam_demand.max():.0f} kW')\n",
"print(f'Min demand: {steam_demand.min():.0f} kW')"
- ],
- "id": "8c606ee48c294628"
+ ]
},
{
- "metadata": {},
"cell_type": "code",
- "outputs": [],
"execution_count": null,
- "source": "px.line(x=timesteps, y=steam_demand, title='Factory Steam Demand', labels={'x': 'Time', 'y': 'kW'})",
- "id": "fd4f46fa717b1572"
+ "id": "6",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "px.line(x=timesteps, y=steam_demand, title='Factory Steam Demand', labels={'x': 'Time', 'y': 'kW'})"
+ ]
},
{
- "metadata": {},
"cell_type": "markdown",
- "source": "## Build System with Operational Constraints",
- "id": "2d823131e625dcfa"
+ "id": "7",
+ "metadata": {},
+ "source": [
+ "## Build System with Operational Constraints"
+ ]
},
{
- "metadata": {},
"cell_type": "code",
- "outputs": [],
"execution_count": null,
+ "id": "8",
+ "metadata": {},
+ "outputs": [],
"source": [
"flow_system = fx.FlowSystem(timesteps)\n",
"\n",
@@ -168,46 +177,52 @@
" inputs=[fx.Flow('Steam', bus='Steam', size=1, fixed_relative_profile=steam_demand)],\n",
" ),\n",
")"
- ],
- "id": "736dfa9a935f6c7e"
+ ]
},
{
- "metadata": {},
"cell_type": "markdown",
- "source": "## Run Optimization",
- "id": "70ae8aaa82997d51"
+ "id": "9",
+ "metadata": {},
+ "source": [
+ "## Run Optimization"
+ ]
},
{
- "metadata": {},
"cell_type": "code",
- "outputs": [],
"execution_count": null,
- "source": "flow_system.optimize(fx.solvers.HighsSolver(mip_gap=0.01));",
- "id": "76f27e3afe64f8c5"
+ "id": "10",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "flow_system.optimize(fx.solvers.HighsSolver(mip_gap=0.01));"
+ ]
},
{
- "metadata": {},
"cell_type": "markdown",
+ "id": "11",
+ "metadata": {},
"source": [
"## Analyze Results\n",
"\n",
"### Steam Balance\n",
"\n",
"See how the two boilers share the load:"
- ],
- "id": "c42e2778fd0a8ca"
+ ]
},
{
- "metadata": {},
"cell_type": "code",
- "outputs": [],
"execution_count": null,
- "source": "flow_system.statistics.plot.balance('Steam')",
- "id": "9da80bc8faca05cd"
+ "id": "12",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "flow_system.statistics.plot.balance('Steam')"
+ ]
},
{
- "metadata": {},
"cell_type": "markdown",
+ "id": "13",
+ "metadata": {},
"source": [
"### Main Boiler Operation\n",
"\n",
@@ -215,32 +230,34 @@
"- Runs continuously during production (respecting min uptime)\n",
"- Stays above minimum load (30%)\n",
"- Shuts down during low-demand periods"
- ],
- "id": "c885d25675d71371"
+ ]
},
{
- "metadata": {},
"cell_type": "code",
- "outputs": [],
"execution_count": null,
- "source": "flow_system.statistics.plot.heatmap('MainBoiler(Steam)')",
- "id": "5a549b8b60f32745"
+ "id": "14",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "flow_system.statistics.plot.heatmap('MainBoiler(Steam)')"
+ ]
},
{
- "metadata": {},
"cell_type": "markdown",
+ "id": "15",
+ "metadata": {},
"source": [
"### On/Off Status\n",
"\n",
"Track the boiler's operational status:"
- ],
- "id": "66816d462d2f2654"
+ ]
},
{
- "metadata": {},
"cell_type": "code",
- "outputs": [],
"execution_count": null,
+ "id": "16",
+ "metadata": {},
+ "outputs": [],
"source": [
"# Merge solution DataArrays directly - xarray aligns coordinates automatically\n",
"status_ds = xr.Dataset(\n",
@@ -255,75 +272,79 @@
"fig.update_yaxes(matches=None, showticklabels=True)\n",
"fig.for_each_annotation(lambda a: a.update(text=a.text.split('=')[-1]))\n",
"fig"
- ],
- "id": "41801a37f07aa265"
+ ]
},
{
- "metadata": {},
"cell_type": "markdown",
- "source": "### Startup Count and Costs",
- "id": "7ca893f03606362"
+ "id": "17",
+ "metadata": {},
+ "source": [
+ "### Startup Count and Costs"
+ ]
},
{
- "metadata": {},
"cell_type": "code",
- "outputs": [],
"execution_count": null,
+ "id": "18",
+ "metadata": {},
+ "outputs": [],
"source": [
"total_startups = int(flow_system.solution['MainBoiler|startup'].sum().item())\n",
"total_costs = flow_system.solution['costs'].item()\n",
"startup_costs = total_startups * 50\n",
"gas_costs = total_costs - startup_costs\n",
"\n",
- "print('=== Cost Breakdown ===')\n",
- "print(f'Number of startups: {total_startups}')\n",
- "print(f'Startup costs: {startup_costs:.0f} €')\n",
- "print(f'Gas costs: {gas_costs:.2f} €')\n",
- "print(f'Total costs: {total_costs:.2f} €')"
- ],
- "id": "a95273c9775e1fd9"
+ "print(\n",
+ " f'{total_startups} startups × 50€ = {startup_costs:.0f}€ startup + {gas_costs:.0f}€ gas = {total_costs:.0f}€ total'\n",
+ ")"
+ ]
},
{
- "metadata": {},
"cell_type": "markdown",
+ "id": "19",
+ "metadata": {},
"source": [
"### Duration Curves\n",
"\n",
"See how often each boiler operates at different load levels:"
- ],
- "id": "e29cf8ae428387bd"
+ ]
},
{
- "metadata": {},
"cell_type": "code",
- "outputs": [],
"execution_count": null,
- "source": "flow_system.statistics.plot.duration_curve('MainBoiler(Steam)')",
- "id": "14e906ea8912de10"
+ "id": "20",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "flow_system.statistics.plot.duration_curve('MainBoiler(Steam)')"
+ ]
},
{
- "metadata": {},
"cell_type": "code",
- "outputs": [],
"execution_count": null,
- "source": "flow_system.statistics.plot.duration_curve('BackupBoiler(Steam)')",
- "id": "15d6068612a73f84"
+ "id": "21",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "flow_system.statistics.plot.duration_curve('BackupBoiler(Steam)')"
+ ]
},
{
- "metadata": {},
"cell_type": "markdown",
+ "id": "22",
+ "metadata": {},
"source": [
"## Compare: Without Operational Constraints\n",
"\n",
"What if the main boiler had no startup costs or minimum uptime?"
- ],
- "id": "8354cd68733d5086"
+ ]
},
{
- "metadata": {},
"cell_type": "code",
- "outputs": [],
"execution_count": null,
+ "id": "23",
+ "metadata": {},
+ "outputs": [],
"source": [
"# Build unconstrained system\n",
"fs_unconstrained = fx.FlowSystem(timesteps)\n",
@@ -356,36 +377,34 @@
"fs_unconstrained.optimize(fx.solvers.HighsSolver())\n",
"unconstrained_costs = fs_unconstrained.solution['costs'].item()\n",
"\n",
- "print('=== Comparison ===')\n",
- "print(f'With constraints: {total_costs:.2f} €')\n",
- "print(f'Without constraints: {unconstrained_costs:.2f} €')\n",
- "print(\n",
- " f'Constraint cost: {total_costs - unconstrained_costs:.2f} € ({(total_costs - unconstrained_costs) / unconstrained_costs * 100:.1f}%)'\n",
- ")"
- ],
- "id": "8769dbda34dd4ccf"
+ "constraint_overhead = (total_costs - unconstrained_costs) / unconstrained_costs * 100\n",
+ "print(f'Constraints add {constraint_overhead:.1f}% cost: {unconstrained_costs:.0f}€ → {total_costs:.0f}€')"
+ ]
},
{
- "metadata": {},
"cell_type": "markdown",
+ "id": "24",
+ "metadata": {},
"source": [
"### Energy Flow Sankey\n",
"\n",
"A Sankey diagram visualizes the total energy flows through the system:"
- ],
- "id": "64ddc254af867367"
+ ]
},
{
- "metadata": {},
"cell_type": "code",
- "outputs": [],
"execution_count": null,
- "source": "flow_system.statistics.plot.sankey.flows()",
- "id": "f2742f4b0a7c5323"
+ "id": "25",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "flow_system.statistics.plot.sankey.flows()"
+ ]
},
{
- "metadata": {},
"cell_type": "markdown",
+ "id": "26",
+ "metadata": {},
"source": [
"## Key Concepts\n",
"\n",
@@ -433,8 +452,7 @@
"\n",
"- **[05-multi-carrier-system](05-multi-carrier-system.ipynb)**: Model CHP with electricity and heat\n",
"- **[06a-time-varying-parameters](06a-time-varying-parameters.ipynb)**: Variable efficiency based on external conditions"
- ],
- "id": "2f9951587227304f"
+ ]
}
],
"metadata": {},
diff --git a/docs/notebooks/05-multi-carrier-system.ipynb b/docs/notebooks/05-multi-carrier-system.ipynb
index 76de7e69a..a1a9543fa 100644
--- a/docs/notebooks/05-multi-carrier-system.ipynb
+++ b/docs/notebooks/05-multi-carrier-system.ipynb
@@ -4,7 +4,18 @@
"cell_type": "markdown",
"id": "0",
"metadata": {},
- "source": "# Multi-Carrier\n\nHospital with CHP producing both electricity and heat.\n\nThis notebook introduces:\n\n- **Multiple energy carriers**: Electricity, heat, and gas in one system\n- **CHP (Cogeneration)**: Equipment producing multiple outputs\n- **Electricity market**: Buying and selling to the grid\n- **Carrier colors**: Visual distinction between energy types"
+ "source": [
+ "# Multi-Carrier\n",
+ "\n",
+ "Hospital with CHP producing both electricity and heat.\n",
+ "\n",
+ "This notebook introduces:\n",
+ "\n",
+ "- **Multiple energy carriers**: Electricity, heat, and gas in one system\n",
+ "- **CHP (Cogeneration)**: Equipment producing multiple outputs\n",
+ "- **Electricity market**: Buying and selling to the grid\n",
+ "- **Carrier colors**: Visual distinction between energy types"
+ ]
},
{
"cell_type": "markdown",
@@ -169,7 +180,93 @@
"id": "9",
"metadata": {},
"outputs": [],
- "source": "flow_system = fx.FlowSystem(timesteps)\nflow_system.add_carriers(\n fx.Carrier('gas', '#3498db', 'kW'),\n fx.Carrier('electricity', '#f1c40f', 'kW'),\n fx.Carrier('heat', '#e74c3c', 'kW'),\n)\nflow_system.add_elements(\n # === Buses with carriers for visual distinction ===\n fx.Bus('Electricity', carrier='electricity'),\n fx.Bus('Heat', carrier='heat'),\n fx.Bus('Gas', carrier='gas'),\n # === Effects ===\n fx.Effect('costs', '€', 'Total Costs', is_standard=True, is_objective=True),\n fx.Effect('CO2', 'kg', 'CO2 Emissions'), # Track emissions too\n # === Gas Supply ===\n fx.Source(\n 'GasGrid',\n outputs=[\n fx.Flow(\n 'Gas',\n bus='Gas',\n size=1000,\n effects_per_flow_hour={'costs': gas_price, 'CO2': 0.2}, # Gas: 0.2 kg CO2/kWh\n )\n ],\n ),\n # === Electricity Grid (buy) ===\n fx.Source(\n 'GridBuy',\n outputs=[\n fx.Flow(\n 'Electricity',\n bus='Electricity',\n size=500,\n effects_per_flow_hour={'costs': elec_buy_price, 'CO2': 0.4}, # Grid: 0.4 kg CO2/kWh\n )\n ],\n ),\n # === Electricity Grid (sell) - negative cost = revenue ===\n fx.Sink(\n 'GridSell',\n inputs=[\n fx.Flow(\n 'Electricity',\n bus='Electricity',\n size=200,\n effects_per_flow_hour={'costs': -elec_sell_price}, # Negative = income\n )\n ],\n ),\n # === CHP Unit (Combined Heat and Power) ===\n fx.linear_converters.CHP(\n 'CHP',\n electrical_efficiency=0.40, # 40% to electricity\n thermal_efficiency=0.50, # 50% to heat (total: 90%)\n status_parameters=fx.StatusParameters(\n effects_per_startup={'costs': 30},\n min_uptime=3,\n ),\n electrical_flow=fx.Flow('P_el', bus='Electricity', size=200),\n thermal_flow=fx.Flow('Q_th', bus='Heat', size=250),\n fuel_flow=fx.Flow(\n 'Q_fuel',\n bus='Gas',\n size=500,\n relative_minimum=0.4, # Min 40% load\n ),\n ),\n # === Gas Boiler (heat only) ===\n fx.linear_converters.Boiler(\n 'Boiler',\n thermal_efficiency=0.92,\n thermal_flow=fx.Flow('Q_th', bus='Heat', size=400),\n fuel_flow=fx.Flow('Q_fuel', bus='Gas'),\n ),\n # === Hospital Loads ===\n fx.Sink(\n 'HospitalElec',\n inputs=[fx.Flow('Load', bus='Electricity', size=1, fixed_relative_profile=electricity_demand)],\n ),\n fx.Sink(\n 'HospitalHeat',\n inputs=[fx.Flow('Load', bus='Heat', size=1, fixed_relative_profile=heat_demand)],\n ),\n)"
+ "source": [
+ "flow_system = fx.FlowSystem(timesteps)\n",
+ "flow_system.add_carriers(\n",
+ " fx.Carrier('gas', '#3498db', 'kW'),\n",
+ " fx.Carrier('electricity', '#f1c40f', 'kW'),\n",
+ " fx.Carrier('heat', '#e74c3c', 'kW'),\n",
+ ")\n",
+ "flow_system.add_elements(\n",
+ " # === Buses with carriers for visual distinction ===\n",
+ " fx.Bus('Electricity', carrier='electricity'),\n",
+ " fx.Bus('Heat', carrier='heat'),\n",
+ " fx.Bus('Gas', carrier='gas'),\n",
+ " # === Effects ===\n",
+ " fx.Effect('costs', '€', 'Total Costs', is_standard=True, is_objective=True),\n",
+ " fx.Effect('CO2', 'kg', 'CO2 Emissions'), # Track emissions too\n",
+ " # === Gas Supply ===\n",
+ " fx.Source(\n",
+ " 'GasGrid',\n",
+ " outputs=[\n",
+ " fx.Flow(\n",
+ " 'Gas',\n",
+ " bus='Gas',\n",
+ " size=1000,\n",
+ " effects_per_flow_hour={'costs': gas_price, 'CO2': 0.2}, # Gas: 0.2 kg CO2/kWh\n",
+ " )\n",
+ " ],\n",
+ " ),\n",
+ " # === Electricity Grid (buy) ===\n",
+ " fx.Source(\n",
+ " 'GridBuy',\n",
+ " outputs=[\n",
+ " fx.Flow(\n",
+ " 'Electricity',\n",
+ " bus='Electricity',\n",
+ " size=500,\n",
+ " effects_per_flow_hour={'costs': elec_buy_price, 'CO2': 0.4}, # Grid: 0.4 kg CO2/kWh\n",
+ " )\n",
+ " ],\n",
+ " ),\n",
+ " # === Electricity Grid (sell) - negative cost = revenue ===\n",
+ " fx.Sink(\n",
+ " 'GridSell',\n",
+ " inputs=[\n",
+ " fx.Flow(\n",
+ " 'Electricity',\n",
+ " bus='Electricity',\n",
+ " size=200,\n",
+ " effects_per_flow_hour={'costs': -elec_sell_price}, # Negative = income\n",
+ " )\n",
+ " ],\n",
+ " ),\n",
+ " # === CHP Unit (Combined Heat and Power) ===\n",
+ " fx.linear_converters.CHP(\n",
+ " 'CHP',\n",
+ " electrical_efficiency=0.40, # 40% to electricity\n",
+ " thermal_efficiency=0.50, # 50% to heat (total: 90%)\n",
+ " status_parameters=fx.StatusParameters(\n",
+ " effects_per_startup={'costs': 30},\n",
+ " min_uptime=3,\n",
+ " ),\n",
+ " electrical_flow=fx.Flow('P_el', bus='Electricity', size=200),\n",
+ " thermal_flow=fx.Flow('Q_th', bus='Heat', size=250),\n",
+ " fuel_flow=fx.Flow(\n",
+ " 'Q_fuel',\n",
+ " bus='Gas',\n",
+ " size=500,\n",
+ " relative_minimum=0.4, # Min 40% load\n",
+ " ),\n",
+ " ),\n",
+ " # === Gas Boiler (heat only) ===\n",
+ " fx.linear_converters.Boiler(\n",
+ " 'Boiler',\n",
+ " thermal_efficiency=0.92,\n",
+ " thermal_flow=fx.Flow('Q_th', bus='Heat', size=400),\n",
+ " fuel_flow=fx.Flow('Q_fuel', bus='Gas'),\n",
+ " ),\n",
+ " # === Hospital Loads ===\n",
+ " fx.Sink(\n",
+ " 'HospitalElec',\n",
+ " inputs=[fx.Flow('Load', bus='Electricity', size=1, fixed_relative_profile=electricity_demand)],\n",
+ " ),\n",
+ " fx.Sink(\n",
+ " 'HospitalHeat',\n",
+ " inputs=[fx.Flow('Load', bus='Heat', size=1, fixed_relative_profile=heat_demand)],\n",
+ " ),\n",
+ ")"
+ ]
},
{
"cell_type": "markdown",
@@ -292,21 +389,12 @@
"total_elec = electricity_demand.sum()\n",
"total_heat = heat_demand.sum()\n",
"\n",
- "print('=== Energy Summary ===')\n",
- "print(f'Total electricity demand: {total_elec:.0f} kWh')\n",
- "print(f' - From CHP: {chp_elec:.0f} kWh ({chp_elec / total_elec * 100:.1f}%)')\n",
- "print(f' - From Grid: {grid_buy:.0f} kWh ({grid_buy / total_elec * 100:.1f}%)')\n",
- "print(f' - Sold to Grid: {grid_sell:.0f} kWh')\n",
- "print()\n",
- "print(f'Total heat demand: {total_heat:.0f} kWh')\n",
- "print(f' - From CHP: {chp_heat:.0f} kWh ({chp_heat / total_heat * 100:.1f}%)')\n",
- "print(f' - From Boiler: {boiler_heat:.0f} kWh ({boiler_heat / total_heat * 100:.1f}%)')\n",
- "print()\n",
- "print('=== Costs & Emissions ===')\n",
- "print(f'Total costs: {total_costs:.2f} €')\n",
- "print(f'Total CO2: {total_co2:.0f} kg')\n",
- "print(f'Specific costs: {total_costs / (total_elec + total_heat) * 100:.2f} ct/kWh')\n",
- "print(f'Specific CO2: {total_co2 / (total_elec + total_heat) * 1000:.1f} g/kWh')"
+ "# Display as compact summary\n",
+ "print(\n",
+ " f'Electricity: {chp_elec:.0f} kWh CHP ({chp_elec / total_elec * 100:.0f}%) + {grid_buy:.0f} kWh grid, {grid_sell:.0f} kWh sold'\n",
+ ")\n",
+ "print(f'Heat: {chp_heat:.0f} kWh CHP ({chp_heat / total_heat * 100:.0f}%) + {boiler_heat:.0f} kWh boiler')\n",
+ "print(f'Costs: {total_costs:.2f} € | CO2: {total_co2:.0f} kg')"
]
},
{
@@ -325,7 +413,56 @@
"id": "23",
"metadata": {},
"outputs": [],
- "source": "# Build system without CHP\nfs_no_chp = fx.FlowSystem(timesteps)\nfs_no_chp.add_carriers(\n fx.Carrier('gas', '#3498db', 'kW'),\n fx.Carrier('electricity', '#f1c40f', 'kW'),\n fx.Carrier('heat', '#e74c3c', 'kW'),\n)\nfs_no_chp.add_elements(\n fx.Bus('Electricity', carrier='electricity'),\n fx.Bus('Heat', carrier='heat'),\n fx.Bus('Gas', carrier='gas'),\n fx.Effect('costs', '€', 'Total Costs', is_standard=True, is_objective=True),\n fx.Effect('CO2', 'kg', 'CO2 Emissions'),\n fx.Source(\n 'GasGrid',\n outputs=[fx.Flow('Gas', bus='Gas', size=1000, effects_per_flow_hour={'costs': gas_price, 'CO2': 0.2})],\n ),\n fx.Source(\n 'GridBuy',\n outputs=[\n fx.Flow(\n 'Electricity', bus='Electricity', size=500, effects_per_flow_hour={'costs': elec_buy_price, 'CO2': 0.4}\n )\n ],\n ),\n # Only boiler for heat\n fx.linear_converters.Boiler(\n 'Boiler',\n thermal_efficiency=0.92,\n thermal_flow=fx.Flow('Q_th', bus='Heat', size=500),\n fuel_flow=fx.Flow('Q_fuel', bus='Gas'),\n ),\n fx.Sink(\n 'HospitalElec', inputs=[fx.Flow('Load', bus='Electricity', size=1, fixed_relative_profile=electricity_demand)]\n ),\n fx.Sink('HospitalHeat', inputs=[fx.Flow('Load', bus='Heat', size=1, fixed_relative_profile=heat_demand)]),\n)\n\nfs_no_chp.optimize(fx.solvers.HighsSolver())\n\nno_chp_costs = fs_no_chp.solution['costs'].item()\nno_chp_co2 = fs_no_chp.solution['CO2'].item()\n\nprint('=== CHP Benefit Analysis ===')\nprint(f'Without CHP: {no_chp_costs:.2f} € / {no_chp_co2:.0f} kg CO2')\nprint(f'With CHP: {total_costs:.2f} € / {total_co2:.0f} kg CO2')\nprint(f'Cost savings: {no_chp_costs - total_costs:.2f} € ({(no_chp_costs - total_costs) / no_chp_costs * 100:.1f}%)')\nprint(f'CO2 reduction: {no_chp_co2 - total_co2:.0f} kg ({(no_chp_co2 - total_co2) / no_chp_co2 * 100:.1f}%)')"
+ "source": [
+ "# Build system without CHP\n",
+ "fs_no_chp = fx.FlowSystem(timesteps)\n",
+ "fs_no_chp.add_carriers(\n",
+ " fx.Carrier('gas', '#3498db', 'kW'),\n",
+ " fx.Carrier('electricity', '#f1c40f', 'kW'),\n",
+ " fx.Carrier('heat', '#e74c3c', 'kW'),\n",
+ ")\n",
+ "fs_no_chp.add_elements(\n",
+ " fx.Bus('Electricity', carrier='electricity'),\n",
+ " fx.Bus('Heat', carrier='heat'),\n",
+ " fx.Bus('Gas', carrier='gas'),\n",
+ " fx.Effect('costs', '€', 'Total Costs', is_standard=True, is_objective=True),\n",
+ " fx.Effect('CO2', 'kg', 'CO2 Emissions'),\n",
+ " fx.Source(\n",
+ " 'GasGrid',\n",
+ " outputs=[fx.Flow('Gas', bus='Gas', size=1000, effects_per_flow_hour={'costs': gas_price, 'CO2': 0.2})],\n",
+ " ),\n",
+ " fx.Source(\n",
+ " 'GridBuy',\n",
+ " outputs=[\n",
+ " fx.Flow(\n",
+ " 'Electricity', bus='Electricity', size=500, effects_per_flow_hour={'costs': elec_buy_price, 'CO2': 0.4}\n",
+ " )\n",
+ " ],\n",
+ " ),\n",
+ " # Only boiler for heat\n",
+ " fx.linear_converters.Boiler(\n",
+ " 'Boiler',\n",
+ " thermal_efficiency=0.92,\n",
+ " thermal_flow=fx.Flow('Q_th', bus='Heat', size=500),\n",
+ " fuel_flow=fx.Flow('Q_fuel', bus='Gas'),\n",
+ " ),\n",
+ " fx.Sink(\n",
+ " 'HospitalElec', inputs=[fx.Flow('Load', bus='Electricity', size=1, fixed_relative_profile=electricity_demand)]\n",
+ " ),\n",
+ " fx.Sink('HospitalHeat', inputs=[fx.Flow('Load', bus='Heat', size=1, fixed_relative_profile=heat_demand)]),\n",
+ ")\n",
+ "\n",
+ "fs_no_chp.optimize(fx.solvers.HighsSolver())\n",
+ "\n",
+ "no_chp_costs = fs_no_chp.solution['costs'].item()\n",
+ "no_chp_co2 = fs_no_chp.solution['CO2'].item()\n",
+ "\n",
+ "cost_saving = (no_chp_costs - total_costs) / no_chp_costs * 100\n",
+ "co2_saving = (no_chp_co2 - total_co2) / no_chp_co2 * 100\n",
+ "print(\n",
+ " f'CHP saves {cost_saving:.1f}% costs ({no_chp_costs:.0f}→{total_costs:.0f} €) and {co2_saving:.1f}% CO2 ({no_chp_co2:.0f}→{total_co2:.0f} kg)'\n",
+ ")"
+ ]
},
{
"cell_type": "markdown",
@@ -351,7 +488,57 @@
"cell_type": "markdown",
"id": "26",
"metadata": {},
- "source": "## Key Concepts\n\n### Multi-Carrier Systems\n\n- Multiple buses for different energy carriers (electricity, heat, gas)\n- Components can connect to multiple buses (CHP produces both electricity and heat)\n- Carriers enable automatic coloring in visualizations\n\n### CHP Modeling\n\n```python\nfx.linear_converters.CHP(\n 'CHP',\n electrical_efficiency=0.40, # Fuel → Electricity\n thermal_efficiency=0.50, # Fuel → Heat\n # Total efficiency = 0.40 + 0.50 = 0.90 (90%)\n electrical_flow=fx.Flow('P_el', bus='Electricity', size=200),\n thermal_flow=fx.Flow('Q_th', bus='Heat', size=250),\n fuel_flow=fx.Flow('Q_fuel', bus='Gas', size=500),\n)\n```\n\n### Electricity Markets\n\n- **Buy**: Source with positive cost\n- **Sell**: Sink with negative cost (= revenue)\n- Different prices for buy vs. sell (spread)\n\n### Tracking Multiple Effects\n\n```python\nfx.Effect('costs', '€', 'Total Costs', is_objective=True) # Minimize this\nfx.Effect('CO2', 'kg', 'CO2 Emissions') # Just track, don't optimize\n```\n\n## Summary\n\nYou learned how to:\n\n- Model **multiple energy carriers** (electricity, heat, gas)\n- Use **CHP** for combined heat and power production\n- Model **electricity markets** with buy/sell prices\n- Track **multiple effects** (costs and emissions)\n- Analyze **multi-carrier balances**\n\n### Next Steps\n\n- **[06a-time-varying-parameters](06a-time-varying-parameters.ipynb)**: Variable efficiency based on conditions\n- **[07-scenarios-and-periods](07-scenarios-and-periods.ipynb)**: Plan under uncertainty"
+ "source": [
+ "## Key Concepts\n",
+ "\n",
+ "### Multi-Carrier Systems\n",
+ "\n",
+ "- Multiple buses for different energy carriers (electricity, heat, gas)\n",
+ "- Components can connect to multiple buses (CHP produces both electricity and heat)\n",
+ "- Carriers enable automatic coloring in visualizations\n",
+ "\n",
+ "### CHP Modeling\n",
+ "\n",
+ "```python\n",
+ "fx.linear_converters.CHP(\n",
+ " 'CHP',\n",
+ " electrical_efficiency=0.40, # Fuel → Electricity\n",
+ " thermal_efficiency=0.50, # Fuel → Heat\n",
+ " # Total efficiency = 0.40 + 0.50 = 0.90 (90%)\n",
+ " electrical_flow=fx.Flow('P_el', bus='Electricity', size=200),\n",
+ " thermal_flow=fx.Flow('Q_th', bus='Heat', size=250),\n",
+ " fuel_flow=fx.Flow('Q_fuel', bus='Gas', size=500),\n",
+ ")\n",
+ "```\n",
+ "\n",
+ "### Electricity Markets\n",
+ "\n",
+ "- **Buy**: Source with positive cost\n",
+ "- **Sell**: Sink with negative cost (= revenue)\n",
+ "- Different prices for buy vs. sell (spread)\n",
+ "\n",
+ "### Tracking Multiple Effects\n",
+ "\n",
+ "```python\n",
+ "fx.Effect('costs', '€', 'Total Costs', is_objective=True) # Minimize this\n",
+ "fx.Effect('CO2', 'kg', 'CO2 Emissions') # Just track, don't optimize\n",
+ "```\n",
+ "\n",
+ "## Summary\n",
+ "\n",
+ "You learned how to:\n",
+ "\n",
+ "- Model **multiple energy carriers** (electricity, heat, gas)\n",
+ "- Use **CHP** for combined heat and power production\n",
+ "- Model **electricity markets** with buy/sell prices\n",
+ "- Track **multiple effects** (costs and emissions)\n",
+ "- Analyze **multi-carrier balances**\n",
+ "\n",
+ "### Next Steps\n",
+ "\n",
+ "- **[06a-time-varying-parameters](06a-time-varying-parameters.ipynb)**: Variable efficiency based on conditions\n",
+ "- **[07-scenarios-and-periods](07-scenarios-and-periods.ipynb)**: Plan under uncertainty"
+ ]
}
],
"metadata": {
diff --git a/docs/notebooks/06a-time-varying-parameters.ipynb b/docs/notebooks/06a-time-varying-parameters.ipynb
index 9856aa095..5c833b2ea 100644
--- a/docs/notebooks/06a-time-varying-parameters.ipynb
+++ b/docs/notebooks/06a-time-varying-parameters.ipynb
@@ -26,8 +26,10 @@
},
{
"cell_type": "code",
+ "execution_count": null,
"id": "2",
"metadata": {},
+ "outputs": [],
"source": [
"import numpy as np\n",
"import pandas as pd\n",
@@ -37,9 +39,7 @@
"import flixopt as fx\n",
"\n",
"fx.CONFIG.notebook()"
- ],
- "outputs": [],
- "execution_count": null
+ ]
},
{
"cell_type": "markdown",
@@ -73,8 +73,10 @@
},
{
"cell_type": "code",
+ "execution_count": null,
"id": "5",
"metadata": {},
+ "outputs": [],
"source": [
"# One winter week\n",
"timesteps = pd.date_range('2024-01-22', periods=168, freq='h')\n",
@@ -90,26 +92,26 @@
"np.random.seed(789)\n",
"daily_offset = np.repeat(np.random.uniform(-3, 3, 7), 24)\n",
"outdoor_temp = outdoor_temp + daily_offset"
- ],
- "outputs": [],
- "execution_count": null
+ ]
},
{
"cell_type": "code",
+ "execution_count": null,
"id": "6",
"metadata": {},
+ "outputs": [],
"source": [
"# Heat demand: inversely related to outdoor temp (higher demand when colder)\n",
"heat_demand = 200 - 8 * outdoor_temp\n",
"heat_demand = np.clip(heat_demand, 100, 300)"
- ],
- "outputs": [],
- "execution_count": null
+ ]
},
{
"cell_type": "code",
+ "execution_count": null,
"id": "7",
"metadata": {},
+ "outputs": [],
"source": [
"# Visualize input profiles\n",
"profiles = xr.Dataset(\n",
@@ -124,9 +126,7 @@
"fig.update_yaxes(matches=None, showticklabels=True)\n",
"fig.for_each_annotation(lambda a: a.update(text=a.text.split('=')[-1]))\n",
"fig"
- ],
- "outputs": [],
- "execution_count": null
+ ]
},
{
"cell_type": "markdown",
@@ -144,8 +144,10 @@
},
{
"cell_type": "code",
+ "execution_count": null,
"id": "9",
"metadata": {},
+ "outputs": [],
"source": [
"# COP calculation\n",
"T_supply = 45 + 273.15 # Supply temperature 45°C in Kelvin\n",
@@ -154,14 +156,14 @@
"carnot_cop = T_supply / (T_supply - T_source)\n",
"real_cop = 0.45 * carnot_cop\n",
"real_cop = np.clip(real_cop, 2.0, 5.0) # Physical limits"
- ],
- "outputs": [],
- "execution_count": null
+ ]
},
{
"cell_type": "code",
+ "execution_count": null,
"id": "10",
"metadata": {},
+ "outputs": [],
"source": [
"# Visualize COP vs temperature relationship\n",
"px.scatter(\n",
@@ -171,9 +173,7 @@
" labels={'x': 'Outdoor Temperature [°C]', 'y': 'COP'},\n",
" opacity=0.5,\n",
")"
- ],
- "outputs": [],
- "execution_count": null
+ ]
},
{
"cell_type": "markdown",
@@ -191,11 +191,37 @@
},
{
"cell_type": "code",
+ "execution_count": null,
"id": "12",
"metadata": {},
- "source": "flow_system = fx.FlowSystem(timesteps)\nflow_system.add_carriers(\n fx.Carrier('electricity', '#f1c40f', 'kW'),\n fx.Carrier('heat', '#e74c3c', 'kW'),\n)\nflow_system.add_elements(\n # Buses\n fx.Bus('Electricity', carrier='electricity'),\n fx.Bus('Heat', carrier='heat'),\n # Effect for cost tracking\n fx.Effect('costs', '€', 'Operating Costs', is_standard=True, is_objective=True),\n # Grid electricity source\n fx.Source('Grid', outputs=[fx.Flow('Elec', bus='Electricity', size=500, effects_per_flow_hour=0.30)]),\n # Heat pump with TIME-VARYING COP\n fx.LinearConverter(\n 'HeatPump',\n inputs=[fx.Flow('Elec', bus='Electricity', size=150)],\n outputs=[fx.Flow('Heat', bus='Heat', size=500)],\n conversion_factors=[{'Elec': real_cop, 'Heat': 1}], # <-- Array for time-varying COP\n ),\n # Heat demand\n fx.Sink('Building', inputs=[fx.Flow('Heat', bus='Heat', size=1, fixed_relative_profile=heat_demand)]),\n)\n\nflow_system.optimize(fx.solvers.HighsSolver())",
"outputs": [],
- "execution_count": null
+ "source": [
+ "flow_system = fx.FlowSystem(timesteps)\n",
+ "flow_system.add_carriers(\n",
+ " fx.Carrier('electricity', '#f1c40f', 'kW'),\n",
+ " fx.Carrier('heat', '#e74c3c', 'kW'),\n",
+ ")\n",
+ "flow_system.add_elements(\n",
+ " # Buses\n",
+ " fx.Bus('Electricity', carrier='electricity'),\n",
+ " fx.Bus('Heat', carrier='heat'),\n",
+ " # Effect for cost tracking\n",
+ " fx.Effect('costs', '€', 'Operating Costs', is_standard=True, is_objective=True),\n",
+ " # Grid electricity source\n",
+ " fx.Source('Grid', outputs=[fx.Flow('Elec', bus='Electricity', size=500, effects_per_flow_hour=0.30)]),\n",
+ " # Heat pump with TIME-VARYING COP\n",
+ " fx.LinearConverter(\n",
+ " 'HeatPump',\n",
+ " inputs=[fx.Flow('Elec', bus='Electricity', size=150)],\n",
+ " outputs=[fx.Flow('Heat', bus='Heat', size=500)],\n",
+ " conversion_factors=[{'Elec': real_cop, 'Heat': 1}], # <-- Array for time-varying COP\n",
+ " ),\n",
+ " # Heat demand\n",
+ " fx.Sink('Building', inputs=[fx.Flow('Heat', bus='Heat', size=1, fixed_relative_profile=heat_demand)]),\n",
+ ")\n",
+ "\n",
+ "flow_system.optimize(fx.solvers.HighsSolver());"
+ ]
},
{
"cell_type": "markdown",
@@ -207,28 +233,30 @@
},
{
"cell_type": "code",
+ "execution_count": null,
"id": "14",
"metadata": {},
+ "outputs": [],
"source": [
"flow_system.statistics.plot.balance('Heat')"
- ],
- "outputs": [],
- "execution_count": null
+ ]
},
{
"cell_type": "code",
+ "execution_count": null,
"id": "15",
"metadata": {},
+ "outputs": [],
"source": [
"flow_system.statistics.plot.balance('Electricity')"
- ],
- "outputs": [],
- "execution_count": null
+ ]
},
{
"cell_type": "code",
+ "execution_count": null,
"id": "16",
"metadata": {},
+ "outputs": [],
"source": [
"# Compare electricity consumption vs heat output using xarray for alignment\n",
"# Create dataset with solution and input data - xarray auto-aligns by time coordinate\n",
@@ -251,9 +279,7 @@
" title='Actual Operating COP vs Outdoor Temperature',\n",
" labels={'x': 'Outdoor Temperature [°C]', 'y': 'Operating COP'},\n",
")"
- ],
- "outputs": [],
- "execution_count": null
+ ]
},
{
"cell_type": "markdown",
diff --git a/docs/notebooks/06b-piecewise-conversion.ipynb b/docs/notebooks/06b-piecewise-conversion.ipynb
index 6493a843c..aa0ab7a89 100644
--- a/docs/notebooks/06b-piecewise-conversion.ipynb
+++ b/docs/notebooks/06b-piecewise-conversion.ipynb
@@ -14,26 +14,10 @@
},
{
"cell_type": "code",
- "execution_count": 1,
+ "execution_count": null,
"id": "1",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T13:46:20.634505Z",
- "start_time": "2025-12-13T13:46:16.763911Z"
- }
- },
- "outputs": [
- {
- "data": {
- "text/plain": [
- "flixopt.config.CONFIG"
- ]
- },
- "execution_count": 1,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
+ "metadata": {},
+ "outputs": [],
"source": [
"import numpy as np\n",
"import pandas as pd\n",
@@ -73,14 +57,9 @@
},
{
"cell_type": "code",
- "execution_count": 2,
+ "execution_count": null,
"id": "4",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T13:46:20.692018Z",
- "start_time": "2025-12-13T13:46:20.688366Z"
- }
- },
+ "metadata": {},
"outputs": [],
"source": [
"piecewise_efficiency = fx.PiecewiseConversion(\n",
@@ -113,107 +92,10 @@
},
{
"cell_type": "code",
- "execution_count": 3,
+ "execution_count": null,
"id": "6",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T13:46:21.272711Z",
- "start_time": "2025-12-13T13:46:20.704350Z"
- }
- },
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Running HiGHS 1.12.0 (git hash: 755a8e0): Copyright (c) 2025 HiGHS under MIT licence terms\n",
- "MIP linopy-problem-0haogvbp has 298 rows; 394 cols; 1070 nonzeros; 72 integer variables (72 binary)\n",
- "Coefficient ranges:\n",
- " Matrix [5e-02, 2e+02]\n",
- " Cost [1e+00, 1e+00]\n",
- " Bound [1e+00, 3e+02]\n",
- " RHS [1e+00, 1e+00]\n",
- "Presolving model\n",
- "168 rows, 240 cols, 672 nonzeros 0s\n",
- "119 rows, 214 cols, 428 nonzeros 0s\n",
- "97 rows, 60 cols, 115 nonzeros 0s\n",
- "6 rows, 10 cols, 20 nonzeros 0s\n",
- "Presolve reductions: rows 6(-292); columns 10(-384); nonzeros 20(-1050) \n",
- "\n",
- "Solving MIP model with:\n",
- " 6 rows\n",
- " 10 cols (2 binary, 0 integer, 0 implied int., 8 continuous, 0 domain fixed)\n",
- " 20 nonzeros\n",
- "\n",
- "Src: B => Branching; C => Central rounding; F => Feasibility pump; H => Heuristic;\n",
- " I => Shifting; J => Feasibility jump; L => Sub-MIP; P => Empty MIP; R => Randomized rounding;\n",
- " S => Solve LP; T => Evaluate node; U => Unbounded; X => User solution; Y => HiGHS solution;\n",
- " Z => ZI Round; l => Trivial lower; p => Trivial point; u => Trivial upper; z => Trivial zero\n",
- "\n",
- " Nodes | B&B Tree | Objective Bounds | Dynamic Constraints | Work \n",
- "Src Proc. InQueue | Leaves Expl. | BestBound BestSol Gap | Cuts InLp Confl. | LpIters Time\n",
- "\n",
- " J 0 0 0 100.00% -inf 182.9596783 Large 0 0 0 0 0.0s\n",
- " 1 0 1 100.00% 182.9596783 182.9596783 0.00% 0 0 0 0 0.0s\n",
- "\n",
- "Solving report\n",
- " Model linopy-problem-0haogvbp\n",
- " Status Optimal\n",
- " Primal bound 182.959678343\n",
- " Dual bound 182.959678343\n",
- " Gap 0% (tolerance: 1%)\n",
- " P-D integral 0\n",
- " Solution status feasible\n",
- " 182.959678343 (objective)\n",
- " 0 (bound viol.)\n",
- " 0 (int. viol.)\n",
- " 0 (row viol.)\n",
- " Timing 0.01\n",
- " Max sub-MIP depth 0\n",
- " Nodes 1\n",
- " Repair LPs 0\n",
- " LP iterations 0\n"
- ]
- },
- {
- "data": {
- "text/plain": [
- "FlowSystem\n",
- "==========\n",
- "Timesteps: 24 (Hour) [2024-01-22 to 2024-01-22]\n",
- "Periods: None\n",
- "Scenarios: None\n",
- "Status: ✓\n",
- "\n",
- "Components (3 items)\n",
- "--------------------\n",
- " * GasEngine\n",
- " * GasGrid\n",
- " * Load\n",
- "\n",
- "Buses (2 items)\n",
- "---------------\n",
- " * Electricity\n",
- " * Gas\n",
- "\n",
- "Effects (2 items)\n",
- "-----------------\n",
- " * costs\n",
- " * Penalty\n",
- "\n",
- "Flows (4 items)\n",
- "---------------\n",
- " * GasEngine(Elec)\n",
- " * GasEngine(Fuel)\n",
- " * GasGrid(Gas)\n",
- " * Load(Elec)"
- ]
- },
- "execution_count": 3,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
+ "metadata": {},
+ "outputs": [],
"source": [
"timesteps = pd.date_range('2024-01-22', periods=24, freq='h')\n",
"\n",
@@ -235,7 +117,7 @@
" fx.Sink('Load', inputs=[fx.Flow('Elec', bus='Electricity', size=1, fixed_relative_profile=elec_demand)]),\n",
")\n",
"\n",
- "fs.optimize(fx.solvers.HighsSolver())"
+ "fs.optimize(fx.solvers.HighsSolver());"
]
},
{
@@ -248,3950 +130,10 @@
},
{
"cell_type": "code",
- "execution_count": 4,
+ "execution_count": null,
"id": "8",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T13:46:21.384359Z",
- "start_time": "2025-12-13T13:46:21.288290Z"
- }
- },
- "outputs": [
- {
- "data": {
- "text/html": [
- " \n",
- " \n",
- " "
- ]
- },
- "jetTransient": {
- "display_id": null
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "data": {
- "text/html": [
- "
"
- ]
- },
- "jetTransient": {
- "display_id": null
- },
- "metadata": {},
- "output_type": "display_data"
- }
- ],
+ "metadata": {},
+ "outputs": [],
"source": [
"fs.components['GasEngine'].piecewise_conversion.plot(x_flow='Fuel')"
]
@@ -4206,119 +148,20 @@
},
{
"cell_type": "code",
- "execution_count": 5,
+ "execution_count": null,
"id": "10",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T13:46:22.068940Z",
- "start_time": "2025-12-13T13:46:21.920317Z"
- }
- },
- "outputs": [
- {
- "data": {
- "text/html": [
- ""
- ],
- "text/plain": [
- "PlotResult(data= Size: 600B\n",
- "Dimensions: (time: 25)\n",
- "Coordinates:\n",
- " * time (time) datetime64[ns] 200B 2024-01-22 ... 2024-01-23\n",
- "Data variables:\n",
- " GasEngine(Elec) (time) float64 200B -60.0 -67.76 -75.0 ... -45.0 -52.24 nan\n",
- " Load(Elec) (time) float64 200B 60.0 67.76 75.0 ... 45.0 52.24 nan, figure=Figure({\n",
- " 'data': [{'hovertemplate': 'variable=GasEngine(Elec)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'GasEngine(Elec)',\n",
- " 'marker': {'color': '#EF553B', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'GasEngine(Elec)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-22T00:00:00.000000000', '2024-01-22T01:00:00.000000000',\n",
- " '2024-01-22T02:00:00.000000000', '2024-01-22T03:00:00.000000000',\n",
- " '2024-01-22T04:00:00.000000000', '2024-01-22T05:00:00.000000000',\n",
- " '2024-01-22T06:00:00.000000000', '2024-01-22T07:00:00.000000000',\n",
- " '2024-01-22T08:00:00.000000000', '2024-01-22T09:00:00.000000000',\n",
- " '2024-01-22T10:00:00.000000000', '2024-01-22T11:00:00.000000000',\n",
- " '2024-01-22T12:00:00.000000000', '2024-01-22T13:00:00.000000000',\n",
- " '2024-01-22T14:00:00.000000000', '2024-01-22T15:00:00.000000000',\n",
- " '2024-01-22T16:00:00.000000000', '2024-01-22T17:00:00.000000000',\n",
- " '2024-01-22T18:00:00.000000000', '2024-01-22T19:00:00.000000000',\n",
- " '2024-01-22T20:00:00.000000000', '2024-01-22T21:00:00.000000000',\n",
- " '2024-01-22T22:00:00.000000000', '2024-01-22T23:00:00.000000000',\n",
- " '2024-01-23T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('AAAAAAAATsDFOq+87vBQwAAAAAAAwF' ... '///39GwHOKoYYiHkrAAAAAAAAA+P8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'variable=Load(Elec)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'Load(Elec)',\n",
- " 'marker': {'color': '#00CC96', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'Load(Elec)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-22T00:00:00.000000000', '2024-01-22T01:00:00.000000000',\n",
- " '2024-01-22T02:00:00.000000000', '2024-01-22T03:00:00.000000000',\n",
- " '2024-01-22T04:00:00.000000000', '2024-01-22T05:00:00.000000000',\n",
- " '2024-01-22T06:00:00.000000000', '2024-01-22T07:00:00.000000000',\n",
- " '2024-01-22T08:00:00.000000000', '2024-01-22T09:00:00.000000000',\n",
- " '2024-01-22T10:00:00.000000000', '2024-01-22T11:00:00.000000000',\n",
- " '2024-01-22T12:00:00.000000000', '2024-01-22T13:00:00.000000000',\n",
- " '2024-01-22T14:00:00.000000000', '2024-01-22T15:00:00.000000000',\n",
- " '2024-01-22T16:00:00.000000000', '2024-01-22T17:00:00.000000000',\n",
- " '2024-01-22T18:00:00.000000000', '2024-01-22T19:00:00.000000000',\n",
- " '2024-01-22T20:00:00.000000000', '2024-01-22T21:00:00.000000000',\n",
- " '2024-01-22T22:00:00.000000000', '2024-01-22T23:00:00.000000000',\n",
- " '2024-01-23T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('AAAAAAAATkDFOq+87vBQQAAAAAAAwF' ... '///39GQHOKoYYiHkpAAAAAAAAA+H8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'}],\n",
- " 'layout': {'bargap': 0,\n",
- " 'bargroupgap': 0,\n",
- " 'barmode': 'relative',\n",
- " 'legend': {'title': {'text': 'variable'}, 'tracegroupgap': 0},\n",
- " 'template': '...',\n",
- " 'title': {'text': 'Electricity (flow_rate)'},\n",
- " 'xaxis': {'anchor': 'y', 'domain': [0.0, 1.0], 'title': {'text': 'time'}},\n",
- " 'yaxis': {'anchor': 'x', 'domain': [0.0, 1.0], 'title': {'text': 'value'}}}\n",
- "}))"
- ]
- },
- "execution_count": 5,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
+ "metadata": {},
+ "outputs": [],
"source": [
"fs.statistics.plot.balance('Electricity')"
]
},
{
"cell_type": "code",
- "execution_count": 6,
+ "execution_count": null,
"id": "11",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T13:46:22.102836Z",
- "start_time": "2025-12-13T13:46:22.085158Z"
- }
- },
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Efficiency range: 33.8% - 41.9%\n",
- "Total cost: 182.96 €\n"
- ]
- }
- ],
+ "metadata": {},
+ "outputs": [],
"source": [
"# Verify efficiency varies with load\n",
"fuel = fs.solution['GasEngine(Fuel)|flow_rate']\n",
diff --git a/docs/notebooks/06c-piecewise-effects.ipynb b/docs/notebooks/06c-piecewise-effects.ipynb
index 8f44b9cf2..3d7972b1c 100644
--- a/docs/notebooks/06c-piecewise-effects.ipynb
+++ b/docs/notebooks/06c-piecewise-effects.ipynb
@@ -17,26 +17,10 @@
},
{
"cell_type": "code",
- "execution_count": 1,
+ "execution_count": null,
"id": "1",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T09:37:05.842524Z",
- "start_time": "2025-12-13T09:37:01.302972Z"
- }
- },
- "outputs": [
- {
- "data": {
- "text/plain": [
- "flixopt.config.CONFIG"
- ]
- },
- "execution_count": 1,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
+ "metadata": {},
+ "outputs": [],
"source": [
"import numpy as np\n",
"import pandas as pd\n",
@@ -78,26 +62,10 @@
},
{
"cell_type": "code",
- "execution_count": 2,
+ "execution_count": null,
"id": "4",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T09:37:05.891430Z",
- "start_time": "2025-12-13T09:37:05.883541Z"
- }
- },
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Available size tiers:\n",
- " Small: 50-100 kWh at 0.20 €/kWh\n",
- " Medium: 200-400 kWh at 0.12 €/kWh\n",
- " Large: 500-800 kWh at 0.06 €/kWh\n"
- ]
- }
- ],
+ "metadata": {},
+ "outputs": [],
"source": [
"# Piecewise costs with gaps between tiers\n",
"# Cost values are CUMULATIVE at each breakpoint\n",
@@ -128,14 +96,9 @@
},
{
"cell_type": "code",
- "execution_count": 3,
- "id": "8",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T09:37:05.919885Z",
- "start_time": "2025-12-13T09:37:05.915254Z"
- }
- },
+ "execution_count": null,
+ "id": "5",
+ "metadata": {},
"outputs": [],
"source": [
"timesteps = pd.date_range('2024-01-01', periods=24, freq='h')\n",
@@ -175,7 +138,7 @@
},
{
"cell_type": "markdown",
- "id": "120b3beb025756ef",
+ "id": "6",
"metadata": {},
"source": [
"## Simple Arbitrage Scenario\n",
@@ -185,7 +148,7 @@
},
{
"cell_type": "markdown",
- "id": "9",
+ "id": "7",
"metadata": {},
"source": [
"## Build and Solve the Model"
@@ -193,110 +156,10 @@
},
{
"cell_type": "code",
- "execution_count": 4,
- "id": "10",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T09:37:07.048599Z",
- "start_time": "2025-12-13T09:37:05.935256Z"
- }
- },
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Running HiGHS 1.12.0 (git hash: 755a8e0): Copyright (c) 2025 HiGHS under MIT licence terms\n",
- "MIP linopy-problem-wrb0ote0 has 437 rows; 294 cols; 1098 nonzeros; 54 integer variables (54 binary)\n",
- "Coefficient ranges:\n",
- " Matrix [1e-05, 8e+02]\n",
- " Cost [1e+00, 1e+00]\n",
- " Bound [1e+00, 8e+02]\n",
- " RHS [1e+00, 1e+00]\n",
- "Presolving model\n",
- "253 rows, 159 cols, 588 nonzeros 0s\n",
- "152 rows, 107 cols, 504 nonzeros 0s\n",
- "151 rows, 107 cols, 500 nonzeros 0s\n",
- "Presolve reductions: rows 151(-286); columns 107(-187); nonzeros 500(-598) \n",
- "\n",
- "Solving MIP model with:\n",
- " 151 rows\n",
- " 107 cols (52 binary, 0 integer, 0 implied int., 55 continuous, 0 domain fixed)\n",
- " 500 nonzeros\n",
- "\n",
- "Src: B => Branching; C => Central rounding; F => Feasibility pump; H => Heuristic;\n",
- " I => Shifting; J => Feasibility jump; L => Sub-MIP; P => Empty MIP; R => Randomized rounding;\n",
- " S => Solve LP; T => Evaluate node; U => Unbounded; X => User solution; Y => HiGHS solution;\n",
- " Z => ZI Round; l => Trivial lower; p => Trivial point; u => Trivial upper; z => Trivial zero\n",
- "\n",
- " Nodes | B&B Tree | Objective Bounds | Dynamic Constraints | Work \n",
- "Src Proc. InQueue | Leaves Expl. | BestBound BestSol Gap | Cuts InLp Confl. | LpIters Time\n",
- "\n",
- " J 0 0 0 0.00% -inf 359 Large 0 0 0 0 0.0s\n",
- " 0 0 0 0.00% 248.9944598 359 30.64% 0 0 0 62 0.0s\n",
- " L 0 0 0 0.00% 248.9944598 248.9944598 0.00% 32 11 0 73 0.0s\n",
- " 1 0 1 100.00% 248.9944598 248.9944598 0.00% 32 11 0 82 0.0s\n",
- "\n",
- "Solving report\n",
- " Model linopy-problem-wrb0ote0\n",
- " Status Optimal\n",
- " Primal bound 248.994459834\n",
- " Dual bound 248.994459834\n",
- " Gap 0% (tolerance: 1%)\n",
- " P-D integral 0.00660979209716\n",
- " Solution status feasible\n",
- " 248.994459834 (objective)\n",
- " 0 (bound viol.)\n",
- " 6.43929354283e-15 (int. viol.)\n",
- " 0 (row viol.)\n",
- " Timing 0.03\n",
- " Max sub-MIP depth 1\n",
- " Nodes 1\n",
- " Repair LPs 0\n",
- " LP iterations 82\n",
- " 0 (strong br.)\n",
- " 11 (separation)\n",
- " 9 (heuristics)\n"
- ]
- },
- {
- "data": {
- "text/plain": [
- "FlowSystem\n",
- "==========\n",
- "Timesteps: 24 (Hour) [2024-01-01 to 2024-01-01]\n",
- "Periods: None\n",
- "Scenarios: None\n",
- "Status: ✓\n",
- "\n",
- "Components (3 items)\n",
- "--------------------\n",
- " * Battery\n",
- " * Demand\n",
- " * Grid\n",
- "\n",
- "Buses (1 item)\n",
- "--------------\n",
- " * Elec\n",
- "\n",
- "Effects (2 items)\n",
- "-----------------\n",
- " * costs\n",
- " * Penalty\n",
- "\n",
- "Flows (4 items)\n",
- "---------------\n",
- " * Battery(charge)\n",
- " * Battery(discharge)\n",
- " * Demand(Elec)\n",
- " * Grid(Elec)"
- ]
- },
- "execution_count": 4,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
+ "execution_count": null,
+ "id": "8",
+ "metadata": {},
+ "outputs": [],
"source": [
"fs = fx.FlowSystem(timesteps)\n",
"\n",
@@ -322,12 +185,12 @@
" fx.Sink('Demand', inputs=[fx.Flow('Elec', bus='Elec', size=1, fixed_relative_profile=demand)]),\n",
")\n",
"\n",
- "fs.optimize(fx.solvers.HighsSolver())"
+ "fs.optimize(fx.solvers.HighsSolver());"
]
},
{
"cell_type": "markdown",
- "id": "be5dc58de4a3c809",
+ "id": "9",
"metadata": {},
"source": [
"## Visualize the Cost Curve\n",
@@ -344,3981 +207,28 @@
},
{
"cell_type": "code",
- "execution_count": 5,
- "id": "c734d019ece6c6fe",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T09:37:07.301104Z",
- "start_time": "2025-12-13T09:37:07.136275Z"
- }
- },
- "outputs": [
- {
- "data": {
- "text/html": [
- " \n",
- " \n",
- " "
- ]
- },
- "jetTransient": {
- "display_id": null
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "data": {
- "text/html": [
- ""
- ]
- },
- "jetTransient": {
- "display_id": null
- },
- "metadata": {},
- "output_type": "display_data"
- }
- ],
+ "execution_count": null,
+ "id": "10",
+ "metadata": {},
+ "outputs": [],
"source": [
"piecewise_costs.plot(title='Battery Investment Cost (Discrete Tiers)')"
]
},
{
"cell_type": "markdown",
- "id": "39b4ec726d6d43c1",
+ "id": "11",
"metadata": {},
- "source": "## Results: Which Tier Was Selected?"
+ "source": [
+ "## Results: Which Tier Was Selected?"
+ ]
},
{
"cell_type": "code",
- "execution_count": 6,
+ "execution_count": null,
"id": "12",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T09:37:08.189381Z",
- "start_time": "2025-12-13T09:37:08.142348Z"
- }
- },
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Selected tier: Large (500-800 kWh)\n",
- "Battery size: 800 kWh\n",
- "Total cost: 249.0 €\n"
- ]
- }
- ],
+ "metadata": {},
+ "outputs": [],
"source": [
"battery_size = fs.solution['Battery|size'].item()\n",
"total_cost = fs.solution['costs'].item()\n",
@@ -4348,147 +258,10 @@
},
{
"cell_type": "code",
- "execution_count": 7,
+ "execution_count": null,
"id": "14",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T09:37:08.407306Z",
- "start_time": "2025-12-13T09:37:08.263634Z"
- }
- },
- "outputs": [
- {
- "data": {
- "text/html": [
- ""
- ],
- "text/plain": [
- "PlotResult(data= Size: 1kB\n",
- "Dimensions: (time: 25)\n",
- "Coordinates:\n",
- " * time (time) datetime64[ns] 200B 2024-01-01 ... 2024-01-02\n",
- "Data variables:\n",
- " Grid(Elec) (time) float64 200B -100.0 -100.0 -100.0 ... -100.0 nan\n",
- " Battery(discharge) (time) float64 200B -0.0 -7.267e-14 ... 1.243e-13 nan\n",
- " Battery(charge) (time) float64 200B 0.0 4.425e-14 ... -1.385e-13 nan\n",
- " Demand(Elec) (time) float64 200B 100.0 100.0 100.0 ... 100.0 nan, figure=Figure({\n",
- " 'data': [{'hovertemplate': 'variable=Grid(Elec)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'Grid(Elec)',\n",
- " 'marker': {'color': '#636EFA', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'Grid(Elec)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-01T00:00:00.000000000', '2024-01-01T01:00:00.000000000',\n",
- " '2024-01-01T02:00:00.000000000', '2024-01-01T03:00:00.000000000',\n",
- " '2024-01-01T04:00:00.000000000', '2024-01-01T05:00:00.000000000',\n",
- " '2024-01-01T06:00:00.000000000', '2024-01-01T07:00:00.000000000',\n",
- " '2024-01-01T08:00:00.000000000', '2024-01-01T09:00:00.000000000',\n",
- " '2024-01-01T10:00:00.000000000', '2024-01-01T11:00:00.000000000',\n",
- " '2024-01-01T12:00:00.000000000', '2024-01-01T13:00:00.000000000',\n",
- " '2024-01-01T14:00:00.000000000', '2024-01-01T15:00:00.000000000',\n",
- " '2024-01-01T16:00:00.000000000', '2024-01-01T17:00:00.000000000',\n",
- " '2024-01-01T18:00:00.000000000', '2024-01-01T19:00:00.000000000',\n",
- " '2024-01-01T20:00:00.000000000', '2024-01-01T21:00:00.000000000',\n",
- " '2024-01-01T22:00:00.000000000', '2024-01-01T23:00:00.000000000',\n",
- " '2024-01-02T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('AAAAAAAAWcD+//////9YwPD//////1' ... '////9YwP///////1jAAAAAAAAA+P8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'variable=Battery(discharge)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'Battery(discharge)',\n",
- " 'marker': {'color': '#EF553B', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'Battery(discharge)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-01T00:00:00.000000000', '2024-01-01T01:00:00.000000000',\n",
- " '2024-01-01T02:00:00.000000000', '2024-01-01T03:00:00.000000000',\n",
- " '2024-01-01T04:00:00.000000000', '2024-01-01T05:00:00.000000000',\n",
- " '2024-01-01T06:00:00.000000000', '2024-01-01T07:00:00.000000000',\n",
- " '2024-01-01T08:00:00.000000000', '2024-01-01T09:00:00.000000000',\n",
- " '2024-01-01T10:00:00.000000000', '2024-01-01T11:00:00.000000000',\n",
- " '2024-01-01T12:00:00.000000000', '2024-01-01T13:00:00.000000000',\n",
- " '2024-01-01T14:00:00.000000000', '2024-01-01T15:00:00.000000000',\n",
- " '2024-01-01T16:00:00.000000000', '2024-01-01T17:00:00.000000000',\n",
- " '2024-01-01T18:00:00.000000000', '2024-01-01T19:00:00.000000000',\n",
- " '2024-01-01T20:00:00.000000000', '2024-01-01T21:00:00.000000000',\n",
- " '2024-01-01T22:00:00.000000000', '2024-01-01T23:00:00.000000000',\n",
- " '2024-01-02T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('AAAAAAAAAIDs2puCeHQ0vfWsvI9KlT' ... 'zLt3xBPcy3fMu3fEE9AAAAAAAA+P8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'variable=Battery(charge)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'Battery(charge)',\n",
- " 'marker': {'color': '#EF553B', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'Battery(charge)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-01T00:00:00.000000000', '2024-01-01T01:00:00.000000000',\n",
- " '2024-01-01T02:00:00.000000000', '2024-01-01T03:00:00.000000000',\n",
- " '2024-01-01T04:00:00.000000000', '2024-01-01T05:00:00.000000000',\n",
- " '2024-01-01T06:00:00.000000000', '2024-01-01T07:00:00.000000000',\n",
- " '2024-01-01T08:00:00.000000000', '2024-01-01T09:00:00.000000000',\n",
- " '2024-01-01T10:00:00.000000000', '2024-01-01T11:00:00.000000000',\n",
- " '2024-01-01T12:00:00.000000000', '2024-01-01T13:00:00.000000000',\n",
- " '2024-01-01T14:00:00.000000000', '2024-01-01T15:00:00.000000000',\n",
- " '2024-01-01T16:00:00.000000000', '2024-01-01T17:00:00.000000000',\n",
- " '2024-01-01T18:00:00.000000000', '2024-01-01T19:00:00.000000000',\n",
- " '2024-01-01T20:00:00.000000000', '2024-01-01T21:00:00.000000000',\n",
- " '2024-01-01T22:00:00.000000000', '2024-01-01T23:00:00.000000000',\n",
- " '2024-01-02T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('AAAAAAAAAADZtTcF8egoPT0r76NS5V' ... 'zLt3xDvcy3fMu3fEO9AAAAAAAA+H8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'variable=Demand(Elec)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'Demand(Elec)',\n",
- " 'marker': {'color': '#00CC96', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'Demand(Elec)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-01T00:00:00.000000000', '2024-01-01T01:00:00.000000000',\n",
- " '2024-01-01T02:00:00.000000000', '2024-01-01T03:00:00.000000000',\n",
- " '2024-01-01T04:00:00.000000000', '2024-01-01T05:00:00.000000000',\n",
- " '2024-01-01T06:00:00.000000000', '2024-01-01T07:00:00.000000000',\n",
- " '2024-01-01T08:00:00.000000000', '2024-01-01T09:00:00.000000000',\n",
- " '2024-01-01T10:00:00.000000000', '2024-01-01T11:00:00.000000000',\n",
- " '2024-01-01T12:00:00.000000000', '2024-01-01T13:00:00.000000000',\n",
- " '2024-01-01T14:00:00.000000000', '2024-01-01T15:00:00.000000000',\n",
- " '2024-01-01T16:00:00.000000000', '2024-01-01T17:00:00.000000000',\n",
- " '2024-01-01T18:00:00.000000000', '2024-01-01T19:00:00.000000000',\n",
- " '2024-01-01T20:00:00.000000000', '2024-01-01T21:00:00.000000000',\n",
- " '2024-01-01T22:00:00.000000000', '2024-01-01T23:00:00.000000000',\n",
- " '2024-01-02T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('AAAAAAAAWUAAAAAAAABZQAAAAAAAAF' ... 'AAAABZQAAAAAAAAFlAAAAAAAAA+H8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'}],\n",
- " 'layout': {'bargap': 0,\n",
- " 'bargroupgap': 0,\n",
- " 'barmode': 'relative',\n",
- " 'legend': {'title': {'text': 'variable'}, 'tracegroupgap': 0},\n",
- " 'template': '...',\n",
- " 'title': {'text': 'Elec (flow_rate)'},\n",
- " 'xaxis': {'anchor': 'y', 'domain': [0.0, 1.0], 'title': {'text': 'time'}},\n",
- " 'yaxis': {'anchor': 'x', 'domain': [0.0, 1.0], 'title': {'text': 'value'}}}\n",
- "}))"
- ]
- },
- "execution_count": 7,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
+ "metadata": {},
+ "outputs": [],
"source": [
"fs.statistics.plot.balance('Elec')"
]
@@ -4525,7 +298,11 @@
"cell_type": "markdown",
"id": "16",
"metadata": {},
- "source": "## Previous: Piecewise Conversion\n\nSee **[06b-piecewise-conversion](06b-piecewise-conversion.ipynb)** for modeling minimum load constraints with `PiecewiseConversion` + `StatusParameters`."
+ "source": [
+ "## Previous: Piecewise Conversion\n",
+ "\n",
+ "See **[06b-piecewise-conversion](06b-piecewise-conversion.ipynb)** for modeling minimum load constraints with `PiecewiseConversion` + `StatusParameters`."
+ ]
}
],
"metadata": {
diff --git a/docs/notebooks/07-scenarios-and-periods.ipynb b/docs/notebooks/07-scenarios-and-periods.ipynb
index 27dfdce70..db74afefb 100644
--- a/docs/notebooks/07-scenarios-and-periods.ipynb
+++ b/docs/notebooks/07-scenarios-and-periods.ipynb
@@ -4,7 +4,18 @@
"cell_type": "markdown",
"id": "0",
"metadata": {},
- "source": "# Scenarios\n\nMulti-year planning with uncertain demand scenarios.\n\nThis notebook introduces:\n\n- **Periods**: Multiple planning years with different conditions\n- **Scenarios**: Uncertain futures (mild vs. harsh winter)\n- **Scenario weights**: Probability-weighted optimization\n- **Multi-dimensional data**: Parameters that vary by time, period, and scenario"
+ "source": [
+ "# Scenarios\n",
+ "\n",
+ "Multi-year planning with uncertain demand scenarios.\n",
+ "\n",
+ "This notebook introduces:\n",
+ "\n",
+ "- **Periods**: Multiple planning years with different conditions\n",
+ "- **Scenarios**: Uncertain futures (mild vs. harsh winter)\n",
+ "- **Scenario weights**: Probability-weighted optimization\n",
+ "- **Multi-dimensional data**: Parameters that vary by time, period, and scenario"
+ ]
},
{
"cell_type": "markdown",
@@ -198,7 +209,21 @@
"id": "12",
"metadata": {},
"outputs": [],
- "source": "flow_system = fx.FlowSystem(\n timesteps=timesteps,\n periods=periods,\n scenarios=scenarios,\n scenario_weights=scenario_weights,\n)\nflow_system.add_carriers(\n fx.Carrier('gas', '#3498db', 'kW'),\n fx.Carrier('electricity', '#f1c40f', 'kW'),\n fx.Carrier('heat', '#e74c3c', 'kW'),\n)\n\nprint(flow_system)"
+ "source": [
+ "flow_system = fx.FlowSystem(\n",
+ " timesteps=timesteps,\n",
+ " periods=periods,\n",
+ " scenarios=scenarios,\n",
+ " scenario_weights=scenario_weights,\n",
+ ")\n",
+ "flow_system.add_carriers(\n",
+ " fx.Carrier('gas', '#3498db', 'kW'),\n",
+ " fx.Carrier('electricity', '#f1c40f', 'kW'),\n",
+ " fx.Carrier('heat', '#e74c3c', 'kW'),\n",
+ ")\n",
+ "\n",
+ "print(flow_system)"
+ ]
},
{
"cell_type": "markdown",
@@ -246,9 +271,8 @@
" size=fx.InvestParameters(\n",
" minimum_size=0,\n",
" maximum_size=100,\n",
- " effects_of_investment_per_size={'costs': 50}, # 50 €/kW annualized\n",
+ " effects_of_investment_per_size={'costs': 15}, # 15 €/kW/week annualized\n",
" ),\n",
- " relative_minimum=0.3,\n",
" ),\n",
" thermal_flow=fx.Flow('Q_th', bus='Heat'),\n",
" fuel_flow=fx.Flow('Q_fuel', bus='Gas'),\n",
@@ -325,10 +349,8 @@
"chp_size = flow_system.statistics.sizes['CHP(P_el)']\n",
"total_cost = flow_system.solution['costs']\n",
"\n",
- "print('=== Investment Decision ===')\n",
- "print(f'Optimal CHP size: {chp_size.round(1).to_pandas()} kW electrical')\n",
- "print(f'Thermal capacity: {(chp_size * 0.50 / 0.35).round(1).to_pandas()} kW')\n",
- "print(f'\\nExpected total cost: {total_cost.round(2).to_pandas()} €')"
+ "print(f'Optimal CHP: {float(chp_size.max()):.0f} kW electrical ({float(chp_size.max()) * 0.50 / 0.35:.0f} kW thermal)')\n",
+ "print(f'Expected cost: {float(total_cost.sum()):.0f} €')"
]
},
{
@@ -401,16 +423,13 @@
"metadata": {},
"outputs": [],
"source": [
- "# CHP operation in harsh winter vs mild winter\n",
+ "# CHP operation summary by scenario\n",
"chp_heat = flow_rates['CHP(Q_th)']\n",
"\n",
- "print('CHP Heat Output Statistics:')\n",
"for scenario in scenarios:\n",
- " scenario_data = chp_heat.sel(scenario=scenario)\n",
- " print(f'\\n{scenario}:')\n",
- " for period in periods:\n",
- " period_data = scenario_data.sel(period=period)\n",
- " print(f' {period}: avg={period_data.mean().item():.1f} kW, max={period_data.max().item():.1f} kW')"
+ " scenario_avg = float(chp_heat.sel(scenario=scenario).mean())\n",
+ " scenario_max = float(chp_heat.sel(scenario=scenario).max())\n",
+ " print(f'{scenario}: avg {scenario_avg:.0f} kW, max {scenario_max:.0f} kW')"
]
},
{
@@ -434,12 +453,12 @@
"fs_mild = flow_system.transform.sel(scenario='Mild Winter')\n",
"fs_mild.optimize(fx.solvers.HighsSolver(mip_gap=0.01))\n",
"\n",
- "chp_size_mild = fs_mild.statistics.sizes['CHP(P_el)']\n",
+ "chp_size_mild = float(fs_mild.statistics.sizes['CHP(P_el)'].max())\n",
+ "chp_size_both = float(chp_size.max())\n",
"\n",
- "print('=== Comparison ===')\n",
- "print(f'CHP size (both scenarios): {chp_size.max(\"scenario\").round(2).values} kW')\n",
- "print(f'CHP size (mild only): {chp_size_mild.round(2).values} kW')\n",
- "print(f'\\nPlanning for uncertainty adds {(chp_size - chp_size_mild).round(2).values} kW capacity')"
+ "print(\n",
+ " f'CHP sizing: {chp_size_mild:.0f} kW (mild only) vs {chp_size_both:.0f} kW (both scenarios) → +{chp_size_both - chp_size_mild:.0f} kW for uncertainty'\n",
+ ")"
]
},
{
@@ -466,7 +485,65 @@
"cell_type": "markdown",
"id": "30",
"metadata": {},
- "source": "## Key Concepts\n\n### Multi-Dimensional FlowSystem\n\n```python\nflow_system = fx.FlowSystem(\n timesteps=timesteps, # Time dimension\n periods=periods, # Planning periods (years)\n scenarios=scenarios, # Uncertain futures\n scenario_weights=weights, # Probabilities\n)\n```\n\n### Dimension-Varying Parameters\n\n| Data Shape | Meaning |\n|------------|----------|\n| Scalar | Same for all time/period/scenario |\n| Array (n_periods,) | Varies by period |\n| Array (n_scenarios,) | Varies by scenario |\n| DataFrame with columns | Columns match scenario names |\n| Full array (time, period, scenario) | Full specification |\n\n### Scenario Optimization\n\nThe optimizer minimizes **expected cost**:\n$$\\min \\sum_s w_s \\cdot \\text{Cost}_s$$\n\nwhere $w_s$ is the scenario weight (probability).\n\n### Selection Methods\n\n```python\n# Select specific scenario\nfs_mild = flow_system.transform.sel(scenario='Mild Winter')\n\n# Select specific period\nfs_2025 = flow_system.transform.sel(period=2025)\n\n# Select time range\nfs_day1 = flow_system.transform.sel(time=slice('2024-01-15', '2024-01-16'))\n```\n\n## Summary\n\nYou learned how to:\n\n- Define **multiple periods** for multi-year planning\n- Create **scenarios** for uncertain futures\n- Use **scenario weights** for probability-weighted optimization\n- Pass **dimension-varying parameters** (arrays and DataFrames)\n- **Select** specific scenarios or periods for analysis\n\n### Next Steps\n\n- **[08a-Aggregation](08a-aggregation.ipynb)**: Speed up large problems with resampling and clustering\n- **[08b-Rolling Horizon](08b-rolling-horizon.ipynb)**: Decompose large problems into sequential time segments"
+ "source": [
+ "## Key Concepts\n",
+ "\n",
+ "### Multi-Dimensional FlowSystem\n",
+ "\n",
+ "```python\n",
+ "flow_system = fx.FlowSystem(\n",
+ " timesteps=timesteps, # Time dimension\n",
+ " periods=periods, # Planning periods (years)\n",
+ " scenarios=scenarios, # Uncertain futures\n",
+ " scenario_weights=weights, # Probabilities\n",
+ ")\n",
+ "```\n",
+ "\n",
+ "### Dimension-Varying Parameters\n",
+ "\n",
+ "| Data Shape | Meaning |\n",
+ "|------------|----------|\n",
+ "| Scalar | Same for all time/period/scenario |\n",
+ "| Array (n_periods,) | Varies by period |\n",
+ "| Array (n_scenarios,) | Varies by scenario |\n",
+ "| DataFrame with columns | Columns match scenario names |\n",
+ "| Full array (time, period, scenario) | Full specification |\n",
+ "\n",
+ "### Scenario Optimization\n",
+ "\n",
+ "The optimizer minimizes **expected cost**:\n",
+ "$$\\min \\sum_s w_s \\cdot \\text{Cost}_s$$\n",
+ "\n",
+ "where $w_s$ is the scenario weight (probability).\n",
+ "\n",
+ "### Selection Methods\n",
+ "\n",
+ "```python\n",
+ "# Select specific scenario\n",
+ "fs_mild = flow_system.transform.sel(scenario='Mild Winter')\n",
+ "\n",
+ "# Select specific period\n",
+ "fs_2025 = flow_system.transform.sel(period=2025)\n",
+ "\n",
+ "# Select time range\n",
+ "fs_day1 = flow_system.transform.sel(time=slice('2024-01-15', '2024-01-16'))\n",
+ "```\n",
+ "\n",
+ "## Summary\n",
+ "\n",
+ "You learned how to:\n",
+ "\n",
+ "- Define **multiple periods** for multi-year planning\n",
+ "- Create **scenarios** for uncertain futures\n",
+ "- Use **scenario weights** for probability-weighted optimization\n",
+ "- Pass **dimension-varying parameters** (arrays and DataFrames)\n",
+ "- **Select** specific scenarios or periods for analysis\n",
+ "\n",
+ "### Next Steps\n",
+ "\n",
+ "- **[08a-Aggregation](08a-aggregation.ipynb)**: Speed up large problems with resampling and clustering\n",
+ "- **[08b-Rolling Horizon](08b-rolling-horizon.ipynb)**: Decompose large problems into sequential time segments"
+ ]
}
],
"metadata": {
@@ -476,8 +553,16 @@
"name": "python3"
},
"language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
"name": "python",
- "version": "3.11.0"
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.11.11"
}
},
"nbformat": 4,
diff --git a/docs/notebooks/08a-aggregation.ipynb b/docs/notebooks/08a-aggregation.ipynb
index 376dbdaca..d7b7576bb 100644
--- a/docs/notebooks/08a-aggregation.ipynb
+++ b/docs/notebooks/08a-aggregation.ipynb
@@ -4,7 +4,18 @@
"cell_type": "markdown",
"id": "0",
"metadata": {},
- "source": "# Aggregation\n\nSpeed up large problems with time series aggregation techniques.\n\nThis notebook introduces:\n\n- **Resampling**: Reduce time resolution (e.g., hourly → 4-hourly)\n- **Clustering**: Identify typical periods (e.g., 8 representative days)\n- **Two-stage optimization**: Size with reduced data, dispatch at full resolution\n- **Speed vs. accuracy trade-offs**: When to use each technique"
+ "source": [
+ "# Aggregation\n",
+ "\n",
+ "Speed up large problems with time series aggregation techniques.\n",
+ "\n",
+ "This notebook introduces:\n",
+ "\n",
+ "- **Resampling**: Reduce time resolution (e.g., hourly → 4-hourly)\n",
+ "- **Clustering**: Identify typical periods (e.g., 8 representative days)\n",
+ "- **Two-stage optimization**: Size with reduced data, dispatch at full resolution\n",
+ "- **Speed vs. accuracy trade-offs**: When to use each technique"
+ ]
},
{
"cell_type": "markdown",
@@ -36,7 +47,11 @@
"cell_type": "markdown",
"id": "3",
"metadata": {},
- "source": "## Load Time Series Data\n\nWe use real-world district heating data at 15-minute resolution (one month):"
+ "source": [
+ "## Load Time Series Data\n",
+ "\n",
+ "We use real-world district heating data at 15-minute resolution (one month):"
+ ]
},
{
"cell_type": "code",
@@ -66,7 +81,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "6",
+ "id": "5",
"metadata": {},
"outputs": [],
"source": [
@@ -89,7 +104,7 @@
},
{
"cell_type": "markdown",
- "id": "7",
+ "id": "6",
"metadata": {},
"source": [
"## Build the Base FlowSystem\n",
@@ -100,7 +115,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "8",
+ "id": "7",
"metadata": {},
"outputs": [],
"source": [
@@ -131,7 +146,6 @@
" maximum_size=300,\n",
" effects_of_investment_per_size={'costs': 10},\n",
" ),\n",
- " relative_minimum=0.3,\n",
" ),\n",
" fuel_flow=fx.Flow('Q_fu', bus='Coal'),\n",
" ),\n",
@@ -147,7 +161,6 @@
" maximum_size=150,\n",
" effects_of_investment_per_size={'costs': 5},\n",
" ),\n",
- " relative_minimum=0.1,\n",
" ),\n",
" fuel_flow=fx.Flow('Q_fu', bus='Gas'),\n",
" ),\n",
@@ -207,7 +220,7 @@
},
{
"cell_type": "markdown",
- "id": "9",
+ "id": "8",
"metadata": {},
"source": [
"## Technique 1: Resampling\n",
@@ -218,24 +231,23 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "10",
+ "id": "9",
"metadata": {},
"outputs": [],
"source": [
"solver = fx.solvers.HighsSolver(mip_gap=0.01)\n",
"\n",
- "# Resample from 1h to 4h resolution\n",
+ "# Resample from 15min to 4h resolution\n",
"fs_resampled = flow_system.transform.resample('4h')\n",
"\n",
- "print(f'Original: {len(flow_system.timesteps)} timesteps')\n",
- "print(f'Resampled: {len(fs_resampled.timesteps)} timesteps')\n",
- "print(f'Reduction: {(1 - len(fs_resampled.timesteps) / len(flow_system.timesteps)) * 100:.0f}%')"
+ "reduction = (1 - len(fs_resampled.timesteps) / len(flow_system.timesteps)) * 100\n",
+ "print(f'Resampled: {len(flow_system.timesteps)} → {len(fs_resampled.timesteps)} timesteps ({reduction:.0f}% reduction)')"
]
},
{
"cell_type": "code",
"execution_count": null,
- "id": "11",
+ "id": "10",
"metadata": {},
"outputs": [],
"source": [
@@ -244,13 +256,12 @@
"fs_resampled.optimize(solver)\n",
"time_resampled = timeit.default_timer() - start\n",
"\n",
- "print(f'\\nResampled optimization: {time_resampled:.2f} seconds')\n",
- "print(f'Cost: {fs_resampled.solution[\"costs\"].item():.2f} €')"
+ "print(f'Resampled: {time_resampled:.1f}s, {fs_resampled.solution[\"costs\"].item():,.0f} €')"
]
},
{
"cell_type": "markdown",
- "id": "12",
+ "id": "11",
"metadata": {},
"source": [
"## Technique 2: Two-Stage Optimization\n",
@@ -262,7 +273,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "13",
+ "id": "12",
"metadata": {},
"outputs": [],
"source": [
@@ -272,17 +283,16 @@
"fs_sizing.optimize(solver)\n",
"time_stage1 = timeit.default_timer() - start\n",
"\n",
- "print('=== Stage 1: Sizing ===')\n",
- "print(f'Time: {time_stage1:.2f} seconds')\n",
- "print('\\nOptimized sizes:')\n",
- "for name, size in fs_sizing.statistics.sizes.items():\n",
- " print(f' {name}: {float(size.item()):.1f}')"
+ "sizes = {k: float(v.item()) for k, v in fs_sizing.statistics.sizes.items()}\n",
+ "print(\n",
+ " f'Stage 1 (sizing): {time_stage1:.1f}s → CHP {sizes[\"CHP(Q_th)\"]:.0f}, Boiler {sizes[\"Boiler(Q_th)\"]:.0f}, Storage {sizes[\"Storage\"]:.0f}'\n",
+ ")"
]
},
{
"cell_type": "code",
"execution_count": null,
- "id": "14",
+ "id": "13",
"metadata": {},
"outputs": [],
"source": [
@@ -292,15 +302,14 @@
"fs_dispatch.optimize(solver)\n",
"time_stage2 = timeit.default_timer() - start\n",
"\n",
- "print('=== Stage 2: Dispatch ===')\n",
- "print(f'Time: {time_stage2:.2f} seconds')\n",
- "print(f'Cost: {fs_dispatch.solution[\"costs\"].item():.2f} €')\n",
- "print(f'\\nTotal two-stage time: {time_stage1 + time_stage2:.2f} seconds')"
+ "print(\n",
+ " f'Stage 2 (dispatch): {time_stage2:.1f}s, {fs_dispatch.solution[\"costs\"].item():,.0f} € (total: {time_stage1 + time_stage2:.1f}s)'\n",
+ ")"
]
},
{
"cell_type": "markdown",
- "id": "15",
+ "id": "14",
"metadata": {},
"source": [
"## Technique 3: Full Optimization (Baseline)\n",
@@ -311,7 +320,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "16",
+ "id": "15",
"metadata": {},
"outputs": [],
"source": [
@@ -320,14 +329,12 @@
"fs_full.optimize(solver)\n",
"time_full = timeit.default_timer() - start\n",
"\n",
- "print('=== Full Optimization ===')\n",
- "print(f'Time: {time_full:.2f} seconds')\n",
- "print(f'Cost: {fs_full.solution[\"costs\"].item():.2f} €')"
+ "print(f'Full optimization: {time_full:.1f}s, {fs_full.solution[\"costs\"].item():,.0f} €')"
]
},
{
"cell_type": "markdown",
- "id": "17",
+ "id": "16",
"metadata": {},
"source": [
"## Compare Results"
@@ -336,7 +343,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "18",
+ "id": "17",
"metadata": {},
"outputs": [],
"source": [
@@ -388,7 +395,7 @@
},
{
"cell_type": "markdown",
- "id": "19",
+ "id": "18",
"metadata": {},
"source": [
"## Visual Comparison: Heat Balance"
@@ -397,7 +404,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "20",
+ "id": "19",
"metadata": {},
"outputs": [],
"source": [
@@ -408,7 +415,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "21",
+ "id": "20",
"metadata": {},
"outputs": [],
"source": [
@@ -418,7 +425,7 @@
},
{
"cell_type": "markdown",
- "id": "22",
+ "id": "21",
"metadata": {},
"source": [
"### Energy Flow Sankey (Full Optimization)\n",
@@ -429,7 +436,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "23",
+ "id": "22",
"metadata": {},
"outputs": [],
"source": [
@@ -438,7 +445,7 @@
},
{
"cell_type": "markdown",
- "id": "24",
+ "id": "23",
"metadata": {},
"source": [
"## When to Use Each Technique\n",
@@ -478,9 +485,34 @@
},
{
"cell_type": "markdown",
- "id": "25",
+ "id": "24",
"metadata": {},
- "source": "## Summary\n\nYou learned how to:\n\n- Use **`transform.resample()`** to reduce time resolution\n- Apply **two-stage optimization** for large investment problems\n- Use **`transform.fix_sizes()`** to lock in investment decisions\n- Compare **speed vs. accuracy** trade-offs\n\n### Key Takeaways\n\n1. **Start fast**: Use resampling for initial exploration\n2. **Iterate**: Refine with two-stage optimization\n3. **Validate**: Run full optimization for final results\n4. **Monitor**: Check cost gaps to ensure acceptable accuracy\n\n### Next Steps\n\n- **[08b-Rolling Horizon](08b-rolling-horizon.ipynb)**: For operational problems without investment decisions, decompose time into sequential segments\n\n### Further Reading\n\n- For clustering with typical periods, see `transform.cluster()` (requires `tsam` package)\n- For time selection, see `transform.sel()` and `transform.isel()`"
+ "source": [
+ "## Summary\n",
+ "\n",
+ "You learned how to:\n",
+ "\n",
+ "- Use **`transform.resample()`** to reduce time resolution\n",
+ "- Apply **two-stage optimization** for large investment problems\n",
+ "- Use **`transform.fix_sizes()`** to lock in investment decisions\n",
+ "- Compare **speed vs. accuracy** trade-offs\n",
+ "\n",
+ "### Key Takeaways\n",
+ "\n",
+ "1. **Start fast**: Use resampling for initial exploration\n",
+ "2. **Iterate**: Refine with two-stage optimization\n",
+ "3. **Validate**: Run full optimization for final results\n",
+ "4. **Monitor**: Check cost gaps to ensure acceptable accuracy\n",
+ "\n",
+ "### Next Steps\n",
+ "\n",
+ "- **[08b-Rolling Horizon](08b-rolling-horizon.ipynb)**: For operational problems without investment decisions, decompose time into sequential segments\n",
+ "\n",
+ "### Further Reading\n",
+ "\n",
+ "- For clustering with typical periods, see `transform.cluster()` (requires `tsam` package)\n",
+ "- For time selection, see `transform.sel()` and `transform.isel()`"
+ ]
}
],
"metadata": {
@@ -490,8 +522,16 @@
"name": "python3"
},
"language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
"name": "python",
- "version": "3.11.0"
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.11.11"
}
},
"nbformat": 4,
diff --git a/docs/notebooks/08b-rolling-horizon.ipynb b/docs/notebooks/08b-rolling-horizon.ipynb
index 94400ebf5..e9eae6d4f 100644
--- a/docs/notebooks/08b-rolling-horizon.ipynb
+++ b/docs/notebooks/08b-rolling-horizon.ipynb
@@ -4,7 +4,19 @@
"cell_type": "markdown",
"id": "0",
"metadata": {},
- "source": "# Rolling Horizon\n\nSolve large operational problems by decomposing the time horizon into sequential segments.\n\nThis notebook introduces:\n\n- **Rolling horizon optimization**: Divide time into overlapping segments\n- **State transfer**: Pass storage states and flow history between segments\n- **When to use**: Memory limits, operational planning with limited foresight\n\nWe use a realistic district heating system with CHP, boiler, and storage to demonstrate the approach."
+ "source": [
+ "# Rolling Horizon\n",
+ "\n",
+ "Solve large operational problems by decomposing the time horizon into sequential segments.\n",
+ "\n",
+ "This notebook introduces:\n",
+ "\n",
+ "- **Rolling horizon optimization**: Divide time into overlapping segments\n",
+ "- **State transfer**: Pass storage states and flow history between segments\n",
+ "- **When to use**: Memory limits, operational planning with limited foresight\n",
+ "\n",
+ "We use a realistic district heating system with CHP, boiler, and storage to demonstrate the approach."
+ ]
},
{
"cell_type": "markdown",
@@ -16,13 +28,10 @@
},
{
"cell_type": "code",
+ "execution_count": null,
"id": "2",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T19:01:44.873555Z",
- "start_time": "2025-12-13T19:01:40.936227Z"
- }
- },
+ "metadata": {},
+ "outputs": [],
"source": [
"import timeit\n",
"\n",
@@ -35,36 +44,24 @@
"import flixopt as fx\n",
"\n",
"fx.CONFIG.notebook()"
- ],
- "outputs": [
- {
- "data": {
- "text/plain": [
- "flixopt.config.CONFIG"
- ]
- },
- "execution_count": 1,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "execution_count": 1
+ ]
},
{
"cell_type": "markdown",
"id": "3",
"metadata": {},
- "source": "## Load Time Series Data\n\nWe use real-world district heating data at 15-minute resolution (two weeks):"
+ "source": [
+ "## Load Time Series Data\n",
+ "\n",
+ "We use real-world district heating data at 15-minute resolution (two weeks):"
+ ]
},
{
"cell_type": "code",
+ "execution_count": null,
"id": "4",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T19:01:45.078418Z",
- "start_time": "2025-12-13T19:01:44.973157Z"
- }
- },
+ "metadata": {},
+ "outputs": [],
"source": [
"# Load time series data (15-min resolution)\n",
"data = pd.read_csv('data/Zeitreihen2020.csv', index_col=0, parse_dates=True).sort_index()\n",
@@ -79,22 +76,17 @@
"electricity_price = data['Strompr.€/MWh'].to_numpy()\n",
"gas_price = data['Gaspr.€/MWh'].to_numpy()\n",
"\n",
- "print(f'Timesteps: {len(timesteps)} ({len(timesteps) / 96:.0f} days at 15-min resolution)')\n",
- "print(f'Heat demand: {heat_demand.min():.1f} - {heat_demand.max():.1f} MW')\n",
- "print(f'Electricity price: {electricity_price.min():.1f} - {electricity_price.max():.1f} €/MWh')"
- ],
- "outputs": [],
- "execution_count": null
+ "print(\n",
+ " f'{len(timesteps)} timesteps ({len(timesteps) / 96:.0f} days), heat {heat_demand.min():.0f}-{heat_demand.max():.0f} MW'\n",
+ ")"
+ ]
},
{
"cell_type": "code",
+ "execution_count": null,
"id": "5",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T19:01:45.204918Z",
- "start_time": "2025-12-13T19:01:45.183230Z"
- }
- },
+ "metadata": {},
+ "outputs": [],
"source": [
"def build_system(timesteps, heat_demand, electricity_demand, electricity_price, gas_price):\n",
" \"\"\"Build a district heating system with CHP, boiler, and storage.\"\"\"\n",
@@ -179,17 +171,7 @@
"\n",
"flow_system = build_system(timesteps, heat_demand, electricity_demand, electricity_price, gas_price)\n",
"print(f'System: {len(timesteps)} timesteps')"
- ],
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "System: 1344 timesteps\n"
- ]
- }
- ],
- "execution_count": 3
+ ]
},
{
"cell_type": "markdown",
@@ -203,13 +185,10 @@
},
{
"cell_type": "code",
+ "execution_count": null,
"id": "7",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T19:02:56.367270Z",
- "start_time": "2025-12-13T19:01:45.486690Z"
- }
- },
+ "metadata": {},
+ "outputs": [],
"source": [
"solver = fx.solvers.HighsSolver()\n",
"\n",
@@ -218,110 +197,39 @@
"fs_full.optimize(solver)\n",
"time_full = timeit.default_timer() - start\n",
"\n",
- "print(f'Full optimization: {time_full:.2f} seconds')\n",
- "print(f'Cost: {fs_full.solution[\"costs\"].item():,.0f} €')"
- ],
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "\u001B[2m2025-12-13 20:01:45.496\u001B[0m \u001B[33mWARNING \u001B[0m │ FlowSystem is not connected_and_transformed. Connecting and transforming data now.\n"
- ]
- },
- {
- "name": "stderr",
- "output_type": "stream",
- "text": [
- "Writing constraints.: 100%|\u001B[38;2;128;191;255m██████████\u001B[0m| 74/74 [00:00<00:00, 152.15it/s]\n",
- "Writing continuous variables.: 100%|\u001B[38;2;128;191;255m██████████\u001B[0m| 56/56 [00:00<00:00, 378.63it/s]\n",
- "Writing binary variables.: 100%|\u001B[38;2;128;191;255m██████████\u001B[0m| 11/11 [00:00<00:00, 335.35it/s]\n"
- ]
- },
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Running HiGHS 1.12.0 (git hash: 755a8e0): Copyright (c) 2025 HiGHS under MIT licence terms\n",
- "MIP linopy-problem-lqmu4n6b has 53792 rows; 51102 cols; 168036 nonzeros; 14784 integer variables (14784 binary)\n",
- "Coefficient ranges:\n",
- " Matrix [1e-05, 2e+04]\n",
- " Cost [1e+00, 1e+00]\n",
- " Bound [1e+00, 1e+03]\n",
- " RHS [1e-05, 2e+02]\n",
- "WARNING: Problem has some excessively small row bounds\n",
- "Presolving model\n",
- "29568 rows, 24168 cols, 76581 nonzeros 0s\n",
- "25322 rows, 18981 cols, 72124 nonzeros 0s\n",
- "24294 rows, 18173 cols, 69378 nonzeros 0s\n",
- "Presolve reductions: rows 24294(-29498); columns 18173(-32929); nonzeros 69378(-98658) \n",
- "\n",
- "Solving MIP model with:\n",
- " 24294 rows\n",
- " 18173 cols (13978 binary, 0 integer, 0 implied int., 4195 continuous, 0 domain fixed)\n",
- " 69378 nonzeros\n",
- "\n",
- "Src: B => Branching; C => Central rounding; F => Feasibility pump; H => Heuristic;\n",
- " I => Shifting; J => Feasibility jump; L => Sub-MIP; P => Empty MIP; R => Randomized rounding;\n",
- " S => Solve LP; T => Evaluate node; U => Unbounded; X => User solution; Y => HiGHS solution;\n",
- " Z => ZI Round; l => Trivial lower; p => Trivial point; u => Trivial upper; z => Trivial zero\n",
- "\n",
- " Nodes | B&B Tree | Objective Bounds | Dynamic Constraints | Work \n",
- "Src Proc. InQueue | Leaves Expl. | BestBound BestSol Gap | Cuts InLp Confl. | LpIters Time\n",
- "\n",
- " 0 0 0 0.00% 1030491.76973 inf inf 0 0 0 0 0.5s\n",
- " 0 0 0 0.00% 1540084.733469 inf inf 0 0 0 9609 1.0s\n",
- " C 0 0 0 0.00% 1540120.790012 1662404.794591 7.36% 10533 2312 0 13317 3.5s\n",
- " 0 0 0 0.00% 1540129.709896 1662404.794591 7.36% 10993 2339 0 14788 8.6s\n",
- " 0 0 0 0.00% 1540135.248328 1662404.794591 7.35% 10379 2761 0 17251 13.8s\n",
- " 0 0 0 0.00% 1540139.906068 1662404.794591 7.35% 10794 2560 0 18445 19.2s\n",
- " 0 0 0 0.00% 1540142.257624 1662404.794591 7.35% 10289 2512 0 19682 24.4s\n",
- " L 0 0 0 0.00% 1540142.371061 1591562.49514 3.23% 10213 2579 0 19922 31.8s\n",
- " L 0 0 0 0.00% 1540142.371061 1540200.034522 0.00% 10213 2579 0 23652 68.0s\n",
- " 1 0 1 100.00% 1540142.371061 1540200.034522 0.00% 9659 2579 0 31373 68.0s\n",
- "\n",
- "Solving report\n",
- " Model linopy-problem-lqmu4n6b\n",
- " Status Optimal\n",
- " Primal bound 1540200.03452\n",
- " Dual bound 1540142.37106\n",
- " Gap 0.00374% (tolerance: 1%)\n",
- " P-D integral 3.24885572414\n",
- " Solution status feasible\n",
- " 1540200.03452 (objective)\n",
- " 0 (bound viol.)\n",
- " 6.93576991062e-07 (int. viol.)\n",
- " 0 (row viol.)\n",
- " Timing 68.01\n",
- " Max sub-MIP depth 2\n",
- " Nodes 1\n",
- " Repair LPs 0\n",
- " LP iterations 31373\n",
- " 0 (strong br.)\n",
- " 10313 (separation)\n",
- " 11450 (heuristics)\n",
- "Full optimization: 70.87 seconds\n",
- "Cost: 1,540,200 €\n"
- ]
- }
- ],
- "execution_count": 4
+ "print(f'Full: {time_full:.1f}s, {fs_full.solution[\"costs\"].item():,.0f} €')"
+ ]
},
{
"cell_type": "markdown",
"id": "8",
"metadata": {},
- "source": "## Rolling Horizon Optimization\n\nThe `optimize.rolling_horizon()` method divides the time horizon into segments that are solved sequentially:\n\n```\nFull horizon: |---------- 1344 timesteps (14 days) ----------|\n \nSegment 1: |==== 192 (2 days) ====|-- overlap --|\nSegment 2: |==== 192 (2 days) ====|-- overlap --|\nSegment 3: |==== 192 (2 days) ====|-- overlap --|\n... \n```\n\nKey parameters:\n- **horizon**: Timesteps per segment (excluding overlap)\n- **overlap**: Additional lookahead timesteps (improves storage optimization)\n- **nr_of_previous_values**: Flow history transferred between segments"
+ "source": [
+ "## Rolling Horizon Optimization\n",
+ "\n",
+ "The `optimize.rolling_horizon()` method divides the time horizon into segments that are solved sequentially:\n",
+ "\n",
+ "```\n",
+ "Full horizon: |---------- 1344 timesteps (14 days) ----------|\n",
+ " \n",
+ "Segment 1: |==== 192 (2 days) ====|-- overlap --|\n",
+ "Segment 2: |==== 192 (2 days) ====|-- overlap --|\n",
+ "Segment 3: |==== 192 (2 days) ====|-- overlap --|\n",
+ "... \n",
+ "```\n",
+ "\n",
+ "Key parameters:\n",
+ "- **horizon**: Timesteps per segment (excluding overlap)\n",
+ "- **overlap**: Additional lookahead timesteps (improves storage optimization)\n",
+ "- **nr_of_previous_values**: Flow history transferred between segments"
+ ]
},
{
"cell_type": "code",
+ "execution_count": null,
"id": "9",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T19:03:27.454194Z",
- "start_time": "2025-12-13T19:02:56.525964Z"
- }
- },
+ "metadata": {},
+ "outputs": [],
"source": [
"start = timeit.default_timer()\n",
"fs_rolling = flow_system.copy()\n",
@@ -332,161 +240,8 @@
")\n",
"time_rolling = timeit.default_timer() - start\n",
"\n",
- "print(f'Rolling horizon: {time_rolling:.2f} seconds ({len(segments)} segments)')\n",
- "print(f'Cost: {fs_rolling.solution[\"costs\"].item():,.0f} €')"
- ],
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Segment 1/7 (timesteps 0-288): 0%| | 0/7 [00:00, ?segment/s]"
- ]
- },
- {
- "name": "stderr",
- "output_type": "stream",
- "text": [
- "\n",
- "Writing constraints.: 0%|\u001B[38;2;128;191;255m \u001B[0m| 0/74 [00:00, ?it/s]\u001B[A\n",
- "Writing constraints.: 23%|\u001B[38;2;128;191;255m██▎ \u001B[0m| 17/74 [00:00<00:00, 166.25it/s]\u001B[A\n",
- "Writing constraints.: 50%|\u001B[38;2;128;191;255m█████ \u001B[0m| 37/74 [00:00<00:00, 181.94it/s]\u001B[A\n",
- "Writing constraints.: 100%|\u001B[38;2;128;191;255m██████████\u001B[0m| 74/74 [00:00<00:00, 202.91it/s]\u001B[A\n",
- "\n",
- "Writing continuous variables.: 100%|\u001B[38;2;128;191;255m██████████\u001B[0m| 56/56 [00:00<00:00, 1059.72it/s]\n",
- "\n",
- "Writing binary variables.: 100%|\u001B[38;2;128;191;255m██████████\u001B[0m| 11/11 [00:00<00:00, 891.77it/s]\n"
- ]
- },
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Segment 2/7 (timesteps 192-480): 14%|█▍ | 1/7 [00:04<00:27, 4.51s/segment]"
- ]
- },
- {
- "name": "stderr",
- "output_type": "stream",
- "text": [
- "\n",
- "Writing constraints.: 0%|\u001B[38;2;128;191;255m \u001B[0m| 0/74 [00:00, ?it/s]\u001B[A\n",
- "Writing constraints.: 7%|\u001B[38;2;128;191;255m▋ \u001B[0m| 5/74 [00:00<00:01, 47.55it/s]\u001B[A\n",
- "Writing constraints.: 14%|\u001B[38;2;128;191;255m█▎ \u001B[0m| 10/74 [00:00<00:01, 48.71it/s]\u001B[A\n",
- "Writing constraints.: 26%|\u001B[38;2;128;191;255m██▌ \u001B[0m| 19/74 [00:00<00:00, 60.79it/s]\u001B[A\n",
- "Writing constraints.: 35%|\u001B[38;2;128;191;255m███▌ \u001B[0m| 26/74 [00:00<00:00, 59.71it/s]\u001B[A\n",
- "Writing constraints.: 43%|\u001B[38;2;128;191;255m████▎ \u001B[0m| 32/74 [00:00<00:01, 40.03it/s]\u001B[A\n",
- "Writing constraints.: 50%|\u001B[38;2;128;191;255m█████ \u001B[0m| 37/74 [00:00<00:00, 42.35it/s]\u001B[A\n",
- "Writing constraints.: 58%|\u001B[38;2;128;191;255m█████▊ \u001B[0m| 43/74 [00:00<00:00, 45.99it/s]\u001B[A\n",
- "Writing constraints.: 66%|\u001B[38;2;128;191;255m██████▌ \u001B[0m| 49/74 [00:01<00:00, 46.11it/s]\u001B[A\n",
- "Writing constraints.: 74%|\u001B[38;2;128;191;255m███████▍ \u001B[0m| 55/74 [00:01<00:00, 49.51it/s]\u001B[A\n",
- "Writing constraints.: 85%|\u001B[38;2;128;191;255m████████▌ \u001B[0m| 63/74 [00:01<00:00, 57.10it/s]\u001B[A\n",
- "Writing constraints.: 100%|\u001B[38;2;128;191;255m██████████\u001B[0m| 74/74 [00:01<00:00, 50.24it/s]\u001B[A\n",
- "\n",
- "Writing continuous variables.: 0%|\u001B[38;2;128;191;255m \u001B[0m| 0/56 [00:00, ?it/s]\u001B[A\n",
- "Writing continuous variables.: 41%|\u001B[38;2;128;191;255m████ \u001B[0m| 23/56 [00:00<00:00, 217.00it/s]\u001B[A\n",
- "Writing continuous variables.: 100%|\u001B[38;2;128;191;255m██████████\u001B[0m| 56/56 [00:00<00:00, 224.88it/s]\u001B[A\n",
- "\n",
- "Writing binary variables.: 0%|\u001B[38;2;128;191;255m \u001B[0m| 0/11 [00:00, ?it/s]\u001B[A\n",
- "Writing binary variables.: 100%|\u001B[38;2;128;191;255m██████████\u001B[0m| 11/11 [00:00<00:00, 103.98it/s]\u001B[A\n"
- ]
- },
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Segment 3/7 (timesteps 384-672): 29%|██▊ | 2/7 [00:13<00:36, 7.29s/segment]"
- ]
- },
- {
- "name": "stderr",
- "output_type": "stream",
- "text": [
- "\n",
- "Writing constraints.: 0%|\u001B[38;2;128;191;255m \u001B[0m| 0/74 [00:00, ?it/s]\u001B[A\n",
- "Writing constraints.: 8%|\u001B[38;2;128;191;255m▊ \u001B[0m| 6/74 [00:00<00:01, 58.48it/s]\u001B[A\n",
- "Writing constraints.: 41%|\u001B[38;2;128;191;255m████ \u001B[0m| 30/74 [00:00<00:00, 159.93it/s]\u001B[A\n",
- "Writing constraints.: 100%|\u001B[38;2;128;191;255m██████████\u001B[0m| 74/74 [00:00<00:00, 185.30it/s]\u001B[A\n",
- "\n",
- "Writing continuous variables.: 100%|\u001B[38;2;128;191;255m██████████\u001B[0m| 56/56 [00:00<00:00, 1017.73it/s]\n",
- "\n",
- "Writing binary variables.: 100%|\u001B[38;2;128;191;255m██████████\u001B[0m| 11/11 [00:00<00:00, 711.01it/s]\n"
- ]
- },
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Segment 4/7 (timesteps 576-864): 43%|████▎ | 3/7 [00:18<00:24, 6.13s/segment]"
- ]
- },
- {
- "name": "stderr",
- "output_type": "stream",
- "text": [
- "\n",
- "Writing constraints.: 0%|\u001B[38;2;128;191;255m \u001B[0m| 0/74 [00:00, ?it/s]\u001B[A\n",
- "Writing constraints.: 30%|\u001B[38;2;128;191;255m██▉ \u001B[0m| 22/74 [00:00<00:00, 219.10it/s]\u001B[A\n",
- "Writing constraints.: 100%|\u001B[38;2;128;191;255m██████████\u001B[0m| 74/74 [00:00<00:00, 251.90it/s]\u001B[A\n",
- "\n",
- "Writing continuous variables.: 100%|\u001B[38;2;128;191;255m██████████\u001B[0m| 56/56 [00:00<00:00, 1221.70it/s]\n",
- "\n",
- "Writing binary variables.: 100%|\u001B[38;2;128;191;255m██████████\u001B[0m| 11/11 [00:00<00:00, 820.41it/s]\n"
- ]
- },
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Segment 5/7 (timesteps 768-1056): 57%|█████▋ | 4/7 [00:23<00:16, 5.54s/segment]"
- ]
- },
- {
- "name": "stderr",
- "output_type": "stream",
- "text": [
- "\n",
- "Writing constraints.: 0%|\u001B[38;2;128;191;255m \u001B[0m| 0/74 [00:00, ?it/s]\u001B[A\n",
- "Writing constraints.: 36%|\u001B[38;2;128;191;255m███▋ \u001B[0m| 27/74 [00:00<00:00, 266.29it/s]\u001B[A\n",
- "Writing constraints.: 100%|\u001B[38;2;128;191;255m██████████\u001B[0m| 74/74 [00:00<00:00, 276.18it/s]\u001B[A\n",
- "\n",
- "Writing continuous variables.: 100%|\u001B[38;2;128;191;255m██████████\u001B[0m| 56/56 [00:00<00:00, 700.66it/s]\n",
- "\n",
- "Writing binary variables.: 100%|\u001B[38;2;128;191;255m██████████\u001B[0m| 11/11 [00:00<00:00, 463.70it/s]\n"
- ]
- },
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Segment 6/7 (timesteps 960-1248): 71%|███████▏ | 5/7 [00:25<00:08, 4.30s/segment]"
- ]
- },
- {
- "name": "stderr",
- "output_type": "stream",
- "text": [
- "\n",
- "Writing constraints.: 0%|\u001B[38;2;128;191;255m \u001B[0m| 0/74 [00:00, ?it/s]\u001B[A\n",
- "Writing constraints.: 38%|\u001B[38;2;128;191;255m███▊ \u001B[0m| 28/74 [00:00<00:00, 275.74it/s]\u001B[A\n",
- "Writing constraints.: 100%|\u001B[38;2;128;191;255m██████████\u001B[0m| 74/74 [00:00<00:00, 277.64it/s]\u001B[A\n",
- "\n",
- "Writing continuous variables.: 100%|\u001B[38;2;128;191;255m██████████\u001B[0m| 56/56 [00:00<00:00, 882.35it/s]\n",
- "\n",
- "Writing binary variables.: 100%|\u001B[38;2;128;191;255m██████████\u001B[0m| 11/11 [00:00<00:00, 776.40it/s]\n"
- ]
- },
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Segment 7/7 (timesteps 1152-1344): 100%|██████████| 7/7 [00:30<00:00, 4.39s/segment]\n",
- "Rolling horizon: 30.92 seconds (7 segments)\n",
- "Cost: 1,540,676 €\n"
- ]
- }
- ],
- "execution_count": 5
+ "print(f'Rolling ({len(segments)} segments): {time_rolling:.1f}s, {fs_rolling.solution[\"costs\"].item():,.0f} €')"
+ ]
},
{
"cell_type": "markdown",
@@ -498,13 +253,10 @@
},
{
"cell_type": "code",
+ "execution_count": null,
"id": "11",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T19:03:27.650112Z",
- "start_time": "2025-12-13T19:03:27.498367Z"
- }
- },
+ "metadata": {},
+ "outputs": [],
"source": [
"cost_full = fs_full.solution['costs'].item()\n",
"cost_rolling = fs_rolling.solution['costs'].item()\n",
@@ -520,54 +272,7 @@
").set_index('Method')\n",
"\n",
"results.style.format({'Time [s]': '{:.2f}', 'Cost [€]': '{:,.0f}', 'Cost Gap [%]': '{:.2f}'})"
- ],
- "outputs": [
- {
- "data": {
- "text/plain": [
- ""
- ],
- "text/html": [
- "\n",
- "\n",
- " \n",
- " \n",
- " | | \n",
- " Time [s] | \n",
- " Cost [€] | \n",
- " Cost Gap [%] | \n",
- "
\n",
- " \n",
- " | Method | \n",
- " | \n",
- " | \n",
- " | \n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " | Full optimization | \n",
- " 70.87 | \n",
- " 1,540,200 | \n",
- " 0.00 | \n",
- "
\n",
- " \n",
- " | Rolling horizon | \n",
- " 30.92 | \n",
- " 1,540,676 | \n",
- " 0.03 | \n",
- "
\n",
- " \n",
- "
\n"
- ]
- },
- "execution_count": 6,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "execution_count": 6
+ ]
},
{
"cell_type": "markdown",
@@ -579,4005 +284,23 @@
},
{
"cell_type": "code",
+ "execution_count": null,
"id": "13",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T19:03:28.570509Z",
- "start_time": "2025-12-13T19:03:27.661Z"
- }
- },
+ "metadata": {},
+ "outputs": [],
"source": [
"fs_full.statistics.plot.balance('Heat').figure.update_layout(title='Heat Balance (Full)')"
- ],
- "outputs": [
- {
- "data": {
- "text/html": [
- " \n",
- " \n",
- " "
- ]
- },
- "metadata": {},
- "output_type": "display_data",
- "jetTransient": {
- "display_id": null
- }
- },
- {
- "data": {
- "text/html": [
- ""
- ]
- },
- "metadata": {},
- "output_type": "display_data",
- "jetTransient": {
- "display_id": null
- }
- }
- ],
- "execution_count": 7
+ ]
},
{
"cell_type": "code",
+ "execution_count": null,
"id": "14",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T19:03:29.994610Z",
- "start_time": "2025-12-13T19:03:29.772272Z"
- }
- },
+ "metadata": {},
+ "outputs": [],
"source": [
"fs_rolling.statistics.plot.balance('Heat').figure.update_layout(title='Heat Balance (Rolling)')"
- ],
- "outputs": [
- {
- "data": {
- "text/html": [
- ""
- ]
- },
- "metadata": {},
- "output_type": "display_data",
- "jetTransient": {
- "display_id": null
- }
- }
- ],
- "execution_count": 8
+ ]
},
{
"cell_type": "markdown",
@@ -4591,13 +314,10 @@
},
{
"cell_type": "code",
+ "execution_count": null,
"id": "16",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T19:03:30.194568Z",
- "start_time": "2025-12-13T19:03:30.141045Z"
- }
- },
+ "metadata": {},
+ "outputs": [],
"source": [
"fig = make_subplots(\n",
" rows=2, cols=1, shared_xaxes=True, vertical_spacing=0.1, subplot_titles=['Full Optimization', 'Rolling Horizon']\n",
@@ -4615,46 +335,7 @@
"fig.update_yaxes(title_text='Charge State [MWh]', row=2, col=1)\n",
"fig.update_layout(height=400, showlegend=False)\n",
"fig.show()"
- ],
- "outputs": [
- {
- "data": {
- "text/html": [
- ""
- ]
- },
- "metadata": {},
- "output_type": "display_data",
- "jetTransient": {
- "display_id": null
- }
- }
- ],
- "execution_count": 9
+ ]
},
{
"cell_type": "markdown",
@@ -4668,58 +349,34 @@
},
{
"cell_type": "code",
+ "execution_count": null,
"id": "18",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T19:03:30.246423Z",
- "start_time": "2025-12-13T19:03:30.228470Z"
- }
- },
+ "metadata": {},
+ "outputs": [],
"source": [
- "print(f'Number of segments: {len(segments)}')\n",
- "print()\n",
+ "print(f'{len(segments)} segments:')\n",
"for i, seg in enumerate(segments):\n",
- " start_time = seg.timesteps[0]\n",
- " end_time = seg.timesteps[-1]\n",
- " cost = seg.solution['costs'].item()\n",
" print(\n",
- " f'Segment {i + 1}: {start_time.strftime(\"%Y-%m-%d %H:%M\")} → {end_time.strftime(\"%Y-%m-%d %H:%M\")} | Cost: {cost:,.0f} €'\n",
+ " f' {i + 1}: {seg.timesteps[0]:%m-%d %H:%M} → {seg.timesteps[-1]:%m-%d %H:%M} | {seg.solution[\"costs\"].item():,.0f} €'\n",
" )"
- ],
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Number of segments: 7\n",
- "\n",
- "Segment 1: 2020-01-01 00:00 → 2020-01-03 23:45 | Cost: 318,658 €\n",
- "Segment 2: 2020-01-03 00:00 → 2020-01-05 23:45 | Cost: 275,399 €\n",
- "Segment 3: 2020-01-05 00:00 → 2020-01-07 23:45 | Cost: 335,051 €\n",
- "Segment 4: 2020-01-07 00:00 → 2020-01-09 23:45 | Cost: 406,345 €\n",
- "Segment 5: 2020-01-09 00:00 → 2020-01-11 23:45 | Cost: 356,730 €\n",
- "Segment 6: 2020-01-11 00:00 → 2020-01-13 23:45 | Cost: 275,606 €\n",
- "Segment 7: 2020-01-13 00:00 → 2020-01-14 23:45 | Cost: 270,066 €\n"
- ]
- }
- ],
- "execution_count": 10
+ ]
},
{
"cell_type": "markdown",
"id": "19",
"metadata": {},
- "source": "## Visualize Segment Overlaps\n\nUnderstanding how segments overlap is key to tuning rolling horizon. Let's visualize the flow rates from each segment including their overlap regions:"
+ "source": [
+ "## Visualize Segment Overlaps\n",
+ "\n",
+ "Understanding how segments overlap is key to tuning rolling horizon. Let's visualize the flow rates from each segment including their overlap regions:"
+ ]
},
{
"cell_type": "code",
+ "execution_count": null,
"id": "20",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T19:03:30.528986Z",
- "start_time": "2025-12-13T19:03:30.272546Z"
- }
- },
+ "metadata": {},
+ "outputs": [],
"source": [
"# Concatenate all segment solutions into one dataset (including overlaps)\n",
"ds = xr.concat([seg.solution for seg in segments], dim=pd.RangeIndex(len(segments), name='segment'), join='outer')\n",
@@ -4729,105 +386,24 @@
" ds['Boiler(Q_th)|flow_rate'].to_pandas().T,\n",
" labels={'value': 'Boiler Thermal Output [MW]', 'index': 'Timestep'},\n",
")"
- ],
- "outputs": [
- {
- "data": {
- "text/html": [
- ""
- ]
- },
- "metadata": {},
- "output_type": "display_data",
- "jetTransient": {
- "display_id": null
- }
- }
- ],
- "execution_count": 11
+ ]
},
{
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T19:03:30.963250Z",
- "start_time": "2025-12-13T19:03:30.651056Z"
- }
- },
"cell_type": "code",
+ "execution_count": null,
+ "id": "21",
+ "metadata": {},
+ "outputs": [],
"source": [
"px.line(\n",
" ds['Storage|charge_state'].to_pandas().T,\n",
" labels={'value': 'Storage Charge State [MW]', 'index': 'Timestep'},\n",
")"
- ],
- "id": "d7c660381f2190e0",
- "outputs": [
- {
- "data": {
- "text/html": [
- ""
- ]
- },
- "metadata": {},
- "output_type": "display_data",
- "jetTransient": {
- "display_id": null
- }
- }
- ],
- "execution_count": 12
+ ]
},
{
"cell_type": "markdown",
- "id": "21",
+ "id": "22",
"metadata": {},
"source": [
"## When to Use Rolling Horizon\n",
@@ -4848,7 +424,7 @@
},
{
"cell_type": "markdown",
- "id": "22",
+ "id": "23",
"metadata": {},
"source": [
"## API Reference\n",
@@ -4872,9 +448,28 @@
},
{
"cell_type": "markdown",
- "id": "23",
+ "id": "24",
"metadata": {},
- "source": "## Summary\n\nYou learned how to:\n\n- Use **`optimize.rolling_horizon()`** to decompose large problems\n- Choose **horizon** and **overlap** parameters\n- Understand the **trade-offs** vs. full optimization\n\n### Key Takeaways\n\n1. **Rolling horizon** is useful for memory-limited or operational planning problems\n2. **Overlap** improves solution quality at the cost of computation time\n3. **Storage states** are automatically transferred between segments\n4. Use **full optimization** for investment decisions\n\n### Related Notebooks\n\n- **[08a-Aggregation](08a-aggregation.ipynb)**: For investment problems, use time series aggregation (resampling, clustering) instead"
+ "source": [
+ "## Summary\n",
+ "\n",
+ "You learned how to:\n",
+ "\n",
+ "- Use **`optimize.rolling_horizon()`** to decompose large problems\n",
+ "- Choose **horizon** and **overlap** parameters\n",
+ "- Understand the **trade-offs** vs. full optimization\n",
+ "\n",
+ "### Key Takeaways\n",
+ "\n",
+ "1. **Rolling horizon** is useful for memory-limited or operational planning problems\n",
+ "2. **Overlap** improves solution quality at the cost of computation time\n",
+ "3. **Storage states** are automatically transferred between segments\n",
+ "4. Use **full optimization** for investment decisions\n",
+ "\n",
+ "### Related Notebooks\n",
+ "\n",
+ "- **[08a-Aggregation](08a-aggregation.ipynb)**: For investment problems, use time series aggregation (resampling, clustering) instead"
+ ]
}
],
"metadata": {
diff --git a/docs/notebooks/09-plotting-and-data-access.ipynb b/docs/notebooks/09-plotting-and-data-access.ipynb
index 091d5f1d4..a4803adf4 100644
--- a/docs/notebooks/09-plotting-and-data-access.ipynb
+++ b/docs/notebooks/09-plotting-and-data-access.ipynb
@@ -4,7 +4,22 @@
"cell_type": "markdown",
"id": "0",
"metadata": {},
- "source": "# Plotting\n\nAccess optimization results and create visualizations.\n\nThis notebook covers:\n\n- Loading saved FlowSystems from NetCDF files\n- Accessing data (flow rates, sizes, effects, charge states)\n- Time series plots (balance, flows, storage)\n- Aggregated plots (sizes, effects, duration curves)\n- Heatmaps with time reshaping\n- Sankey diagrams\n- Topology visualization\n- Color customization and export"
+ "source": [
+ "# Plotting\n",
+ "\n",
+ "Access optimization results and create visualizations.\n",
+ "\n",
+ "This notebook covers:\n",
+ "\n",
+ "- Loading saved FlowSystems from NetCDF files\n",
+ "- Accessing data (flow rates, sizes, effects, charge states)\n",
+ "- Time series plots (balance, flows, storage)\n",
+ "- Aggregated plots (sizes, effects, duration curves)\n",
+ "- Heatmaps with time reshaping\n",
+ "- Sankey diagrams\n",
+ "- Topology visualization\n",
+ "- Color customization and export"
+ ]
},
{
"cell_type": "markdown",
@@ -16,33 +31,17 @@
},
{
"cell_type": "code",
+ "execution_count": null,
"id": "2",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T14:13:06.543191Z",
- "start_time": "2025-12-13T14:13:00.434024Z"
- }
- },
+ "metadata": {},
+ "outputs": [],
"source": [
"from pathlib import Path\n",
"\n",
"import flixopt as fx\n",
"\n",
"fx.CONFIG.notebook()"
- ],
- "outputs": [
- {
- "data": {
- "text/plain": [
- "flixopt.config.CONFIG"
- ]
- },
- "execution_count": 1,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "execution_count": 1
+ ]
},
{
"cell_type": "markdown",
@@ -56,44 +55,14 @@
},
{
"cell_type": "code",
+ "execution_count": null,
"id": "4",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T14:13:14.318678Z",
- "start_time": "2025-12-13T14:13:06.637107Z"
- }
- },
+ "metadata": {},
+ "outputs": [],
"source": [
"# Run the generation script (only needed once, or to regenerate)\n",
- "!python data/generate_example_systems.py"
- ],
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Creating simple_system...\r\n",
- " Optimizing...\r\n",
- " Saving to /Users/felix/PycharmProjects/flixopt_719231/docs/notebooks/data/simple_system.nc4...\r\n",
- " Done. Objective: 558.83\r\n",
- "\r\n",
- "Creating complex_system...\r\n",
- " Optimizing...\r\n",
- "HighsMipSolverData::transformNewIntegerFeasibleSolution tmpSolver.run();\r\n",
- "HighsMipSolverData::transformNewIntegerFeasibleSolution tmpSolver.run();\r\n",
- " Saving to /Users/felix/PycharmProjects/flixopt_719231/docs/notebooks/data/complex_system.nc4...\r\n",
- " Done. Objective: 302.36\r\n",
- "\r\n",
- "Creating multiperiod_system...\r\n",
- " Optimizing...\r\n",
- " Saving to /Users/felix/PycharmProjects/flixopt_719231/docs/notebooks/data/multiperiod_system.nc4...\r\n",
- " Done. Objective: 19472.48\r\n",
- "\r\n",
- "All systems generated successfully!\r\n"
- ]
- }
- ],
- "execution_count": 2
+ "!python data/generate_example_systems.py > /dev/null 2>&1"
+ ]
},
{
"cell_type": "markdown",
@@ -107,13 +76,10 @@
},
{
"cell_type": "code",
+ "execution_count": null,
"id": "6",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T14:13:14.940793Z",
- "start_time": "2025-12-13T14:13:14.377412Z"
- }
- },
+ "metadata": {},
+ "outputs": [],
"source": [
"DATA_DIR = Path('data')\n",
"\n",
@@ -126,483 +92,45 @@
"print(f' simple: {len(simple.components)} components, {len(simple.buses)} buses')\n",
"print(f' complex_sys: {len(complex_sys.components)} components, {len(complex_sys.buses)} buses')\n",
"print(f' multiperiod: {len(multiperiod.components)} components, dims={dict(multiperiod.solution.sizes)}')"
- ],
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Loaded systems:\n",
- " simple: 4 components, 2 buses\n",
- " complex_sys: 9 components, 3 buses\n",
- " multiperiod: 4 components, dims={'scenario': 2, 'period': 3, 'time': 49}\n"
- ]
- }
- ],
- "execution_count": 3
+ ]
},
{
"cell_type": "markdown",
"id": "7",
"metadata": {},
- "source": "## 2. Quick Overview: Balance Plot\n\nLet's start with the most common visualization - a balance plot showing energy flows:"
+ "source": [
+ "## 2. Quick Overview: Balance Plot\n",
+ "\n",
+ "Let's start with the most common visualization - a balance plot showing energy flows:"
+ ]
},
{
"cell_type": "code",
+ "execution_count": null,
"id": "8",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T14:13:15.234587Z",
- "start_time": "2025-12-13T14:13:14.950674Z"
- }
- },
+ "metadata": {},
+ "outputs": [],
"source": [
"# Balance plot for the Heat bus - shows all inflows and outflows\n",
"simple.statistics.plot.balance('Heat')"
- ],
- "outputs": [
- {
- "data": {
- "text/plain": [
- "PlotResult(data= Size: 7kB\n",
- "Dimensions: (time: 169)\n",
- "Coordinates:\n",
- " * time (time) datetime64[ns] 1kB 2024-01-15 ... 2024-...\n",
- "Data variables:\n",
- " Boiler(Heat) (time) float64 1kB -32.48 -29.31 ... -124.5 nan\n",
- " ThermalStorage(Discharge) (time) float64 1kB -0.0 5.275e-13 ... nan\n",
- " ThermalStorage(Charge) (time) float64 1kB 0.0 -3.748e-13 ... 100.0 nan\n",
- " Office(Heat) (time) float64 1kB 32.48 29.31 ... 24.48 nan, figure=Figure({\n",
- " 'data': [{'hovertemplate': 'variable=Boiler(Heat)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'Boiler(Heat)',\n",
- " 'marker': {'color': '#EF553B', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'Boiler(Heat)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-15T00:00:00.000000000', '2024-01-15T01:00:00.000000000',\n",
- " '2024-01-15T02:00:00.000000000', '2024-01-15T03:00:00.000000000',\n",
- " '2024-01-15T04:00:00.000000000', '2024-01-15T05:00:00.000000000',\n",
- " '2024-01-15T06:00:00.000000000', '2024-01-15T07:00:00.000000000',\n",
- " '2024-01-15T08:00:00.000000000', '2024-01-15T09:00:00.000000000',\n",
- " '2024-01-15T10:00:00.000000000', '2024-01-15T11:00:00.000000000',\n",
- " '2024-01-15T12:00:00.000000000', '2024-01-15T13:00:00.000000000',\n",
- " '2024-01-15T14:00:00.000000000', '2024-01-15T15:00:00.000000000',\n",
- " '2024-01-15T16:00:00.000000000', '2024-01-15T17:00:00.000000000',\n",
- " '2024-01-15T18:00:00.000000000', '2024-01-15T19:00:00.000000000',\n",
- " '2024-01-15T20:00:00.000000000', '2024-01-15T21:00:00.000000000',\n",
- " '2024-01-15T22:00:00.000000000', '2024-01-15T23:00:00.000000000',\n",
- " '2024-01-16T00:00:00.000000000', '2024-01-16T01:00:00.000000000',\n",
- " '2024-01-16T02:00:00.000000000', '2024-01-16T03:00:00.000000000',\n",
- " '2024-01-16T04:00:00.000000000', '2024-01-16T05:00:00.000000000',\n",
- " '2024-01-16T06:00:00.000000000', '2024-01-16T07:00:00.000000000',\n",
- " '2024-01-16T08:00:00.000000000', '2024-01-16T09:00:00.000000000',\n",
- " '2024-01-16T10:00:00.000000000', '2024-01-16T11:00:00.000000000',\n",
- " '2024-01-16T12:00:00.000000000', '2024-01-16T13:00:00.000000000',\n",
- " '2024-01-16T14:00:00.000000000', '2024-01-16T15:00:00.000000000',\n",
- " '2024-01-16T16:00:00.000000000', '2024-01-16T17:00:00.000000000',\n",
- " '2024-01-16T18:00:00.000000000', '2024-01-16T19:00:00.000000000',\n",
- " '2024-01-16T20:00:00.000000000', '2024-01-16T21:00:00.000000000',\n",
- " '2024-01-16T22:00:00.000000000', '2024-01-16T23:00:00.000000000',\n",
- " '2024-01-17T00:00:00.000000000', '2024-01-17T01:00:00.000000000',\n",
- " '2024-01-17T02:00:00.000000000', '2024-01-17T03:00:00.000000000',\n",
- " '2024-01-17T04:00:00.000000000', '2024-01-17T05:00:00.000000000',\n",
- " '2024-01-17T06:00:00.000000000', '2024-01-17T07:00:00.000000000',\n",
- " '2024-01-17T08:00:00.000000000', '2024-01-17T09:00:00.000000000',\n",
- " '2024-01-17T10:00:00.000000000', '2024-01-17T11:00:00.000000000',\n",
- " '2024-01-17T12:00:00.000000000', '2024-01-17T13:00:00.000000000',\n",
- " '2024-01-17T14:00:00.000000000', '2024-01-17T15:00:00.000000000',\n",
- " '2024-01-17T16:00:00.000000000', '2024-01-17T17:00:00.000000000',\n",
- " '2024-01-17T18:00:00.000000000', '2024-01-17T19:00:00.000000000',\n",
- " '2024-01-17T20:00:00.000000000', '2024-01-17T21:00:00.000000000',\n",
- " '2024-01-17T22:00:00.000000000', '2024-01-17T23:00:00.000000000',\n",
- " '2024-01-18T00:00:00.000000000', '2024-01-18T01:00:00.000000000',\n",
- " '2024-01-18T02:00:00.000000000', '2024-01-18T03:00:00.000000000',\n",
- " '2024-01-18T04:00:00.000000000', '2024-01-18T05:00:00.000000000',\n",
- " '2024-01-18T06:00:00.000000000', '2024-01-18T07:00:00.000000000',\n",
- " '2024-01-18T08:00:00.000000000', '2024-01-18T09:00:00.000000000',\n",
- " '2024-01-18T10:00:00.000000000', '2024-01-18T11:00:00.000000000',\n",
- " '2024-01-18T12:00:00.000000000', '2024-01-18T13:00:00.000000000',\n",
- " '2024-01-18T14:00:00.000000000', '2024-01-18T15:00:00.000000000',\n",
- " '2024-01-18T16:00:00.000000000', '2024-01-18T17:00:00.000000000',\n",
- " '2024-01-18T18:00:00.000000000', '2024-01-18T19:00:00.000000000',\n",
- " '2024-01-18T20:00:00.000000000', '2024-01-18T21:00:00.000000000',\n",
- " '2024-01-18T22:00:00.000000000', '2024-01-18T23:00:00.000000000',\n",
- " '2024-01-19T00:00:00.000000000', '2024-01-19T01:00:00.000000000',\n",
- " '2024-01-19T02:00:00.000000000', '2024-01-19T03:00:00.000000000',\n",
- " '2024-01-19T04:00:00.000000000', '2024-01-19T05:00:00.000000000',\n",
- " '2024-01-19T06:00:00.000000000', '2024-01-19T07:00:00.000000000',\n",
- " '2024-01-19T08:00:00.000000000', '2024-01-19T09:00:00.000000000',\n",
- " '2024-01-19T10:00:00.000000000', '2024-01-19T11:00:00.000000000',\n",
- " '2024-01-19T12:00:00.000000000', '2024-01-19T13:00:00.000000000',\n",
- " '2024-01-19T14:00:00.000000000', '2024-01-19T15:00:00.000000000',\n",
- " '2024-01-19T16:00:00.000000000', '2024-01-19T17:00:00.000000000',\n",
- " '2024-01-19T18:00:00.000000000', '2024-01-19T19:00:00.000000000',\n",
- " '2024-01-19T20:00:00.000000000', '2024-01-19T21:00:00.000000000',\n",
- " '2024-01-19T22:00:00.000000000', '2024-01-19T23:00:00.000000000',\n",
- " '2024-01-20T00:00:00.000000000', '2024-01-20T01:00:00.000000000',\n",
- " '2024-01-20T02:00:00.000000000', '2024-01-20T03:00:00.000000000',\n",
- " '2024-01-20T04:00:00.000000000', '2024-01-20T05:00:00.000000000',\n",
- " '2024-01-20T06:00:00.000000000', '2024-01-20T07:00:00.000000000',\n",
- " '2024-01-20T08:00:00.000000000', '2024-01-20T09:00:00.000000000',\n",
- " '2024-01-20T10:00:00.000000000', '2024-01-20T11:00:00.000000000',\n",
- " '2024-01-20T12:00:00.000000000', '2024-01-20T13:00:00.000000000',\n",
- " '2024-01-20T14:00:00.000000000', '2024-01-20T15:00:00.000000000',\n",
- " '2024-01-20T16:00:00.000000000', '2024-01-20T17:00:00.000000000',\n",
- " '2024-01-20T18:00:00.000000000', '2024-01-20T19:00:00.000000000',\n",
- " '2024-01-20T20:00:00.000000000', '2024-01-20T21:00:00.000000000',\n",
- " '2024-01-20T22:00:00.000000000', '2024-01-20T23:00:00.000000000',\n",
- " '2024-01-21T00:00:00.000000000', '2024-01-21T01:00:00.000000000',\n",
- " '2024-01-21T02:00:00.000000000', '2024-01-21T03:00:00.000000000',\n",
- " '2024-01-21T04:00:00.000000000', '2024-01-21T05:00:00.000000000',\n",
- " '2024-01-21T06:00:00.000000000', '2024-01-21T07:00:00.000000000',\n",
- " '2024-01-21T08:00:00.000000000', '2024-01-21T09:00:00.000000000',\n",
- " '2024-01-21T10:00:00.000000000', '2024-01-21T11:00:00.000000000',\n",
- " '2024-01-21T12:00:00.000000000', '2024-01-21T13:00:00.000000000',\n",
- " '2024-01-21T14:00:00.000000000', '2024-01-21T15:00:00.000000000',\n",
- " '2024-01-21T16:00:00.000000000', '2024-01-21T17:00:00.000000000',\n",
- " '2024-01-21T18:00:00.000000000', '2024-01-21T19:00:00.000000000',\n",
- " '2024-01-21T20:00:00.000000000', '2024-01-21T21:00:00.000000000',\n",
- " '2024-01-21T22:00:00.000000000', '2024-01-21T23:00:00.000000000',\n",
- " '2024-01-22T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('5ZuWpeU9QMD3U8WNBU89wHjXQkqFnk' ... '////8zwPW5+Ef5Hl/AAAAAAAAA+P8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'variable=ThermalStorage(Discharge)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'ThermalStorage(Discharge)',\n",
- " 'marker': {'color': '#00CC96', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'ThermalStorage(Discharge)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-15T00:00:00.000000000', '2024-01-15T01:00:00.000000000',\n",
- " '2024-01-15T02:00:00.000000000', '2024-01-15T03:00:00.000000000',\n",
- " '2024-01-15T04:00:00.000000000', '2024-01-15T05:00:00.000000000',\n",
- " '2024-01-15T06:00:00.000000000', '2024-01-15T07:00:00.000000000',\n",
- " '2024-01-15T08:00:00.000000000', '2024-01-15T09:00:00.000000000',\n",
- " '2024-01-15T10:00:00.000000000', '2024-01-15T11:00:00.000000000',\n",
- " '2024-01-15T12:00:00.000000000', '2024-01-15T13:00:00.000000000',\n",
- " '2024-01-15T14:00:00.000000000', '2024-01-15T15:00:00.000000000',\n",
- " '2024-01-15T16:00:00.000000000', '2024-01-15T17:00:00.000000000',\n",
- " '2024-01-15T18:00:00.000000000', '2024-01-15T19:00:00.000000000',\n",
- " '2024-01-15T20:00:00.000000000', '2024-01-15T21:00:00.000000000',\n",
- " '2024-01-15T22:00:00.000000000', '2024-01-15T23:00:00.000000000',\n",
- " '2024-01-16T00:00:00.000000000', '2024-01-16T01:00:00.000000000',\n",
- " '2024-01-16T02:00:00.000000000', '2024-01-16T03:00:00.000000000',\n",
- " '2024-01-16T04:00:00.000000000', '2024-01-16T05:00:00.000000000',\n",
- " '2024-01-16T06:00:00.000000000', '2024-01-16T07:00:00.000000000',\n",
- " '2024-01-16T08:00:00.000000000', '2024-01-16T09:00:00.000000000',\n",
- " '2024-01-16T10:00:00.000000000', '2024-01-16T11:00:00.000000000',\n",
- " '2024-01-16T12:00:00.000000000', '2024-01-16T13:00:00.000000000',\n",
- " '2024-01-16T14:00:00.000000000', '2024-01-16T15:00:00.000000000',\n",
- " '2024-01-16T16:00:00.000000000', '2024-01-16T17:00:00.000000000',\n",
- " '2024-01-16T18:00:00.000000000', '2024-01-16T19:00:00.000000000',\n",
- " '2024-01-16T20:00:00.000000000', '2024-01-16T21:00:00.000000000',\n",
- " '2024-01-16T22:00:00.000000000', '2024-01-16T23:00:00.000000000',\n",
- " '2024-01-17T00:00:00.000000000', '2024-01-17T01:00:00.000000000',\n",
- " '2024-01-17T02:00:00.000000000', '2024-01-17T03:00:00.000000000',\n",
- " '2024-01-17T04:00:00.000000000', '2024-01-17T05:00:00.000000000',\n",
- " '2024-01-17T06:00:00.000000000', '2024-01-17T07:00:00.000000000',\n",
- " '2024-01-17T08:00:00.000000000', '2024-01-17T09:00:00.000000000',\n",
- " '2024-01-17T10:00:00.000000000', '2024-01-17T11:00:00.000000000',\n",
- " '2024-01-17T12:00:00.000000000', '2024-01-17T13:00:00.000000000',\n",
- " '2024-01-17T14:00:00.000000000', '2024-01-17T15:00:00.000000000',\n",
- " '2024-01-17T16:00:00.000000000', '2024-01-17T17:00:00.000000000',\n",
- " '2024-01-17T18:00:00.000000000', '2024-01-17T19:00:00.000000000',\n",
- " '2024-01-17T20:00:00.000000000', '2024-01-17T21:00:00.000000000',\n",
- " '2024-01-17T22:00:00.000000000', '2024-01-17T23:00:00.000000000',\n",
- " '2024-01-18T00:00:00.000000000', '2024-01-18T01:00:00.000000000',\n",
- " '2024-01-18T02:00:00.000000000', '2024-01-18T03:00:00.000000000',\n",
- " '2024-01-18T04:00:00.000000000', '2024-01-18T05:00:00.000000000',\n",
- " '2024-01-18T06:00:00.000000000', '2024-01-18T07:00:00.000000000',\n",
- " '2024-01-18T08:00:00.000000000', '2024-01-18T09:00:00.000000000',\n",
- " '2024-01-18T10:00:00.000000000', '2024-01-18T11:00:00.000000000',\n",
- " '2024-01-18T12:00:00.000000000', '2024-01-18T13:00:00.000000000',\n",
- " '2024-01-18T14:00:00.000000000', '2024-01-18T15:00:00.000000000',\n",
- " '2024-01-18T16:00:00.000000000', '2024-01-18T17:00:00.000000000',\n",
- " '2024-01-18T18:00:00.000000000', '2024-01-18T19:00:00.000000000',\n",
- " '2024-01-18T20:00:00.000000000', '2024-01-18T21:00:00.000000000',\n",
- " '2024-01-18T22:00:00.000000000', '2024-01-18T23:00:00.000000000',\n",
- " '2024-01-19T00:00:00.000000000', '2024-01-19T01:00:00.000000000',\n",
- " '2024-01-19T02:00:00.000000000', '2024-01-19T03:00:00.000000000',\n",
- " '2024-01-19T04:00:00.000000000', '2024-01-19T05:00:00.000000000',\n",
- " '2024-01-19T06:00:00.000000000', '2024-01-19T07:00:00.000000000',\n",
- " '2024-01-19T08:00:00.000000000', '2024-01-19T09:00:00.000000000',\n",
- " '2024-01-19T10:00:00.000000000', '2024-01-19T11:00:00.000000000',\n",
- " '2024-01-19T12:00:00.000000000', '2024-01-19T13:00:00.000000000',\n",
- " '2024-01-19T14:00:00.000000000', '2024-01-19T15:00:00.000000000',\n",
- " '2024-01-19T16:00:00.000000000', '2024-01-19T17:00:00.000000000',\n",
- " '2024-01-19T18:00:00.000000000', '2024-01-19T19:00:00.000000000',\n",
- " '2024-01-19T20:00:00.000000000', '2024-01-19T21:00:00.000000000',\n",
- " '2024-01-19T22:00:00.000000000', '2024-01-19T23:00:00.000000000',\n",
- " '2024-01-20T00:00:00.000000000', '2024-01-20T01:00:00.000000000',\n",
- " '2024-01-20T02:00:00.000000000', '2024-01-20T03:00:00.000000000',\n",
- " '2024-01-20T04:00:00.000000000', '2024-01-20T05:00:00.000000000',\n",
- " '2024-01-20T06:00:00.000000000', '2024-01-20T07:00:00.000000000',\n",
- " '2024-01-20T08:00:00.000000000', '2024-01-20T09:00:00.000000000',\n",
- " '2024-01-20T10:00:00.000000000', '2024-01-20T11:00:00.000000000',\n",
- " '2024-01-20T12:00:00.000000000', '2024-01-20T13:00:00.000000000',\n",
- " '2024-01-20T14:00:00.000000000', '2024-01-20T15:00:00.000000000',\n",
- " '2024-01-20T16:00:00.000000000', '2024-01-20T17:00:00.000000000',\n",
- " '2024-01-20T18:00:00.000000000', '2024-01-20T19:00:00.000000000',\n",
- " '2024-01-20T20:00:00.000000000', '2024-01-20T21:00:00.000000000',\n",
- " '2024-01-20T22:00:00.000000000', '2024-01-20T23:00:00.000000000',\n",
- " '2024-01-21T00:00:00.000000000', '2024-01-21T01:00:00.000000000',\n",
- " '2024-01-21T02:00:00.000000000', '2024-01-21T03:00:00.000000000',\n",
- " '2024-01-21T04:00:00.000000000', '2024-01-21T05:00:00.000000000',\n",
- " '2024-01-21T06:00:00.000000000', '2024-01-21T07:00:00.000000000',\n",
- " '2024-01-21T08:00:00.000000000', '2024-01-21T09:00:00.000000000',\n",
- " '2024-01-21T10:00:00.000000000', '2024-01-21T11:00:00.000000000',\n",
- " '2024-01-21T12:00:00.000000000', '2024-01-21T13:00:00.000000000',\n",
- " '2024-01-21T14:00:00.000000000', '2024-01-21T15:00:00.000000000',\n",
- " '2024-01-21T16:00:00.000000000', '2024-01-21T17:00:00.000000000',\n",
- " '2024-01-21T18:00:00.000000000', '2024-01-21T19:00:00.000000000',\n",
- " '2024-01-21T20:00:00.000000000', '2024-01-21T21:00:00.000000000',\n",
- " '2024-01-21T22:00:00.000000000', '2024-01-21T23:00:00.000000000',\n",
- " '2024-01-22T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('AAAAAAAAAIAKPvjgg49iPby8nSEx72' ... 'AAAAAgvWP9SoFav2g9AAAAAAAA+P8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'variable=ThermalStorage(Charge)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'ThermalStorage(Charge)',\n",
- " 'marker': {'color': '#00CC96', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'ThermalStorage(Charge)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-15T00:00:00.000000000', '2024-01-15T01:00:00.000000000',\n",
- " '2024-01-15T02:00:00.000000000', '2024-01-15T03:00:00.000000000',\n",
- " '2024-01-15T04:00:00.000000000', '2024-01-15T05:00:00.000000000',\n",
- " '2024-01-15T06:00:00.000000000', '2024-01-15T07:00:00.000000000',\n",
- " '2024-01-15T08:00:00.000000000', '2024-01-15T09:00:00.000000000',\n",
- " '2024-01-15T10:00:00.000000000', '2024-01-15T11:00:00.000000000',\n",
- " '2024-01-15T12:00:00.000000000', '2024-01-15T13:00:00.000000000',\n",
- " '2024-01-15T14:00:00.000000000', '2024-01-15T15:00:00.000000000',\n",
- " '2024-01-15T16:00:00.000000000', '2024-01-15T17:00:00.000000000',\n",
- " '2024-01-15T18:00:00.000000000', '2024-01-15T19:00:00.000000000',\n",
- " '2024-01-15T20:00:00.000000000', '2024-01-15T21:00:00.000000000',\n",
- " '2024-01-15T22:00:00.000000000', '2024-01-15T23:00:00.000000000',\n",
- " '2024-01-16T00:00:00.000000000', '2024-01-16T01:00:00.000000000',\n",
- " '2024-01-16T02:00:00.000000000', '2024-01-16T03:00:00.000000000',\n",
- " '2024-01-16T04:00:00.000000000', '2024-01-16T05:00:00.000000000',\n",
- " '2024-01-16T06:00:00.000000000', '2024-01-16T07:00:00.000000000',\n",
- " '2024-01-16T08:00:00.000000000', '2024-01-16T09:00:00.000000000',\n",
- " '2024-01-16T10:00:00.000000000', '2024-01-16T11:00:00.000000000',\n",
- " '2024-01-16T12:00:00.000000000', '2024-01-16T13:00:00.000000000',\n",
- " '2024-01-16T14:00:00.000000000', '2024-01-16T15:00:00.000000000',\n",
- " '2024-01-16T16:00:00.000000000', '2024-01-16T17:00:00.000000000',\n",
- " '2024-01-16T18:00:00.000000000', '2024-01-16T19:00:00.000000000',\n",
- " '2024-01-16T20:00:00.000000000', '2024-01-16T21:00:00.000000000',\n",
- " '2024-01-16T22:00:00.000000000', '2024-01-16T23:00:00.000000000',\n",
- " '2024-01-17T00:00:00.000000000', '2024-01-17T01:00:00.000000000',\n",
- " '2024-01-17T02:00:00.000000000', '2024-01-17T03:00:00.000000000',\n",
- " '2024-01-17T04:00:00.000000000', '2024-01-17T05:00:00.000000000',\n",
- " '2024-01-17T06:00:00.000000000', '2024-01-17T07:00:00.000000000',\n",
- " '2024-01-17T08:00:00.000000000', '2024-01-17T09:00:00.000000000',\n",
- " '2024-01-17T10:00:00.000000000', '2024-01-17T11:00:00.000000000',\n",
- " '2024-01-17T12:00:00.000000000', '2024-01-17T13:00:00.000000000',\n",
- " '2024-01-17T14:00:00.000000000', '2024-01-17T15:00:00.000000000',\n",
- " '2024-01-17T16:00:00.000000000', '2024-01-17T17:00:00.000000000',\n",
- " '2024-01-17T18:00:00.000000000', '2024-01-17T19:00:00.000000000',\n",
- " '2024-01-17T20:00:00.000000000', '2024-01-17T21:00:00.000000000',\n",
- " '2024-01-17T22:00:00.000000000', '2024-01-17T23:00:00.000000000',\n",
- " '2024-01-18T00:00:00.000000000', '2024-01-18T01:00:00.000000000',\n",
- " '2024-01-18T02:00:00.000000000', '2024-01-18T03:00:00.000000000',\n",
- " '2024-01-18T04:00:00.000000000', '2024-01-18T05:00:00.000000000',\n",
- " '2024-01-18T06:00:00.000000000', '2024-01-18T07:00:00.000000000',\n",
- " '2024-01-18T08:00:00.000000000', '2024-01-18T09:00:00.000000000',\n",
- " '2024-01-18T10:00:00.000000000', '2024-01-18T11:00:00.000000000',\n",
- " '2024-01-18T12:00:00.000000000', '2024-01-18T13:00:00.000000000',\n",
- " '2024-01-18T14:00:00.000000000', '2024-01-18T15:00:00.000000000',\n",
- " '2024-01-18T16:00:00.000000000', '2024-01-18T17:00:00.000000000',\n",
- " '2024-01-18T18:00:00.000000000', '2024-01-18T19:00:00.000000000',\n",
- " '2024-01-18T20:00:00.000000000', '2024-01-18T21:00:00.000000000',\n",
- " '2024-01-18T22:00:00.000000000', '2024-01-18T23:00:00.000000000',\n",
- " '2024-01-19T00:00:00.000000000', '2024-01-19T01:00:00.000000000',\n",
- " '2024-01-19T02:00:00.000000000', '2024-01-19T03:00:00.000000000',\n",
- " '2024-01-19T04:00:00.000000000', '2024-01-19T05:00:00.000000000',\n",
- " '2024-01-19T06:00:00.000000000', '2024-01-19T07:00:00.000000000',\n",
- " '2024-01-19T08:00:00.000000000', '2024-01-19T09:00:00.000000000',\n",
- " '2024-01-19T10:00:00.000000000', '2024-01-19T11:00:00.000000000',\n",
- " '2024-01-19T12:00:00.000000000', '2024-01-19T13:00:00.000000000',\n",
- " '2024-01-19T14:00:00.000000000', '2024-01-19T15:00:00.000000000',\n",
- " '2024-01-19T16:00:00.000000000', '2024-01-19T17:00:00.000000000',\n",
- " '2024-01-19T18:00:00.000000000', '2024-01-19T19:00:00.000000000',\n",
- " '2024-01-19T20:00:00.000000000', '2024-01-19T21:00:00.000000000',\n",
- " '2024-01-19T22:00:00.000000000', '2024-01-19T23:00:00.000000000',\n",
- " '2024-01-20T00:00:00.000000000', '2024-01-20T01:00:00.000000000',\n",
- " '2024-01-20T02:00:00.000000000', '2024-01-20T03:00:00.000000000',\n",
- " '2024-01-20T04:00:00.000000000', '2024-01-20T05:00:00.000000000',\n",
- " '2024-01-20T06:00:00.000000000', '2024-01-20T07:00:00.000000000',\n",
- " '2024-01-20T08:00:00.000000000', '2024-01-20T09:00:00.000000000',\n",
- " '2024-01-20T10:00:00.000000000', '2024-01-20T11:00:00.000000000',\n",
- " '2024-01-20T12:00:00.000000000', '2024-01-20T13:00:00.000000000',\n",
- " '2024-01-20T14:00:00.000000000', '2024-01-20T15:00:00.000000000',\n",
- " '2024-01-20T16:00:00.000000000', '2024-01-20T17:00:00.000000000',\n",
- " '2024-01-20T18:00:00.000000000', '2024-01-20T19:00:00.000000000',\n",
- " '2024-01-20T20:00:00.000000000', '2024-01-20T21:00:00.000000000',\n",
- " '2024-01-20T22:00:00.000000000', '2024-01-20T23:00:00.000000000',\n",
- " '2024-01-21T00:00:00.000000000', '2024-01-21T01:00:00.000000000',\n",
- " '2024-01-21T02:00:00.000000000', '2024-01-21T03:00:00.000000000',\n",
- " '2024-01-21T04:00:00.000000000', '2024-01-21T05:00:00.000000000',\n",
- " '2024-01-21T06:00:00.000000000', '2024-01-21T07:00:00.000000000',\n",
- " '2024-01-21T08:00:00.000000000', '2024-01-21T09:00:00.000000000',\n",
- " '2024-01-21T10:00:00.000000000', '2024-01-21T11:00:00.000000000',\n",
- " '2024-01-21T12:00:00.000000000', '2024-01-21T13:00:00.000000000',\n",
- " '2024-01-21T14:00:00.000000000', '2024-01-21T15:00:00.000000000',\n",
- " '2024-01-21T16:00:00.000000000', '2024-01-21T17:00:00.000000000',\n",
- " '2024-01-21T18:00:00.000000000', '2024-01-21T19:00:00.000000000',\n",
- " '2024-01-21T20:00:00.000000000', '2024-01-21T21:00:00.000000000',\n",
- " '2024-01-21T22:00:00.000000000', '2024-01-21T23:00:00.000000000',\n",
- " '2024-01-22T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('AAAAAAAAAAAUfPDBB19avby8nSEx72' ... 'AAAAAAANj//////1hAAAAAAAAA+H8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'variable=Office(Heat)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'Office(Heat)',\n",
- " 'marker': {'color': '#AB63FA', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'Office(Heat)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-15T00:00:00.000000000', '2024-01-15T01:00:00.000000000',\n",
- " '2024-01-15T02:00:00.000000000', '2024-01-15T03:00:00.000000000',\n",
- " '2024-01-15T04:00:00.000000000', '2024-01-15T05:00:00.000000000',\n",
- " '2024-01-15T06:00:00.000000000', '2024-01-15T07:00:00.000000000',\n",
- " '2024-01-15T08:00:00.000000000', '2024-01-15T09:00:00.000000000',\n",
- " '2024-01-15T10:00:00.000000000', '2024-01-15T11:00:00.000000000',\n",
- " '2024-01-15T12:00:00.000000000', '2024-01-15T13:00:00.000000000',\n",
- " '2024-01-15T14:00:00.000000000', '2024-01-15T15:00:00.000000000',\n",
- " '2024-01-15T16:00:00.000000000', '2024-01-15T17:00:00.000000000',\n",
- " '2024-01-15T18:00:00.000000000', '2024-01-15T19:00:00.000000000',\n",
- " '2024-01-15T20:00:00.000000000', '2024-01-15T21:00:00.000000000',\n",
- " '2024-01-15T22:00:00.000000000', '2024-01-15T23:00:00.000000000',\n",
- " '2024-01-16T00:00:00.000000000', '2024-01-16T01:00:00.000000000',\n",
- " '2024-01-16T02:00:00.000000000', '2024-01-16T03:00:00.000000000',\n",
- " '2024-01-16T04:00:00.000000000', '2024-01-16T05:00:00.000000000',\n",
- " '2024-01-16T06:00:00.000000000', '2024-01-16T07:00:00.000000000',\n",
- " '2024-01-16T08:00:00.000000000', '2024-01-16T09:00:00.000000000',\n",
- " '2024-01-16T10:00:00.000000000', '2024-01-16T11:00:00.000000000',\n",
- " '2024-01-16T12:00:00.000000000', '2024-01-16T13:00:00.000000000',\n",
- " '2024-01-16T14:00:00.000000000', '2024-01-16T15:00:00.000000000',\n",
- " '2024-01-16T16:00:00.000000000', '2024-01-16T17:00:00.000000000',\n",
- " '2024-01-16T18:00:00.000000000', '2024-01-16T19:00:00.000000000',\n",
- " '2024-01-16T20:00:00.000000000', '2024-01-16T21:00:00.000000000',\n",
- " '2024-01-16T22:00:00.000000000', '2024-01-16T23:00:00.000000000',\n",
- " '2024-01-17T00:00:00.000000000', '2024-01-17T01:00:00.000000000',\n",
- " '2024-01-17T02:00:00.000000000', '2024-01-17T03:00:00.000000000',\n",
- " '2024-01-17T04:00:00.000000000', '2024-01-17T05:00:00.000000000',\n",
- " '2024-01-17T06:00:00.000000000', '2024-01-17T07:00:00.000000000',\n",
- " '2024-01-17T08:00:00.000000000', '2024-01-17T09:00:00.000000000',\n",
- " '2024-01-17T10:00:00.000000000', '2024-01-17T11:00:00.000000000',\n",
- " '2024-01-17T12:00:00.000000000', '2024-01-17T13:00:00.000000000',\n",
- " '2024-01-17T14:00:00.000000000', '2024-01-17T15:00:00.000000000',\n",
- " '2024-01-17T16:00:00.000000000', '2024-01-17T17:00:00.000000000',\n",
- " '2024-01-17T18:00:00.000000000', '2024-01-17T19:00:00.000000000',\n",
- " '2024-01-17T20:00:00.000000000', '2024-01-17T21:00:00.000000000',\n",
- " '2024-01-17T22:00:00.000000000', '2024-01-17T23:00:00.000000000',\n",
- " '2024-01-18T00:00:00.000000000', '2024-01-18T01:00:00.000000000',\n",
- " '2024-01-18T02:00:00.000000000', '2024-01-18T03:00:00.000000000',\n",
- " '2024-01-18T04:00:00.000000000', '2024-01-18T05:00:00.000000000',\n",
- " '2024-01-18T06:00:00.000000000', '2024-01-18T07:00:00.000000000',\n",
- " '2024-01-18T08:00:00.000000000', '2024-01-18T09:00:00.000000000',\n",
- " '2024-01-18T10:00:00.000000000', '2024-01-18T11:00:00.000000000',\n",
- " '2024-01-18T12:00:00.000000000', '2024-01-18T13:00:00.000000000',\n",
- " '2024-01-18T14:00:00.000000000', '2024-01-18T15:00:00.000000000',\n",
- " '2024-01-18T16:00:00.000000000', '2024-01-18T17:00:00.000000000',\n",
- " '2024-01-18T18:00:00.000000000', '2024-01-18T19:00:00.000000000',\n",
- " '2024-01-18T20:00:00.000000000', '2024-01-18T21:00:00.000000000',\n",
- " '2024-01-18T22:00:00.000000000', '2024-01-18T23:00:00.000000000',\n",
- " '2024-01-19T00:00:00.000000000', '2024-01-19T01:00:00.000000000',\n",
- " '2024-01-19T02:00:00.000000000', '2024-01-19T03:00:00.000000000',\n",
- " '2024-01-19T04:00:00.000000000', '2024-01-19T05:00:00.000000000',\n",
- " '2024-01-19T06:00:00.000000000', '2024-01-19T07:00:00.000000000',\n",
- " '2024-01-19T08:00:00.000000000', '2024-01-19T09:00:00.000000000',\n",
- " '2024-01-19T10:00:00.000000000', '2024-01-19T11:00:00.000000000',\n",
- " '2024-01-19T12:00:00.000000000', '2024-01-19T13:00:00.000000000',\n",
- " '2024-01-19T14:00:00.000000000', '2024-01-19T15:00:00.000000000',\n",
- " '2024-01-19T16:00:00.000000000', '2024-01-19T17:00:00.000000000',\n",
- " '2024-01-19T18:00:00.000000000', '2024-01-19T19:00:00.000000000',\n",
- " '2024-01-19T20:00:00.000000000', '2024-01-19T21:00:00.000000000',\n",
- " '2024-01-19T22:00:00.000000000', '2024-01-19T23:00:00.000000000',\n",
- " '2024-01-20T00:00:00.000000000', '2024-01-20T01:00:00.000000000',\n",
- " '2024-01-20T02:00:00.000000000', '2024-01-20T03:00:00.000000000',\n",
- " '2024-01-20T04:00:00.000000000', '2024-01-20T05:00:00.000000000',\n",
- " '2024-01-20T06:00:00.000000000', '2024-01-20T07:00:00.000000000',\n",
- " '2024-01-20T08:00:00.000000000', '2024-01-20T09:00:00.000000000',\n",
- " '2024-01-20T10:00:00.000000000', '2024-01-20T11:00:00.000000000',\n",
- " '2024-01-20T12:00:00.000000000', '2024-01-20T13:00:00.000000000',\n",
- " '2024-01-20T14:00:00.000000000', '2024-01-20T15:00:00.000000000',\n",
- " '2024-01-20T16:00:00.000000000', '2024-01-20T17:00:00.000000000',\n",
- " '2024-01-20T18:00:00.000000000', '2024-01-20T19:00:00.000000000',\n",
- " '2024-01-20T20:00:00.000000000', '2024-01-20T21:00:00.000000000',\n",
- " '2024-01-20T22:00:00.000000000', '2024-01-20T23:00:00.000000000',\n",
- " '2024-01-21T00:00:00.000000000', '2024-01-21T01:00:00.000000000',\n",
- " '2024-01-21T02:00:00.000000000', '2024-01-21T03:00:00.000000000',\n",
- " '2024-01-21T04:00:00.000000000', '2024-01-21T05:00:00.000000000',\n",
- " '2024-01-21T06:00:00.000000000', '2024-01-21T07:00:00.000000000',\n",
- " '2024-01-21T08:00:00.000000000', '2024-01-21T09:00:00.000000000',\n",
- " '2024-01-21T10:00:00.000000000', '2024-01-21T11:00:00.000000000',\n",
- " '2024-01-21T12:00:00.000000000', '2024-01-21T13:00:00.000000000',\n",
- " '2024-01-21T14:00:00.000000000', '2024-01-21T15:00:00.000000000',\n",
- " '2024-01-21T16:00:00.000000000', '2024-01-21T17:00:00.000000000',\n",
- " '2024-01-21T18:00:00.000000000', '2024-01-21T19:00:00.000000000',\n",
- " '2024-01-21T20:00:00.000000000', '2024-01-21T21:00:00.000000000',\n",
- " '2024-01-21T22:00:00.000000000', '2024-01-21T23:00:00.000000000',\n",
- " '2024-01-22T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('5ZuWpeU9QEDMU8WNBU89QGDXQkqFnk' ... 'AAAAA0QK7n4h/lezhAAAAAAAAA+H8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'}],\n",
- " 'layout': {'bargap': 0,\n",
- " 'bargroupgap': 0,\n",
- " 'barmode': 'relative',\n",
- " 'legend': {'title': {'text': 'variable'}, 'tracegroupgap': 0},\n",
- " 'template': '...',\n",
- " 'title': {'text': 'Heat (flow_rate)'},\n",
- " 'xaxis': {'anchor': 'y', 'domain': [0.0, 1.0], 'title': {'text': 'time'}},\n",
- " 'yaxis': {'anchor': 'x', 'domain': [0.0, 1.0], 'title': {'text': 'value'}}}\n",
- "}))"
- ],
- "text/html": [
- ""
- ]
- },
- "execution_count": 4,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "execution_count": 4
+ ]
},
{
"cell_type": "markdown",
"id": "9",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-12T12:06:35.534937Z",
- "start_time": "2025-12-12T12:06:35.496736Z"
- }
- },
- "source": "### Accessing Plot Data\n\nEvery plot returns a `PlotResult` with both the figure and underlying data. Use `.data.to_dataframe()` to get a pandas DataFrame:"
+ "metadata": {},
+ "source": [
+ "### Accessing Plot Data\n",
+ "\n",
+ "Every plot returns a `PlotResult` with both the figure and underlying data. Use `.data.to_dataframe()` to get a pandas DataFrame:"
+ ]
},
{
"cell_type": "code",
+ "execution_count": null,
"id": "10",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T14:13:15.732085Z",
- "start_time": "2025-12-13T14:13:15.577916Z"
- }
- },
+ "metadata": {},
+ "outputs": [],
"source": [
"# Get plot result and access the underlying data\n",
"result = simple.statistics.plot.balance('Heat', show=False)\n",
@@ -610,2013 +138,127 @@
"# Convert to DataFrame for easy viewing/export\n",
"df = result.data.to_dataframe()\n",
"df.head(10)"
- ],
- "outputs": [
- {
- "data": {
- "text/plain": [
- " Boiler(Heat) ThermalStorage(Discharge) \\\n",
- "time \n",
- "2024-01-15 00:00:00 -32.483571 -0.000000e+00 \n",
- "2024-01-15 01:00:00 -29.308678 5.275242e-13 \n",
- "2024-01-15 02:00:00 -33.238443 -7.086767e-13 \n",
- "2024-01-15 03:00:00 -101.411593 -3.516828e-13 \n",
- "2024-01-15 04:00:00 -128.829233 -5.613288e-13 \n",
- "2024-01-15 05:00:00 -128.829315 -7.033655e-13 \n",
- "2024-01-15 06:00:00 -0.000000 -3.789606e+01 \n",
- "2024-01-15 07:00:00 -0.000000 -8.383717e+01 \n",
- "2024-01-15 08:00:00 -0.000000 -7.765263e+01 \n",
- "2024-01-15 09:00:00 -0.000000 -8.271280e+01 \n",
- "\n",
- " ThermalStorage(Charge) Office(Heat) \n",
- "time \n",
- "2024-01-15 00:00:00 0.000000e+00 32.483571 \n",
- "2024-01-15 01:00:00 -3.747575e-13 29.308678 \n",
- "2024-01-15 02:00:00 8.792069e-13 33.238443 \n",
- "2024-01-15 03:00:00 6.379644e+01 37.615149 \n",
- "2024-01-15 04:00:00 1.000000e+02 28.829233 \n",
- "2024-01-15 05:00:00 1.000000e+02 28.829315 \n",
- "2024-01-15 06:00:00 1.055048e-12 37.896064 \n",
- "2024-01-15 07:00:00 7.033655e-13 83.837174 \n",
- "2024-01-15 08:00:00 -7.673862e-13 77.652628 \n",
- "2024-01-15 09:00:00 7.033655e-13 82.712800 "
- ],
- "text/html": [
- "\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " | \n",
- " Boiler(Heat) | \n",
- " ThermalStorage(Discharge) | \n",
- " ThermalStorage(Charge) | \n",
- " Office(Heat) | \n",
- "
\n",
- " \n",
- " | time | \n",
- " | \n",
- " | \n",
- " | \n",
- " | \n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " | 2024-01-15 00:00:00 | \n",
- " -32.483571 | \n",
- " -0.000000e+00 | \n",
- " 0.000000e+00 | \n",
- " 32.483571 | \n",
- "
\n",
- " \n",
- " | 2024-01-15 01:00:00 | \n",
- " -29.308678 | \n",
- " 5.275242e-13 | \n",
- " -3.747575e-13 | \n",
- " 29.308678 | \n",
- "
\n",
- " \n",
- " | 2024-01-15 02:00:00 | \n",
- " -33.238443 | \n",
- " -7.086767e-13 | \n",
- " 8.792069e-13 | \n",
- " 33.238443 | \n",
- "
\n",
- " \n",
- " | 2024-01-15 03:00:00 | \n",
- " -101.411593 | \n",
- " -3.516828e-13 | \n",
- " 6.379644e+01 | \n",
- " 37.615149 | \n",
- "
\n",
- " \n",
- " | 2024-01-15 04:00:00 | \n",
- " -128.829233 | \n",
- " -5.613288e-13 | \n",
- " 1.000000e+02 | \n",
- " 28.829233 | \n",
- "
\n",
- " \n",
- " | 2024-01-15 05:00:00 | \n",
- " -128.829315 | \n",
- " -7.033655e-13 | \n",
- " 1.000000e+02 | \n",
- " 28.829315 | \n",
- "
\n",
- " \n",
- " | 2024-01-15 06:00:00 | \n",
- " -0.000000 | \n",
- " -3.789606e+01 | \n",
- " 1.055048e-12 | \n",
- " 37.896064 | \n",
- "
\n",
- " \n",
- " | 2024-01-15 07:00:00 | \n",
- " -0.000000 | \n",
- " -8.383717e+01 | \n",
- " 7.033655e-13 | \n",
- " 83.837174 | \n",
- "
\n",
- " \n",
- " | 2024-01-15 08:00:00 | \n",
- " -0.000000 | \n",
- " -7.765263e+01 | \n",
- " -7.673862e-13 | \n",
- " 77.652628 | \n",
- "
\n",
- " \n",
- " | 2024-01-15 09:00:00 | \n",
- " -0.000000 | \n",
- " -8.271280e+01 | \n",
- " 7.033655e-13 | \n",
- " 82.712800 | \n",
- "
\n",
- " \n",
- "
\n",
- "
"
- ]
- },
- "execution_count": 5,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "execution_count": 5
+ ]
},
{
"cell_type": "markdown",
"id": "11",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-12T12:06:35.617665Z",
- "start_time": "2025-12-12T12:06:35.585811Z"
- }
- },
- "source": "### Energy Totals\n\nGet total energy by flow using `flow_hours`:"
+ "metadata": {},
+ "source": [
+ "### Energy Totals\n",
+ "\n",
+ "Get total energy by flow using `flow_hours`:"
+ ]
},
{
"cell_type": "code",
+ "execution_count": null,
"id": "12",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T14:13:15.948455Z",
- "start_time": "2025-12-13T14:13:15.924150Z"
- }
- },
- "source": "import pandas as pd\n\n# Total energy per flow\ntotals = {var: float(simple.statistics.flow_hours[var].sum()) for var in simple.statistics.flow_hours.data_vars}\n\npd.Series(totals, name='Energy [kWh]').to_frame().T",
- "outputs": [
- {
- "data": {
- "text/plain": [
- " GasGrid(Gas) Boiler(Gas) Boiler(Heat) ThermalStorage(Charge) \\\n",
- "Energy [kWh] 8936.665406 8936.665406 8221.732173 3457.182735 \n",
- "\n",
- " ThermalStorage(Discharge) Office(Heat) \n",
- "Energy [kWh] 3242.788948 8007.338386 "
- ],
- "text/html": [
- "\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " | \n",
- " GasGrid(Gas) | \n",
- " Boiler(Gas) | \n",
- " Boiler(Heat) | \n",
- " ThermalStorage(Charge) | \n",
- " ThermalStorage(Discharge) | \n",
- " Office(Heat) | \n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " | Energy [kWh] | \n",
- " 8936.665406 | \n",
- " 8936.665406 | \n",
- " 8221.732173 | \n",
- " 3457.182735 | \n",
- " 3242.788948 | \n",
- " 8007.338386 | \n",
- "
\n",
- " \n",
- "
\n",
- "
"
- ]
- },
- "execution_count": 6,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "execution_count": 6
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "import pandas as pd\n",
+ "\n",
+ "# Total energy per flow\n",
+ "totals = {var: float(simple.statistics.flow_hours[var].sum()) for var in simple.statistics.flow_hours.data_vars}\n",
+ "\n",
+ "pd.Series(totals, name='Energy [kWh]').to_frame().T"
+ ]
},
{
"cell_type": "markdown",
"id": "13",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-12T12:06:35.754890Z",
- "start_time": "2025-12-12T12:06:35.735084Z"
- }
- },
- "source": "## 3. Time Series Plots"
+ "metadata": {},
+ "source": [
+ "## 3. Time Series Plots"
+ ]
},
{
"cell_type": "markdown",
"id": "14",
"metadata": {},
- "source": "### 3.1 Balance Plot\n\nShows inflows (positive) and outflows (negative) for a bus or component:"
+ "source": [
+ "### 3.1 Balance Plot\n",
+ "\n",
+ "Shows inflows (positive) and outflows (negative) for a bus or component:"
+ ]
},
{
"cell_type": "code",
+ "execution_count": null,
"id": "15",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T14:13:16.412850Z",
- "start_time": "2025-12-13T14:13:16.305115Z"
- }
- },
+ "metadata": {},
+ "outputs": [],
"source": [
"# Component balance (all flows of a component)\n",
"simple.statistics.plot.balance('ThermalStorage')"
- ],
- "outputs": [
- {
- "data": {
- "text/plain": [
- "PlotResult(data= Size: 4kB\n",
- "Dimensions: (time: 169)\n",
- "Coordinates:\n",
- " * time (time) datetime64[ns] 1kB 2024-01-15 ... 2024-...\n",
- "Data variables:\n",
- " ThermalStorage(Charge) (time) float64 1kB -0.0 3.748e-13 ... -100.0 nan\n",
- " ThermalStorage(Discharge) (time) float64 1kB 0.0 -5.275e-13 ... nan, figure=Figure({\n",
- " 'data': [{'hovertemplate': 'variable=ThermalStorage(Charge)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'ThermalStorage(Charge)',\n",
- " 'marker': {'color': '#D62728', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'ThermalStorage(Charge)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-15T00:00:00.000000000', '2024-01-15T01:00:00.000000000',\n",
- " '2024-01-15T02:00:00.000000000', '2024-01-15T03:00:00.000000000',\n",
- " '2024-01-15T04:00:00.000000000', '2024-01-15T05:00:00.000000000',\n",
- " '2024-01-15T06:00:00.000000000', '2024-01-15T07:00:00.000000000',\n",
- " '2024-01-15T08:00:00.000000000', '2024-01-15T09:00:00.000000000',\n",
- " '2024-01-15T10:00:00.000000000', '2024-01-15T11:00:00.000000000',\n",
- " '2024-01-15T12:00:00.000000000', '2024-01-15T13:00:00.000000000',\n",
- " '2024-01-15T14:00:00.000000000', '2024-01-15T15:00:00.000000000',\n",
- " '2024-01-15T16:00:00.000000000', '2024-01-15T17:00:00.000000000',\n",
- " '2024-01-15T18:00:00.000000000', '2024-01-15T19:00:00.000000000',\n",
- " '2024-01-15T20:00:00.000000000', '2024-01-15T21:00:00.000000000',\n",
- " '2024-01-15T22:00:00.000000000', '2024-01-15T23:00:00.000000000',\n",
- " '2024-01-16T00:00:00.000000000', '2024-01-16T01:00:00.000000000',\n",
- " '2024-01-16T02:00:00.000000000', '2024-01-16T03:00:00.000000000',\n",
- " '2024-01-16T04:00:00.000000000', '2024-01-16T05:00:00.000000000',\n",
- " '2024-01-16T06:00:00.000000000', '2024-01-16T07:00:00.000000000',\n",
- " '2024-01-16T08:00:00.000000000', '2024-01-16T09:00:00.000000000',\n",
- " '2024-01-16T10:00:00.000000000', '2024-01-16T11:00:00.000000000',\n",
- " '2024-01-16T12:00:00.000000000', '2024-01-16T13:00:00.000000000',\n",
- " '2024-01-16T14:00:00.000000000', '2024-01-16T15:00:00.000000000',\n",
- " '2024-01-16T16:00:00.000000000', '2024-01-16T17:00:00.000000000',\n",
- " '2024-01-16T18:00:00.000000000', '2024-01-16T19:00:00.000000000',\n",
- " '2024-01-16T20:00:00.000000000', '2024-01-16T21:00:00.000000000',\n",
- " '2024-01-16T22:00:00.000000000', '2024-01-16T23:00:00.000000000',\n",
- " '2024-01-17T00:00:00.000000000', '2024-01-17T01:00:00.000000000',\n",
- " '2024-01-17T02:00:00.000000000', '2024-01-17T03:00:00.000000000',\n",
- " '2024-01-17T04:00:00.000000000', '2024-01-17T05:00:00.000000000',\n",
- " '2024-01-17T06:00:00.000000000', '2024-01-17T07:00:00.000000000',\n",
- " '2024-01-17T08:00:00.000000000', '2024-01-17T09:00:00.000000000',\n",
- " '2024-01-17T10:00:00.000000000', '2024-01-17T11:00:00.000000000',\n",
- " '2024-01-17T12:00:00.000000000', '2024-01-17T13:00:00.000000000',\n",
- " '2024-01-17T14:00:00.000000000', '2024-01-17T15:00:00.000000000',\n",
- " '2024-01-17T16:00:00.000000000', '2024-01-17T17:00:00.000000000',\n",
- " '2024-01-17T18:00:00.000000000', '2024-01-17T19:00:00.000000000',\n",
- " '2024-01-17T20:00:00.000000000', '2024-01-17T21:00:00.000000000',\n",
- " '2024-01-17T22:00:00.000000000', '2024-01-17T23:00:00.000000000',\n",
- " '2024-01-18T00:00:00.000000000', '2024-01-18T01:00:00.000000000',\n",
- " '2024-01-18T02:00:00.000000000', '2024-01-18T03:00:00.000000000',\n",
- " '2024-01-18T04:00:00.000000000', '2024-01-18T05:00:00.000000000',\n",
- " '2024-01-18T06:00:00.000000000', '2024-01-18T07:00:00.000000000',\n",
- " '2024-01-18T08:00:00.000000000', '2024-01-18T09:00:00.000000000',\n",
- " '2024-01-18T10:00:00.000000000', '2024-01-18T11:00:00.000000000',\n",
- " '2024-01-18T12:00:00.000000000', '2024-01-18T13:00:00.000000000',\n",
- " '2024-01-18T14:00:00.000000000', '2024-01-18T15:00:00.000000000',\n",
- " '2024-01-18T16:00:00.000000000', '2024-01-18T17:00:00.000000000',\n",
- " '2024-01-18T18:00:00.000000000', '2024-01-18T19:00:00.000000000',\n",
- " '2024-01-18T20:00:00.000000000', '2024-01-18T21:00:00.000000000',\n",
- " '2024-01-18T22:00:00.000000000', '2024-01-18T23:00:00.000000000',\n",
- " '2024-01-19T00:00:00.000000000', '2024-01-19T01:00:00.000000000',\n",
- " '2024-01-19T02:00:00.000000000', '2024-01-19T03:00:00.000000000',\n",
- " '2024-01-19T04:00:00.000000000', '2024-01-19T05:00:00.000000000',\n",
- " '2024-01-19T06:00:00.000000000', '2024-01-19T07:00:00.000000000',\n",
- " '2024-01-19T08:00:00.000000000', '2024-01-19T09:00:00.000000000',\n",
- " '2024-01-19T10:00:00.000000000', '2024-01-19T11:00:00.000000000',\n",
- " '2024-01-19T12:00:00.000000000', '2024-01-19T13:00:00.000000000',\n",
- " '2024-01-19T14:00:00.000000000', '2024-01-19T15:00:00.000000000',\n",
- " '2024-01-19T16:00:00.000000000', '2024-01-19T17:00:00.000000000',\n",
- " '2024-01-19T18:00:00.000000000', '2024-01-19T19:00:00.000000000',\n",
- " '2024-01-19T20:00:00.000000000', '2024-01-19T21:00:00.000000000',\n",
- " '2024-01-19T22:00:00.000000000', '2024-01-19T23:00:00.000000000',\n",
- " '2024-01-20T00:00:00.000000000', '2024-01-20T01:00:00.000000000',\n",
- " '2024-01-20T02:00:00.000000000', '2024-01-20T03:00:00.000000000',\n",
- " '2024-01-20T04:00:00.000000000', '2024-01-20T05:00:00.000000000',\n",
- " '2024-01-20T06:00:00.000000000', '2024-01-20T07:00:00.000000000',\n",
- " '2024-01-20T08:00:00.000000000', '2024-01-20T09:00:00.000000000',\n",
- " '2024-01-20T10:00:00.000000000', '2024-01-20T11:00:00.000000000',\n",
- " '2024-01-20T12:00:00.000000000', '2024-01-20T13:00:00.000000000',\n",
- " '2024-01-20T14:00:00.000000000', '2024-01-20T15:00:00.000000000',\n",
- " '2024-01-20T16:00:00.000000000', '2024-01-20T17:00:00.000000000',\n",
- " '2024-01-20T18:00:00.000000000', '2024-01-20T19:00:00.000000000',\n",
- " '2024-01-20T20:00:00.000000000', '2024-01-20T21:00:00.000000000',\n",
- " '2024-01-20T22:00:00.000000000', '2024-01-20T23:00:00.000000000',\n",
- " '2024-01-21T00:00:00.000000000', '2024-01-21T01:00:00.000000000',\n",
- " '2024-01-21T02:00:00.000000000', '2024-01-21T03:00:00.000000000',\n",
- " '2024-01-21T04:00:00.000000000', '2024-01-21T05:00:00.000000000',\n",
- " '2024-01-21T06:00:00.000000000', '2024-01-21T07:00:00.000000000',\n",
- " '2024-01-21T08:00:00.000000000', '2024-01-21T09:00:00.000000000',\n",
- " '2024-01-21T10:00:00.000000000', '2024-01-21T11:00:00.000000000',\n",
- " '2024-01-21T12:00:00.000000000', '2024-01-21T13:00:00.000000000',\n",
- " '2024-01-21T14:00:00.000000000', '2024-01-21T15:00:00.000000000',\n",
- " '2024-01-21T16:00:00.000000000', '2024-01-21T17:00:00.000000000',\n",
- " '2024-01-21T18:00:00.000000000', '2024-01-21T19:00:00.000000000',\n",
- " '2024-01-21T20:00:00.000000000', '2024-01-21T21:00:00.000000000',\n",
- " '2024-01-21T22:00:00.000000000', '2024-01-21T23:00:00.000000000',\n",
- " '2024-01-22T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('AAAAAAAAAIAUfPDBB19aPby8nSEx72' ... 'AAAAAAgNj//////1jAAAAAAAAA+P8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'variable=ThermalStorage(Discharge)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'ThermalStorage(Discharge)',\n",
- " 'marker': {'color': '#D62728', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'ThermalStorage(Discharge)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-15T00:00:00.000000000', '2024-01-15T01:00:00.000000000',\n",
- " '2024-01-15T02:00:00.000000000', '2024-01-15T03:00:00.000000000',\n",
- " '2024-01-15T04:00:00.000000000', '2024-01-15T05:00:00.000000000',\n",
- " '2024-01-15T06:00:00.000000000', '2024-01-15T07:00:00.000000000',\n",
- " '2024-01-15T08:00:00.000000000', '2024-01-15T09:00:00.000000000',\n",
- " '2024-01-15T10:00:00.000000000', '2024-01-15T11:00:00.000000000',\n",
- " '2024-01-15T12:00:00.000000000', '2024-01-15T13:00:00.000000000',\n",
- " '2024-01-15T14:00:00.000000000', '2024-01-15T15:00:00.000000000',\n",
- " '2024-01-15T16:00:00.000000000', '2024-01-15T17:00:00.000000000',\n",
- " '2024-01-15T18:00:00.000000000', '2024-01-15T19:00:00.000000000',\n",
- " '2024-01-15T20:00:00.000000000', '2024-01-15T21:00:00.000000000',\n",
- " '2024-01-15T22:00:00.000000000', '2024-01-15T23:00:00.000000000',\n",
- " '2024-01-16T00:00:00.000000000', '2024-01-16T01:00:00.000000000',\n",
- " '2024-01-16T02:00:00.000000000', '2024-01-16T03:00:00.000000000',\n",
- " '2024-01-16T04:00:00.000000000', '2024-01-16T05:00:00.000000000',\n",
- " '2024-01-16T06:00:00.000000000', '2024-01-16T07:00:00.000000000',\n",
- " '2024-01-16T08:00:00.000000000', '2024-01-16T09:00:00.000000000',\n",
- " '2024-01-16T10:00:00.000000000', '2024-01-16T11:00:00.000000000',\n",
- " '2024-01-16T12:00:00.000000000', '2024-01-16T13:00:00.000000000',\n",
- " '2024-01-16T14:00:00.000000000', '2024-01-16T15:00:00.000000000',\n",
- " '2024-01-16T16:00:00.000000000', '2024-01-16T17:00:00.000000000',\n",
- " '2024-01-16T18:00:00.000000000', '2024-01-16T19:00:00.000000000',\n",
- " '2024-01-16T20:00:00.000000000', '2024-01-16T21:00:00.000000000',\n",
- " '2024-01-16T22:00:00.000000000', '2024-01-16T23:00:00.000000000',\n",
- " '2024-01-17T00:00:00.000000000', '2024-01-17T01:00:00.000000000',\n",
- " '2024-01-17T02:00:00.000000000', '2024-01-17T03:00:00.000000000',\n",
- " '2024-01-17T04:00:00.000000000', '2024-01-17T05:00:00.000000000',\n",
- " '2024-01-17T06:00:00.000000000', '2024-01-17T07:00:00.000000000',\n",
- " '2024-01-17T08:00:00.000000000', '2024-01-17T09:00:00.000000000',\n",
- " '2024-01-17T10:00:00.000000000', '2024-01-17T11:00:00.000000000',\n",
- " '2024-01-17T12:00:00.000000000', '2024-01-17T13:00:00.000000000',\n",
- " '2024-01-17T14:00:00.000000000', '2024-01-17T15:00:00.000000000',\n",
- " '2024-01-17T16:00:00.000000000', '2024-01-17T17:00:00.000000000',\n",
- " '2024-01-17T18:00:00.000000000', '2024-01-17T19:00:00.000000000',\n",
- " '2024-01-17T20:00:00.000000000', '2024-01-17T21:00:00.000000000',\n",
- " '2024-01-17T22:00:00.000000000', '2024-01-17T23:00:00.000000000',\n",
- " '2024-01-18T00:00:00.000000000', '2024-01-18T01:00:00.000000000',\n",
- " '2024-01-18T02:00:00.000000000', '2024-01-18T03:00:00.000000000',\n",
- " '2024-01-18T04:00:00.000000000', '2024-01-18T05:00:00.000000000',\n",
- " '2024-01-18T06:00:00.000000000', '2024-01-18T07:00:00.000000000',\n",
- " '2024-01-18T08:00:00.000000000', '2024-01-18T09:00:00.000000000',\n",
- " '2024-01-18T10:00:00.000000000', '2024-01-18T11:00:00.000000000',\n",
- " '2024-01-18T12:00:00.000000000', '2024-01-18T13:00:00.000000000',\n",
- " '2024-01-18T14:00:00.000000000', '2024-01-18T15:00:00.000000000',\n",
- " '2024-01-18T16:00:00.000000000', '2024-01-18T17:00:00.000000000',\n",
- " '2024-01-18T18:00:00.000000000', '2024-01-18T19:00:00.000000000',\n",
- " '2024-01-18T20:00:00.000000000', '2024-01-18T21:00:00.000000000',\n",
- " '2024-01-18T22:00:00.000000000', '2024-01-18T23:00:00.000000000',\n",
- " '2024-01-19T00:00:00.000000000', '2024-01-19T01:00:00.000000000',\n",
- " '2024-01-19T02:00:00.000000000', '2024-01-19T03:00:00.000000000',\n",
- " '2024-01-19T04:00:00.000000000', '2024-01-19T05:00:00.000000000',\n",
- " '2024-01-19T06:00:00.000000000', '2024-01-19T07:00:00.000000000',\n",
- " '2024-01-19T08:00:00.000000000', '2024-01-19T09:00:00.000000000',\n",
- " '2024-01-19T10:00:00.000000000', '2024-01-19T11:00:00.000000000',\n",
- " '2024-01-19T12:00:00.000000000', '2024-01-19T13:00:00.000000000',\n",
- " '2024-01-19T14:00:00.000000000', '2024-01-19T15:00:00.000000000',\n",
- " '2024-01-19T16:00:00.000000000', '2024-01-19T17:00:00.000000000',\n",
- " '2024-01-19T18:00:00.000000000', '2024-01-19T19:00:00.000000000',\n",
- " '2024-01-19T20:00:00.000000000', '2024-01-19T21:00:00.000000000',\n",
- " '2024-01-19T22:00:00.000000000', '2024-01-19T23:00:00.000000000',\n",
- " '2024-01-20T00:00:00.000000000', '2024-01-20T01:00:00.000000000',\n",
- " '2024-01-20T02:00:00.000000000', '2024-01-20T03:00:00.000000000',\n",
- " '2024-01-20T04:00:00.000000000', '2024-01-20T05:00:00.000000000',\n",
- " '2024-01-20T06:00:00.000000000', '2024-01-20T07:00:00.000000000',\n",
- " '2024-01-20T08:00:00.000000000', '2024-01-20T09:00:00.000000000',\n",
- " '2024-01-20T10:00:00.000000000', '2024-01-20T11:00:00.000000000',\n",
- " '2024-01-20T12:00:00.000000000', '2024-01-20T13:00:00.000000000',\n",
- " '2024-01-20T14:00:00.000000000', '2024-01-20T15:00:00.000000000',\n",
- " '2024-01-20T16:00:00.000000000', '2024-01-20T17:00:00.000000000',\n",
- " '2024-01-20T18:00:00.000000000', '2024-01-20T19:00:00.000000000',\n",
- " '2024-01-20T20:00:00.000000000', '2024-01-20T21:00:00.000000000',\n",
- " '2024-01-20T22:00:00.000000000', '2024-01-20T23:00:00.000000000',\n",
- " '2024-01-21T00:00:00.000000000', '2024-01-21T01:00:00.000000000',\n",
- " '2024-01-21T02:00:00.000000000', '2024-01-21T03:00:00.000000000',\n",
- " '2024-01-21T04:00:00.000000000', '2024-01-21T05:00:00.000000000',\n",
- " '2024-01-21T06:00:00.000000000', '2024-01-21T07:00:00.000000000',\n",
- " '2024-01-21T08:00:00.000000000', '2024-01-21T09:00:00.000000000',\n",
- " '2024-01-21T10:00:00.000000000', '2024-01-21T11:00:00.000000000',\n",
- " '2024-01-21T12:00:00.000000000', '2024-01-21T13:00:00.000000000',\n",
- " '2024-01-21T14:00:00.000000000', '2024-01-21T15:00:00.000000000',\n",
- " '2024-01-21T16:00:00.000000000', '2024-01-21T17:00:00.000000000',\n",
- " '2024-01-21T18:00:00.000000000', '2024-01-21T19:00:00.000000000',\n",
- " '2024-01-21T20:00:00.000000000', '2024-01-21T21:00:00.000000000',\n",
- " '2024-01-21T22:00:00.000000000', '2024-01-21T23:00:00.000000000',\n",
- " '2024-01-22T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('AAAAAAAAAAAKPvjgg49ivby8nSEx72' ... 'AAAAAgPWP9SoFav2i9AAAAAAAA+H8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'}],\n",
- " 'layout': {'bargap': 0,\n",
- " 'bargroupgap': 0,\n",
- " 'barmode': 'relative',\n",
- " 'legend': {'title': {'text': 'variable'}, 'tracegroupgap': 0},\n",
- " 'template': '...',\n",
- " 'title': {'text': 'ThermalStorage (flow_rate)'},\n",
- " 'xaxis': {'anchor': 'y', 'domain': [0.0, 1.0], 'title': {'text': 'time'}},\n",
- " 'yaxis': {'anchor': 'x', 'domain': [0.0, 1.0], 'title': {'text': 'value'}}}\n",
- "}))"
- ],
- "text/html": [
- ""
- ]
- },
- "execution_count": 7,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "execution_count": 7
+ ]
},
{
"cell_type": "markdown",
"id": "16",
"metadata": {},
- "source": "### 3.2 Carrier Balance\n\nShows all flows of a specific carrier across the entire system:"
+ "source": [
+ "### 3.2 Carrier Balance\n",
+ "\n",
+ "Shows all flows of a specific carrier across the entire system:"
+ ]
},
{
"cell_type": "code",
+ "execution_count": null,
"id": "17",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T14:13:16.630015Z",
- "start_time": "2025-12-13T14:13:16.539450Z"
- }
- },
+ "metadata": {},
+ "outputs": [],
"source": [
"complex_sys.statistics.plot.carrier_balance('heat')"
- ],
- "outputs": [
- {
- "data": {
- "text/plain": [
- "PlotResult(data= Size: 4kB\n",
- "Dimensions: (time: 73)\n",
- "Coordinates:\n",
- " * time (time) datetime64[ns] 584B 2024-06-01 ... 2024-06-04\n",
- "Data variables:\n",
- " CHP(Heat) (time) float64 584B 0.0 0.0 0.0 0.0 ... 0.0 0.0 nan\n",
- " HeatPump(Heat) (time) float64 584B 0.0 0.0 0.0 0.0 ... 0.0 0.0 nan\n",
- " BackupBoiler(Heat) (time) float64 584B 20.0 26.01 25.43 ... 20.0 nan\n",
- " HeatStorage(Discharge) (time) float64 584B 0.0 0.0 0.0 ... 0.0 nan\n",
- " HeatStorage(Charge) (time) float64 584B -0.0 -0.0 -0.0 ... -0.0 nan\n",
- " HeatDemand(Heat) (time) float64 584B -20.0 -26.01 ... -20.0 nan, figure=Figure({\n",
- " 'data': [{'hovertemplate': 'variable=CHP(Heat)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'CHP(Heat)',\n",
- " 'marker': {'color': '#AB63FA', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'CHP(Heat)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-06-01T00:00:00.000000000', '2024-06-01T01:00:00.000000000',\n",
- " '2024-06-01T02:00:00.000000000', '2024-06-01T03:00:00.000000000',\n",
- " '2024-06-01T04:00:00.000000000', '2024-06-01T05:00:00.000000000',\n",
- " '2024-06-01T06:00:00.000000000', '2024-06-01T07:00:00.000000000',\n",
- " '2024-06-01T08:00:00.000000000', '2024-06-01T09:00:00.000000000',\n",
- " '2024-06-01T10:00:00.000000000', '2024-06-01T11:00:00.000000000',\n",
- " '2024-06-01T12:00:00.000000000', '2024-06-01T13:00:00.000000000',\n",
- " '2024-06-01T14:00:00.000000000', '2024-06-01T15:00:00.000000000',\n",
- " '2024-06-01T16:00:00.000000000', '2024-06-01T17:00:00.000000000',\n",
- " '2024-06-01T18:00:00.000000000', '2024-06-01T19:00:00.000000000',\n",
- " '2024-06-01T20:00:00.000000000', '2024-06-01T21:00:00.000000000',\n",
- " '2024-06-01T22:00:00.000000000', '2024-06-01T23:00:00.000000000',\n",
- " '2024-06-02T00:00:00.000000000', '2024-06-02T01:00:00.000000000',\n",
- " '2024-06-02T02:00:00.000000000', '2024-06-02T03:00:00.000000000',\n",
- " '2024-06-02T04:00:00.000000000', '2024-06-02T05:00:00.000000000',\n",
- " '2024-06-02T06:00:00.000000000', '2024-06-02T07:00:00.000000000',\n",
- " '2024-06-02T08:00:00.000000000', '2024-06-02T09:00:00.000000000',\n",
- " '2024-06-02T10:00:00.000000000', '2024-06-02T11:00:00.000000000',\n",
- " '2024-06-02T12:00:00.000000000', '2024-06-02T13:00:00.000000000',\n",
- " '2024-06-02T14:00:00.000000000', '2024-06-02T15:00:00.000000000',\n",
- " '2024-06-02T16:00:00.000000000', '2024-06-02T17:00:00.000000000',\n",
- " '2024-06-02T18:00:00.000000000', '2024-06-02T19:00:00.000000000',\n",
- " '2024-06-02T20:00:00.000000000', '2024-06-02T21:00:00.000000000',\n",
- " '2024-06-02T22:00:00.000000000', '2024-06-02T23:00:00.000000000',\n",
- " '2024-06-03T00:00:00.000000000', '2024-06-03T01:00:00.000000000',\n",
- " '2024-06-03T02:00:00.000000000', '2024-06-03T03:00:00.000000000',\n",
- " '2024-06-03T04:00:00.000000000', '2024-06-03T05:00:00.000000000',\n",
- " '2024-06-03T06:00:00.000000000', '2024-06-03T07:00:00.000000000',\n",
- " '2024-06-03T08:00:00.000000000', '2024-06-03T09:00:00.000000000',\n",
- " '2024-06-03T10:00:00.000000000', '2024-06-03T11:00:00.000000000',\n",
- " '2024-06-03T12:00:00.000000000', '2024-06-03T13:00:00.000000000',\n",
- " '2024-06-03T14:00:00.000000000', '2024-06-03T15:00:00.000000000',\n",
- " '2024-06-03T16:00:00.000000000', '2024-06-03T17:00:00.000000000',\n",
- " '2024-06-03T18:00:00.000000000', '2024-06-03T19:00:00.000000000',\n",
- " '2024-06-03T20:00:00.000000000', '2024-06-03T21:00:00.000000000',\n",
- " '2024-06-03T22:00:00.000000000', '2024-06-03T23:00:00.000000000',\n",
- " '2024-06-04T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' ... 'AAAAAAAAAAAAAAAAAAAAAAAAAA+H8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'variable=HeatPump(Heat)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'HeatPump(Heat)',\n",
- " 'marker': {'color': '#FFA15A', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'HeatPump(Heat)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-06-01T00:00:00.000000000', '2024-06-01T01:00:00.000000000',\n",
- " '2024-06-01T02:00:00.000000000', '2024-06-01T03:00:00.000000000',\n",
- " '2024-06-01T04:00:00.000000000', '2024-06-01T05:00:00.000000000',\n",
- " '2024-06-01T06:00:00.000000000', '2024-06-01T07:00:00.000000000',\n",
- " '2024-06-01T08:00:00.000000000', '2024-06-01T09:00:00.000000000',\n",
- " '2024-06-01T10:00:00.000000000', '2024-06-01T11:00:00.000000000',\n",
- " '2024-06-01T12:00:00.000000000', '2024-06-01T13:00:00.000000000',\n",
- " '2024-06-01T14:00:00.000000000', '2024-06-01T15:00:00.000000000',\n",
- " '2024-06-01T16:00:00.000000000', '2024-06-01T17:00:00.000000000',\n",
- " '2024-06-01T18:00:00.000000000', '2024-06-01T19:00:00.000000000',\n",
- " '2024-06-01T20:00:00.000000000', '2024-06-01T21:00:00.000000000',\n",
- " '2024-06-01T22:00:00.000000000', '2024-06-01T23:00:00.000000000',\n",
- " '2024-06-02T00:00:00.000000000', '2024-06-02T01:00:00.000000000',\n",
- " '2024-06-02T02:00:00.000000000', '2024-06-02T03:00:00.000000000',\n",
- " '2024-06-02T04:00:00.000000000', '2024-06-02T05:00:00.000000000',\n",
- " '2024-06-02T06:00:00.000000000', '2024-06-02T07:00:00.000000000',\n",
- " '2024-06-02T08:00:00.000000000', '2024-06-02T09:00:00.000000000',\n",
- " '2024-06-02T10:00:00.000000000', '2024-06-02T11:00:00.000000000',\n",
- " '2024-06-02T12:00:00.000000000', '2024-06-02T13:00:00.000000000',\n",
- " '2024-06-02T14:00:00.000000000', '2024-06-02T15:00:00.000000000',\n",
- " '2024-06-02T16:00:00.000000000', '2024-06-02T17:00:00.000000000',\n",
- " '2024-06-02T18:00:00.000000000', '2024-06-02T19:00:00.000000000',\n",
- " '2024-06-02T20:00:00.000000000', '2024-06-02T21:00:00.000000000',\n",
- " '2024-06-02T22:00:00.000000000', '2024-06-02T23:00:00.000000000',\n",
- " '2024-06-03T00:00:00.000000000', '2024-06-03T01:00:00.000000000',\n",
- " '2024-06-03T02:00:00.000000000', '2024-06-03T03:00:00.000000000',\n",
- " '2024-06-03T04:00:00.000000000', '2024-06-03T05:00:00.000000000',\n",
- " '2024-06-03T06:00:00.000000000', '2024-06-03T07:00:00.000000000',\n",
- " '2024-06-03T08:00:00.000000000', '2024-06-03T09:00:00.000000000',\n",
- " '2024-06-03T10:00:00.000000000', '2024-06-03T11:00:00.000000000',\n",
- " '2024-06-03T12:00:00.000000000', '2024-06-03T13:00:00.000000000',\n",
- " '2024-06-03T14:00:00.000000000', '2024-06-03T15:00:00.000000000',\n",
- " '2024-06-03T16:00:00.000000000', '2024-06-03T17:00:00.000000000',\n",
- " '2024-06-03T18:00:00.000000000', '2024-06-03T19:00:00.000000000',\n",
- " '2024-06-03T20:00:00.000000000', '2024-06-03T21:00:00.000000000',\n",
- " '2024-06-03T22:00:00.000000000', '2024-06-03T23:00:00.000000000',\n",
- " '2024-06-04T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' ... 'AAAAAAAAAAAAAAAAAAAAAAAAAA+H8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'variable=BackupBoiler(Heat)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'BackupBoiler(Heat)',\n",
- " 'marker': {'color': '#19D3F3', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'BackupBoiler(Heat)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-06-01T00:00:00.000000000', '2024-06-01T01:00:00.000000000',\n",
- " '2024-06-01T02:00:00.000000000', '2024-06-01T03:00:00.000000000',\n",
- " '2024-06-01T04:00:00.000000000', '2024-06-01T05:00:00.000000000',\n",
- " '2024-06-01T06:00:00.000000000', '2024-06-01T07:00:00.000000000',\n",
- " '2024-06-01T08:00:00.000000000', '2024-06-01T09:00:00.000000000',\n",
- " '2024-06-01T10:00:00.000000000', '2024-06-01T11:00:00.000000000',\n",
- " '2024-06-01T12:00:00.000000000', '2024-06-01T13:00:00.000000000',\n",
- " '2024-06-01T14:00:00.000000000', '2024-06-01T15:00:00.000000000',\n",
- " '2024-06-01T16:00:00.000000000', '2024-06-01T17:00:00.000000000',\n",
- " '2024-06-01T18:00:00.000000000', '2024-06-01T19:00:00.000000000',\n",
- " '2024-06-01T20:00:00.000000000', '2024-06-01T21:00:00.000000000',\n",
- " '2024-06-01T22:00:00.000000000', '2024-06-01T23:00:00.000000000',\n",
- " '2024-06-02T00:00:00.000000000', '2024-06-02T01:00:00.000000000',\n",
- " '2024-06-02T02:00:00.000000000', '2024-06-02T03:00:00.000000000',\n",
- " '2024-06-02T04:00:00.000000000', '2024-06-02T05:00:00.000000000',\n",
- " '2024-06-02T06:00:00.000000000', '2024-06-02T07:00:00.000000000',\n",
- " '2024-06-02T08:00:00.000000000', '2024-06-02T09:00:00.000000000',\n",
- " '2024-06-02T10:00:00.000000000', '2024-06-02T11:00:00.000000000',\n",
- " '2024-06-02T12:00:00.000000000', '2024-06-02T13:00:00.000000000',\n",
- " '2024-06-02T14:00:00.000000000', '2024-06-02T15:00:00.000000000',\n",
- " '2024-06-02T16:00:00.000000000', '2024-06-02T17:00:00.000000000',\n",
- " '2024-06-02T18:00:00.000000000', '2024-06-02T19:00:00.000000000',\n",
- " '2024-06-02T20:00:00.000000000', '2024-06-02T21:00:00.000000000',\n",
- " '2024-06-02T22:00:00.000000000', '2024-06-02T23:00:00.000000000',\n",
- " '2024-06-03T00:00:00.000000000', '2024-06-03T01:00:00.000000000',\n",
- " '2024-06-03T02:00:00.000000000', '2024-06-03T03:00:00.000000000',\n",
- " '2024-06-03T04:00:00.000000000', '2024-06-03T05:00:00.000000000',\n",
- " '2024-06-03T06:00:00.000000000', '2024-06-03T07:00:00.000000000',\n",
- " '2024-06-03T08:00:00.000000000', '2024-06-03T09:00:00.000000000',\n",
- " '2024-06-03T10:00:00.000000000', '2024-06-03T11:00:00.000000000',\n",
- " '2024-06-03T12:00:00.000000000', '2024-06-03T13:00:00.000000000',\n",
- " '2024-06-03T14:00:00.000000000', '2024-06-03T15:00:00.000000000',\n",
- " '2024-06-03T16:00:00.000000000', '2024-06-03T17:00:00.000000000',\n",
- " '2024-06-03T18:00:00.000000000', '2024-06-03T19:00:00.000000000',\n",
- " '2024-06-03T20:00:00.000000000', '2024-06-03T21:00:00.000000000',\n",
- " '2024-06-03T22:00:00.000000000', '2024-06-03T23:00:00.000000000',\n",
- " '2024-06-04T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('AAAAAAAANEBcQRe1SgI6QOU9Gisjbz' ... 'Dnhlw6QAAAAAAAADRAAAAAAAAA+H8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'variable=HeatStorage(Discharge)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'HeatStorage(Discharge)',\n",
- " 'marker': {'color': '#FF6692', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'HeatStorage(Discharge)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-06-01T00:00:00.000000000', '2024-06-01T01:00:00.000000000',\n",
- " '2024-06-01T02:00:00.000000000', '2024-06-01T03:00:00.000000000',\n",
- " '2024-06-01T04:00:00.000000000', '2024-06-01T05:00:00.000000000',\n",
- " '2024-06-01T06:00:00.000000000', '2024-06-01T07:00:00.000000000',\n",
- " '2024-06-01T08:00:00.000000000', '2024-06-01T09:00:00.000000000',\n",
- " '2024-06-01T10:00:00.000000000', '2024-06-01T11:00:00.000000000',\n",
- " '2024-06-01T12:00:00.000000000', '2024-06-01T13:00:00.000000000',\n",
- " '2024-06-01T14:00:00.000000000', '2024-06-01T15:00:00.000000000',\n",
- " '2024-06-01T16:00:00.000000000', '2024-06-01T17:00:00.000000000',\n",
- " '2024-06-01T18:00:00.000000000', '2024-06-01T19:00:00.000000000',\n",
- " '2024-06-01T20:00:00.000000000', '2024-06-01T21:00:00.000000000',\n",
- " '2024-06-01T22:00:00.000000000', '2024-06-01T23:00:00.000000000',\n",
- " '2024-06-02T00:00:00.000000000', '2024-06-02T01:00:00.000000000',\n",
- " '2024-06-02T02:00:00.000000000', '2024-06-02T03:00:00.000000000',\n",
- " '2024-06-02T04:00:00.000000000', '2024-06-02T05:00:00.000000000',\n",
- " '2024-06-02T06:00:00.000000000', '2024-06-02T07:00:00.000000000',\n",
- " '2024-06-02T08:00:00.000000000', '2024-06-02T09:00:00.000000000',\n",
- " '2024-06-02T10:00:00.000000000', '2024-06-02T11:00:00.000000000',\n",
- " '2024-06-02T12:00:00.000000000', '2024-06-02T13:00:00.000000000',\n",
- " '2024-06-02T14:00:00.000000000', '2024-06-02T15:00:00.000000000',\n",
- " '2024-06-02T16:00:00.000000000', '2024-06-02T17:00:00.000000000',\n",
- " '2024-06-02T18:00:00.000000000', '2024-06-02T19:00:00.000000000',\n",
- " '2024-06-02T20:00:00.000000000', '2024-06-02T21:00:00.000000000',\n",
- " '2024-06-02T22:00:00.000000000', '2024-06-02T23:00:00.000000000',\n",
- " '2024-06-03T00:00:00.000000000', '2024-06-03T01:00:00.000000000',\n",
- " '2024-06-03T02:00:00.000000000', '2024-06-03T03:00:00.000000000',\n",
- " '2024-06-03T04:00:00.000000000', '2024-06-03T05:00:00.000000000',\n",
- " '2024-06-03T06:00:00.000000000', '2024-06-03T07:00:00.000000000',\n",
- " '2024-06-03T08:00:00.000000000', '2024-06-03T09:00:00.000000000',\n",
- " '2024-06-03T10:00:00.000000000', '2024-06-03T11:00:00.000000000',\n",
- " '2024-06-03T12:00:00.000000000', '2024-06-03T13:00:00.000000000',\n",
- " '2024-06-03T14:00:00.000000000', '2024-06-03T15:00:00.000000000',\n",
- " '2024-06-03T16:00:00.000000000', '2024-06-03T17:00:00.000000000',\n",
- " '2024-06-03T18:00:00.000000000', '2024-06-03T19:00:00.000000000',\n",
- " '2024-06-03T20:00:00.000000000', '2024-06-03T21:00:00.000000000',\n",
- " '2024-06-03T22:00:00.000000000', '2024-06-03T23:00:00.000000000',\n",
- " '2024-06-04T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' ... 'RO7MQ7PQAAAAAAAAAAAAAAAAAA+H8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'variable=HeatStorage(Charge)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'HeatStorage(Charge)',\n",
- " 'marker': {'color': '#FF6692', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'HeatStorage(Charge)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-06-01T00:00:00.000000000', '2024-06-01T01:00:00.000000000',\n",
- " '2024-06-01T02:00:00.000000000', '2024-06-01T03:00:00.000000000',\n",
- " '2024-06-01T04:00:00.000000000', '2024-06-01T05:00:00.000000000',\n",
- " '2024-06-01T06:00:00.000000000', '2024-06-01T07:00:00.000000000',\n",
- " '2024-06-01T08:00:00.000000000', '2024-06-01T09:00:00.000000000',\n",
- " '2024-06-01T10:00:00.000000000', '2024-06-01T11:00:00.000000000',\n",
- " '2024-06-01T12:00:00.000000000', '2024-06-01T13:00:00.000000000',\n",
- " '2024-06-01T14:00:00.000000000', '2024-06-01T15:00:00.000000000',\n",
- " '2024-06-01T16:00:00.000000000', '2024-06-01T17:00:00.000000000',\n",
- " '2024-06-01T18:00:00.000000000', '2024-06-01T19:00:00.000000000',\n",
- " '2024-06-01T20:00:00.000000000', '2024-06-01T21:00:00.000000000',\n",
- " '2024-06-01T22:00:00.000000000', '2024-06-01T23:00:00.000000000',\n",
- " '2024-06-02T00:00:00.000000000', '2024-06-02T01:00:00.000000000',\n",
- " '2024-06-02T02:00:00.000000000', '2024-06-02T03:00:00.000000000',\n",
- " '2024-06-02T04:00:00.000000000', '2024-06-02T05:00:00.000000000',\n",
- " '2024-06-02T06:00:00.000000000', '2024-06-02T07:00:00.000000000',\n",
- " '2024-06-02T08:00:00.000000000', '2024-06-02T09:00:00.000000000',\n",
- " '2024-06-02T10:00:00.000000000', '2024-06-02T11:00:00.000000000',\n",
- " '2024-06-02T12:00:00.000000000', '2024-06-02T13:00:00.000000000',\n",
- " '2024-06-02T14:00:00.000000000', '2024-06-02T15:00:00.000000000',\n",
- " '2024-06-02T16:00:00.000000000', '2024-06-02T17:00:00.000000000',\n",
- " '2024-06-02T18:00:00.000000000', '2024-06-02T19:00:00.000000000',\n",
- " '2024-06-02T20:00:00.000000000', '2024-06-02T21:00:00.000000000',\n",
- " '2024-06-02T22:00:00.000000000', '2024-06-02T23:00:00.000000000',\n",
- " '2024-06-03T00:00:00.000000000', '2024-06-03T01:00:00.000000000',\n",
- " '2024-06-03T02:00:00.000000000', '2024-06-03T03:00:00.000000000',\n",
- " '2024-06-03T04:00:00.000000000', '2024-06-03T05:00:00.000000000',\n",
- " '2024-06-03T06:00:00.000000000', '2024-06-03T07:00:00.000000000',\n",
- " '2024-06-03T08:00:00.000000000', '2024-06-03T09:00:00.000000000',\n",
- " '2024-06-03T10:00:00.000000000', '2024-06-03T11:00:00.000000000',\n",
- " '2024-06-03T12:00:00.000000000', '2024-06-03T13:00:00.000000000',\n",
- " '2024-06-03T14:00:00.000000000', '2024-06-03T15:00:00.000000000',\n",
- " '2024-06-03T16:00:00.000000000', '2024-06-03T17:00:00.000000000',\n",
- " '2024-06-03T18:00:00.000000000', '2024-06-03T19:00:00.000000000',\n",
- " '2024-06-03T20:00:00.000000000', '2024-06-03T21:00:00.000000000',\n",
- " '2024-06-03T22:00:00.000000000', '2024-06-03T23:00:00.000000000',\n",
- " '2024-06-04T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('AAAAAAAAAIAAAAAAAAAAgAAAAAAAAA' ... 'RO7MQ+vQAAAAAAAACAAAAAAAAA+P8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'variable=HeatDemand(Heat)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'HeatDemand(Heat)',\n",
- " 'marker': {'color': '#B6E880', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'HeatDemand(Heat)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-06-01T00:00:00.000000000', '2024-06-01T01:00:00.000000000',\n",
- " '2024-06-01T02:00:00.000000000', '2024-06-01T03:00:00.000000000',\n",
- " '2024-06-01T04:00:00.000000000', '2024-06-01T05:00:00.000000000',\n",
- " '2024-06-01T06:00:00.000000000', '2024-06-01T07:00:00.000000000',\n",
- " '2024-06-01T08:00:00.000000000', '2024-06-01T09:00:00.000000000',\n",
- " '2024-06-01T10:00:00.000000000', '2024-06-01T11:00:00.000000000',\n",
- " '2024-06-01T12:00:00.000000000', '2024-06-01T13:00:00.000000000',\n",
- " '2024-06-01T14:00:00.000000000', '2024-06-01T15:00:00.000000000',\n",
- " '2024-06-01T16:00:00.000000000', '2024-06-01T17:00:00.000000000',\n",
- " '2024-06-01T18:00:00.000000000', '2024-06-01T19:00:00.000000000',\n",
- " '2024-06-01T20:00:00.000000000', '2024-06-01T21:00:00.000000000',\n",
- " '2024-06-01T22:00:00.000000000', '2024-06-01T23:00:00.000000000',\n",
- " '2024-06-02T00:00:00.000000000', '2024-06-02T01:00:00.000000000',\n",
- " '2024-06-02T02:00:00.000000000', '2024-06-02T03:00:00.000000000',\n",
- " '2024-06-02T04:00:00.000000000', '2024-06-02T05:00:00.000000000',\n",
- " '2024-06-02T06:00:00.000000000', '2024-06-02T07:00:00.000000000',\n",
- " '2024-06-02T08:00:00.000000000', '2024-06-02T09:00:00.000000000',\n",
- " '2024-06-02T10:00:00.000000000', '2024-06-02T11:00:00.000000000',\n",
- " '2024-06-02T12:00:00.000000000', '2024-06-02T13:00:00.000000000',\n",
- " '2024-06-02T14:00:00.000000000', '2024-06-02T15:00:00.000000000',\n",
- " '2024-06-02T16:00:00.000000000', '2024-06-02T17:00:00.000000000',\n",
- " '2024-06-02T18:00:00.000000000', '2024-06-02T19:00:00.000000000',\n",
- " '2024-06-02T20:00:00.000000000', '2024-06-02T21:00:00.000000000',\n",
- " '2024-06-02T22:00:00.000000000', '2024-06-02T23:00:00.000000000',\n",
- " '2024-06-03T00:00:00.000000000', '2024-06-03T01:00:00.000000000',\n",
- " '2024-06-03T02:00:00.000000000', '2024-06-03T03:00:00.000000000',\n",
- " '2024-06-03T04:00:00.000000000', '2024-06-03T05:00:00.000000000',\n",
- " '2024-06-03T06:00:00.000000000', '2024-06-03T07:00:00.000000000',\n",
- " '2024-06-03T08:00:00.000000000', '2024-06-03T09:00:00.000000000',\n",
- " '2024-06-03T10:00:00.000000000', '2024-06-03T11:00:00.000000000',\n",
- " '2024-06-03T12:00:00.000000000', '2024-06-03T13:00:00.000000000',\n",
- " '2024-06-03T14:00:00.000000000', '2024-06-03T15:00:00.000000000',\n",
- " '2024-06-03T16:00:00.000000000', '2024-06-03T17:00:00.000000000',\n",
- " '2024-06-03T18:00:00.000000000', '2024-06-03T19:00:00.000000000',\n",
- " '2024-06-03T20:00:00.000000000', '2024-06-03T21:00:00.000000000',\n",
- " '2024-06-03T22:00:00.000000000', '2024-06-03T23:00:00.000000000',\n",
- " '2024-06-04T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('AAAAAAAANMBcQRe1SgI6wOQ9Gisjbz' ... 'Dnhlw6wAAAAAAAADTAAAAAAAAA+P8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'}],\n",
- " 'layout': {'bargap': 0,\n",
- " 'bargroupgap': 0,\n",
- " 'barmode': 'relative',\n",
- " 'legend': {'title': {'text': 'variable'}, 'tracegroupgap': 0},\n",
- " 'template': '...',\n",
- " 'title': {'text': 'Heat Balance (flow_rate)'},\n",
- " 'xaxis': {'anchor': 'y', 'domain': [0.0, 1.0], 'title': {'text': 'time'}},\n",
- " 'yaxis': {'anchor': 'x', 'domain': [0.0, 1.0], 'title': {'text': 'value'}}}\n",
- "}))"
- ],
- "text/html": [
- ""
- ]
- },
- "execution_count": 8,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "execution_count": 8
+ ]
},
{
"cell_type": "code",
+ "execution_count": null,
"id": "18",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T14:13:16.765682Z",
- "start_time": "2025-12-13T14:13:16.660109Z"
- }
- },
+ "metadata": {},
+ "outputs": [],
"source": [
"complex_sys.statistics.plot.carrier_balance('electricity')"
- ],
- "outputs": [
- {
- "data": {
- "text/plain": [
- "PlotResult(data= Size: 4kB\n",
- "Dimensions: (time: 73)\n",
- "Coordinates:\n",
- " * time (time) datetime64[ns] 584B 2024-06-01 ... 2024-06-04\n",
- "Data variables:\n",
- " ElectricityImport(El) (time) float64 584B 23.49 20.59 21.13 ... 17.12 nan\n",
- " CHP(El) (time) float64 584B 0.0 0.0 0.0 0.0 ... 0.0 0.0 nan\n",
- " ElectricityExport(El) (time) float64 584B -0.0 -0.0 -0.0 ... -0.0 -0.0 nan\n",
- " HeatPump(El) (time) float64 584B -0.0 -0.0 -0.0 ... -0.0 -0.0 nan\n",
- " ElDemand(El) (time) float64 584B -23.49 -20.59 ... -17.12 nan, figure=Figure({\n",
- " 'data': [{'hovertemplate': 'variable=ElectricityImport(El)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'ElectricityImport(El)',\n",
- " 'marker': {'color': '#EF553B', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'ElectricityImport(El)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-06-01T00:00:00.000000000', '2024-06-01T01:00:00.000000000',\n",
- " '2024-06-01T02:00:00.000000000', '2024-06-01T03:00:00.000000000',\n",
- " '2024-06-01T04:00:00.000000000', '2024-06-01T05:00:00.000000000',\n",
- " '2024-06-01T06:00:00.000000000', '2024-06-01T07:00:00.000000000',\n",
- " '2024-06-01T08:00:00.000000000', '2024-06-01T09:00:00.000000000',\n",
- " '2024-06-01T10:00:00.000000000', '2024-06-01T11:00:00.000000000',\n",
- " '2024-06-01T12:00:00.000000000', '2024-06-01T13:00:00.000000000',\n",
- " '2024-06-01T14:00:00.000000000', '2024-06-01T15:00:00.000000000',\n",
- " '2024-06-01T16:00:00.000000000', '2024-06-01T17:00:00.000000000',\n",
- " '2024-06-01T18:00:00.000000000', '2024-06-01T19:00:00.000000000',\n",
- " '2024-06-01T20:00:00.000000000', '2024-06-01T21:00:00.000000000',\n",
- " '2024-06-01T22:00:00.000000000', '2024-06-01T23:00:00.000000000',\n",
- " '2024-06-02T00:00:00.000000000', '2024-06-02T01:00:00.000000000',\n",
- " '2024-06-02T02:00:00.000000000', '2024-06-02T03:00:00.000000000',\n",
- " '2024-06-02T04:00:00.000000000', '2024-06-02T05:00:00.000000000',\n",
- " '2024-06-02T06:00:00.000000000', '2024-06-02T07:00:00.000000000',\n",
- " '2024-06-02T08:00:00.000000000', '2024-06-02T09:00:00.000000000',\n",
- " '2024-06-02T10:00:00.000000000', '2024-06-02T11:00:00.000000000',\n",
- " '2024-06-02T12:00:00.000000000', '2024-06-02T13:00:00.000000000',\n",
- " '2024-06-02T14:00:00.000000000', '2024-06-02T15:00:00.000000000',\n",
- " '2024-06-02T16:00:00.000000000', '2024-06-02T17:00:00.000000000',\n",
- " '2024-06-02T18:00:00.000000000', '2024-06-02T19:00:00.000000000',\n",
- " '2024-06-02T20:00:00.000000000', '2024-06-02T21:00:00.000000000',\n",
- " '2024-06-02T22:00:00.000000000', '2024-06-02T23:00:00.000000000',\n",
- " '2024-06-03T00:00:00.000000000', '2024-06-03T01:00:00.000000000',\n",
- " '2024-06-03T02:00:00.000000000', '2024-06-03T03:00:00.000000000',\n",
- " '2024-06-03T04:00:00.000000000', '2024-06-03T05:00:00.000000000',\n",
- " '2024-06-03T06:00:00.000000000', '2024-06-03T07:00:00.000000000',\n",
- " '2024-06-03T08:00:00.000000000', '2024-06-03T09:00:00.000000000',\n",
- " '2024-06-03T10:00:00.000000000', '2024-06-03T11:00:00.000000000',\n",
- " '2024-06-03T12:00:00.000000000', '2024-06-03T13:00:00.000000000',\n",
- " '2024-06-03T14:00:00.000000000', '2024-06-03T15:00:00.000000000',\n",
- " '2024-06-03T16:00:00.000000000', '2024-06-03T17:00:00.000000000',\n",
- " '2024-06-03T18:00:00.000000000', '2024-06-03T19:00:00.000000000',\n",
- " '2024-06-03T20:00:00.000000000', '2024-06-03T21:00:00.000000000',\n",
- " '2024-06-03T22:00:00.000000000', '2024-06-03T23:00:00.000000000',\n",
- " '2024-06-04T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('2HsanZJ8N0B/T9mTNpc0QB5Tg3x1IT' ... 'ANSU0wQAE5VciyHTFAAAAAAAAA+H8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'variable=CHP(El)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'CHP(El)',\n",
- " 'marker': {'color': '#AB63FA', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'CHP(El)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-06-01T00:00:00.000000000', '2024-06-01T01:00:00.000000000',\n",
- " '2024-06-01T02:00:00.000000000', '2024-06-01T03:00:00.000000000',\n",
- " '2024-06-01T04:00:00.000000000', '2024-06-01T05:00:00.000000000',\n",
- " '2024-06-01T06:00:00.000000000', '2024-06-01T07:00:00.000000000',\n",
- " '2024-06-01T08:00:00.000000000', '2024-06-01T09:00:00.000000000',\n",
- " '2024-06-01T10:00:00.000000000', '2024-06-01T11:00:00.000000000',\n",
- " '2024-06-01T12:00:00.000000000', '2024-06-01T13:00:00.000000000',\n",
- " '2024-06-01T14:00:00.000000000', '2024-06-01T15:00:00.000000000',\n",
- " '2024-06-01T16:00:00.000000000', '2024-06-01T17:00:00.000000000',\n",
- " '2024-06-01T18:00:00.000000000', '2024-06-01T19:00:00.000000000',\n",
- " '2024-06-01T20:00:00.000000000', '2024-06-01T21:00:00.000000000',\n",
- " '2024-06-01T22:00:00.000000000', '2024-06-01T23:00:00.000000000',\n",
- " '2024-06-02T00:00:00.000000000', '2024-06-02T01:00:00.000000000',\n",
- " '2024-06-02T02:00:00.000000000', '2024-06-02T03:00:00.000000000',\n",
- " '2024-06-02T04:00:00.000000000', '2024-06-02T05:00:00.000000000',\n",
- " '2024-06-02T06:00:00.000000000', '2024-06-02T07:00:00.000000000',\n",
- " '2024-06-02T08:00:00.000000000', '2024-06-02T09:00:00.000000000',\n",
- " '2024-06-02T10:00:00.000000000', '2024-06-02T11:00:00.000000000',\n",
- " '2024-06-02T12:00:00.000000000', '2024-06-02T13:00:00.000000000',\n",
- " '2024-06-02T14:00:00.000000000', '2024-06-02T15:00:00.000000000',\n",
- " '2024-06-02T16:00:00.000000000', '2024-06-02T17:00:00.000000000',\n",
- " '2024-06-02T18:00:00.000000000', '2024-06-02T19:00:00.000000000',\n",
- " '2024-06-02T20:00:00.000000000', '2024-06-02T21:00:00.000000000',\n",
- " '2024-06-02T22:00:00.000000000', '2024-06-02T23:00:00.000000000',\n",
- " '2024-06-03T00:00:00.000000000', '2024-06-03T01:00:00.000000000',\n",
- " '2024-06-03T02:00:00.000000000', '2024-06-03T03:00:00.000000000',\n",
- " '2024-06-03T04:00:00.000000000', '2024-06-03T05:00:00.000000000',\n",
- " '2024-06-03T06:00:00.000000000', '2024-06-03T07:00:00.000000000',\n",
- " '2024-06-03T08:00:00.000000000', '2024-06-03T09:00:00.000000000',\n",
- " '2024-06-03T10:00:00.000000000', '2024-06-03T11:00:00.000000000',\n",
- " '2024-06-03T12:00:00.000000000', '2024-06-03T13:00:00.000000000',\n",
- " '2024-06-03T14:00:00.000000000', '2024-06-03T15:00:00.000000000',\n",
- " '2024-06-03T16:00:00.000000000', '2024-06-03T17:00:00.000000000',\n",
- " '2024-06-03T18:00:00.000000000', '2024-06-03T19:00:00.000000000',\n",
- " '2024-06-03T20:00:00.000000000', '2024-06-03T21:00:00.000000000',\n",
- " '2024-06-03T22:00:00.000000000', '2024-06-03T23:00:00.000000000',\n",
- " '2024-06-04T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' ... 'AAAAAAAAAAAAAAAAAAAAAAAAAA+H8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'variable=ElectricityExport(El)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'ElectricityExport(El)',\n",
- " 'marker': {'color': '#00CC96', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'ElectricityExport(El)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-06-01T00:00:00.000000000', '2024-06-01T01:00:00.000000000',\n",
- " '2024-06-01T02:00:00.000000000', '2024-06-01T03:00:00.000000000',\n",
- " '2024-06-01T04:00:00.000000000', '2024-06-01T05:00:00.000000000',\n",
- " '2024-06-01T06:00:00.000000000', '2024-06-01T07:00:00.000000000',\n",
- " '2024-06-01T08:00:00.000000000', '2024-06-01T09:00:00.000000000',\n",
- " '2024-06-01T10:00:00.000000000', '2024-06-01T11:00:00.000000000',\n",
- " '2024-06-01T12:00:00.000000000', '2024-06-01T13:00:00.000000000',\n",
- " '2024-06-01T14:00:00.000000000', '2024-06-01T15:00:00.000000000',\n",
- " '2024-06-01T16:00:00.000000000', '2024-06-01T17:00:00.000000000',\n",
- " '2024-06-01T18:00:00.000000000', '2024-06-01T19:00:00.000000000',\n",
- " '2024-06-01T20:00:00.000000000', '2024-06-01T21:00:00.000000000',\n",
- " '2024-06-01T22:00:00.000000000', '2024-06-01T23:00:00.000000000',\n",
- " '2024-06-02T00:00:00.000000000', '2024-06-02T01:00:00.000000000',\n",
- " '2024-06-02T02:00:00.000000000', '2024-06-02T03:00:00.000000000',\n",
- " '2024-06-02T04:00:00.000000000', '2024-06-02T05:00:00.000000000',\n",
- " '2024-06-02T06:00:00.000000000', '2024-06-02T07:00:00.000000000',\n",
- " '2024-06-02T08:00:00.000000000', '2024-06-02T09:00:00.000000000',\n",
- " '2024-06-02T10:00:00.000000000', '2024-06-02T11:00:00.000000000',\n",
- " '2024-06-02T12:00:00.000000000', '2024-06-02T13:00:00.000000000',\n",
- " '2024-06-02T14:00:00.000000000', '2024-06-02T15:00:00.000000000',\n",
- " '2024-06-02T16:00:00.000000000', '2024-06-02T17:00:00.000000000',\n",
- " '2024-06-02T18:00:00.000000000', '2024-06-02T19:00:00.000000000',\n",
- " '2024-06-02T20:00:00.000000000', '2024-06-02T21:00:00.000000000',\n",
- " '2024-06-02T22:00:00.000000000', '2024-06-02T23:00:00.000000000',\n",
- " '2024-06-03T00:00:00.000000000', '2024-06-03T01:00:00.000000000',\n",
- " '2024-06-03T02:00:00.000000000', '2024-06-03T03:00:00.000000000',\n",
- " '2024-06-03T04:00:00.000000000', '2024-06-03T05:00:00.000000000',\n",
- " '2024-06-03T06:00:00.000000000', '2024-06-03T07:00:00.000000000',\n",
- " '2024-06-03T08:00:00.000000000', '2024-06-03T09:00:00.000000000',\n",
- " '2024-06-03T10:00:00.000000000', '2024-06-03T11:00:00.000000000',\n",
- " '2024-06-03T12:00:00.000000000', '2024-06-03T13:00:00.000000000',\n",
- " '2024-06-03T14:00:00.000000000', '2024-06-03T15:00:00.000000000',\n",
- " '2024-06-03T16:00:00.000000000', '2024-06-03T17:00:00.000000000',\n",
- " '2024-06-03T18:00:00.000000000', '2024-06-03T19:00:00.000000000',\n",
- " '2024-06-03T20:00:00.000000000', '2024-06-03T21:00:00.000000000',\n",
- " '2024-06-03T22:00:00.000000000', '2024-06-03T23:00:00.000000000',\n",
- " '2024-06-04T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('AAAAAAAAAIAAAAAAAAAAgAAAAAAAAA' ... 'AAAAAAgAAAAAAAAACAAAAAAAAA+P8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'variable=HeatPump(El)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'HeatPump(El)',\n",
- " 'marker': {'color': '#FFA15A', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'HeatPump(El)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-06-01T00:00:00.000000000', '2024-06-01T01:00:00.000000000',\n",
- " '2024-06-01T02:00:00.000000000', '2024-06-01T03:00:00.000000000',\n",
- " '2024-06-01T04:00:00.000000000', '2024-06-01T05:00:00.000000000',\n",
- " '2024-06-01T06:00:00.000000000', '2024-06-01T07:00:00.000000000',\n",
- " '2024-06-01T08:00:00.000000000', '2024-06-01T09:00:00.000000000',\n",
- " '2024-06-01T10:00:00.000000000', '2024-06-01T11:00:00.000000000',\n",
- " '2024-06-01T12:00:00.000000000', '2024-06-01T13:00:00.000000000',\n",
- " '2024-06-01T14:00:00.000000000', '2024-06-01T15:00:00.000000000',\n",
- " '2024-06-01T16:00:00.000000000', '2024-06-01T17:00:00.000000000',\n",
- " '2024-06-01T18:00:00.000000000', '2024-06-01T19:00:00.000000000',\n",
- " '2024-06-01T20:00:00.000000000', '2024-06-01T21:00:00.000000000',\n",
- " '2024-06-01T22:00:00.000000000', '2024-06-01T23:00:00.000000000',\n",
- " '2024-06-02T00:00:00.000000000', '2024-06-02T01:00:00.000000000',\n",
- " '2024-06-02T02:00:00.000000000', '2024-06-02T03:00:00.000000000',\n",
- " '2024-06-02T04:00:00.000000000', '2024-06-02T05:00:00.000000000',\n",
- " '2024-06-02T06:00:00.000000000', '2024-06-02T07:00:00.000000000',\n",
- " '2024-06-02T08:00:00.000000000', '2024-06-02T09:00:00.000000000',\n",
- " '2024-06-02T10:00:00.000000000', '2024-06-02T11:00:00.000000000',\n",
- " '2024-06-02T12:00:00.000000000', '2024-06-02T13:00:00.000000000',\n",
- " '2024-06-02T14:00:00.000000000', '2024-06-02T15:00:00.000000000',\n",
- " '2024-06-02T16:00:00.000000000', '2024-06-02T17:00:00.000000000',\n",
- " '2024-06-02T18:00:00.000000000', '2024-06-02T19:00:00.000000000',\n",
- " '2024-06-02T20:00:00.000000000', '2024-06-02T21:00:00.000000000',\n",
- " '2024-06-02T22:00:00.000000000', '2024-06-02T23:00:00.000000000',\n",
- " '2024-06-03T00:00:00.000000000', '2024-06-03T01:00:00.000000000',\n",
- " '2024-06-03T02:00:00.000000000', '2024-06-03T03:00:00.000000000',\n",
- " '2024-06-03T04:00:00.000000000', '2024-06-03T05:00:00.000000000',\n",
- " '2024-06-03T06:00:00.000000000', '2024-06-03T07:00:00.000000000',\n",
- " '2024-06-03T08:00:00.000000000', '2024-06-03T09:00:00.000000000',\n",
- " '2024-06-03T10:00:00.000000000', '2024-06-03T11:00:00.000000000',\n",
- " '2024-06-03T12:00:00.000000000', '2024-06-03T13:00:00.000000000',\n",
- " '2024-06-03T14:00:00.000000000', '2024-06-03T15:00:00.000000000',\n",
- " '2024-06-03T16:00:00.000000000', '2024-06-03T17:00:00.000000000',\n",
- " '2024-06-03T18:00:00.000000000', '2024-06-03T19:00:00.000000000',\n",
- " '2024-06-03T20:00:00.000000000', '2024-06-03T21:00:00.000000000',\n",
- " '2024-06-03T22:00:00.000000000', '2024-06-03T23:00:00.000000000',\n",
- " '2024-06-04T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('AAAAAAAAAIAAAAAAAAAAgAAAAAAAAA' ... 'AAAAAAgAAAAAAAAACAAAAAAAAA+P8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'variable=ElDemand(El)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'ElDemand(El)',\n",
- " 'marker': {'color': '#FF97FF', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'ElDemand(El)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-06-01T00:00:00.000000000', '2024-06-01T01:00:00.000000000',\n",
- " '2024-06-01T02:00:00.000000000', '2024-06-01T03:00:00.000000000',\n",
- " '2024-06-01T04:00:00.000000000', '2024-06-01T05:00:00.000000000',\n",
- " '2024-06-01T06:00:00.000000000', '2024-06-01T07:00:00.000000000',\n",
- " '2024-06-01T08:00:00.000000000', '2024-06-01T09:00:00.000000000',\n",
- " '2024-06-01T10:00:00.000000000', '2024-06-01T11:00:00.000000000',\n",
- " '2024-06-01T12:00:00.000000000', '2024-06-01T13:00:00.000000000',\n",
- " '2024-06-01T14:00:00.000000000', '2024-06-01T15:00:00.000000000',\n",
- " '2024-06-01T16:00:00.000000000', '2024-06-01T17:00:00.000000000',\n",
- " '2024-06-01T18:00:00.000000000', '2024-06-01T19:00:00.000000000',\n",
- " '2024-06-01T20:00:00.000000000', '2024-06-01T21:00:00.000000000',\n",
- " '2024-06-01T22:00:00.000000000', '2024-06-01T23:00:00.000000000',\n",
- " '2024-06-02T00:00:00.000000000', '2024-06-02T01:00:00.000000000',\n",
- " '2024-06-02T02:00:00.000000000', '2024-06-02T03:00:00.000000000',\n",
- " '2024-06-02T04:00:00.000000000', '2024-06-02T05:00:00.000000000',\n",
- " '2024-06-02T06:00:00.000000000', '2024-06-02T07:00:00.000000000',\n",
- " '2024-06-02T08:00:00.000000000', '2024-06-02T09:00:00.000000000',\n",
- " '2024-06-02T10:00:00.000000000', '2024-06-02T11:00:00.000000000',\n",
- " '2024-06-02T12:00:00.000000000', '2024-06-02T13:00:00.000000000',\n",
- " '2024-06-02T14:00:00.000000000', '2024-06-02T15:00:00.000000000',\n",
- " '2024-06-02T16:00:00.000000000', '2024-06-02T17:00:00.000000000',\n",
- " '2024-06-02T18:00:00.000000000', '2024-06-02T19:00:00.000000000',\n",
- " '2024-06-02T20:00:00.000000000', '2024-06-02T21:00:00.000000000',\n",
- " '2024-06-02T22:00:00.000000000', '2024-06-02T23:00:00.000000000',\n",
- " '2024-06-03T00:00:00.000000000', '2024-06-03T01:00:00.000000000',\n",
- " '2024-06-03T02:00:00.000000000', '2024-06-03T03:00:00.000000000',\n",
- " '2024-06-03T04:00:00.000000000', '2024-06-03T05:00:00.000000000',\n",
- " '2024-06-03T06:00:00.000000000', '2024-06-03T07:00:00.000000000',\n",
- " '2024-06-03T08:00:00.000000000', '2024-06-03T09:00:00.000000000',\n",
- " '2024-06-03T10:00:00.000000000', '2024-06-03T11:00:00.000000000',\n",
- " '2024-06-03T12:00:00.000000000', '2024-06-03T13:00:00.000000000',\n",
- " '2024-06-03T14:00:00.000000000', '2024-06-03T15:00:00.000000000',\n",
- " '2024-06-03T16:00:00.000000000', '2024-06-03T17:00:00.000000000',\n",
- " '2024-06-03T18:00:00.000000000', '2024-06-03T19:00:00.000000000',\n",
- " '2024-06-03T20:00:00.000000000', '2024-06-03T21:00:00.000000000',\n",
- " '2024-06-03T22:00:00.000000000', '2024-06-03T23:00:00.000000000',\n",
- " '2024-06-04T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('2HsanZJ8N8B/T9mTNpc0wB5Tg3x1IT' ... 'ANSU0wwAE5VciyHTHAAAAAAAAA+P8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'}],\n",
- " 'layout': {'bargap': 0,\n",
- " 'bargroupgap': 0,\n",
- " 'barmode': 'relative',\n",
- " 'legend': {'title': {'text': 'variable'}, 'tracegroupgap': 0},\n",
- " 'template': '...',\n",
- " 'title': {'text': 'Electricity Balance (flow_rate)'},\n",
- " 'xaxis': {'anchor': 'y', 'domain': [0.0, 1.0], 'title': {'text': 'time'}},\n",
- " 'yaxis': {'anchor': 'x', 'domain': [0.0, 1.0], 'title': {'text': 'value'}}}\n",
- "}))"
- ],
- "text/html": [
- ""
- ]
- },
- "execution_count": 9,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "execution_count": 9
+ ]
},
{
"cell_type": "markdown",
"id": "19",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-12T12:06:36.266666Z",
- "start_time": "2025-12-12T12:06:36.198686Z"
- }
- },
- "source": "### 3.3 Flow Rates\n\nPlot multiple flow rates together:"
+ "metadata": {},
+ "source": [
+ "### 3.3 Flow Rates\n",
+ "\n",
+ "Plot multiple flow rates together:"
+ ]
},
{
"cell_type": "code",
+ "execution_count": null,
"id": "20",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T14:13:16.863735Z",
- "start_time": "2025-12-13T14:13:16.783096Z"
- }
- },
+ "metadata": {},
+ "outputs": [],
"source": [
"# All flows\n",
"simple.statistics.plot.flows()"
- ],
- "outputs": [
- {
- "data": {
- "text/plain": [
- "PlotResult(data= Size: 9kB\n",
- "Dimensions: (time: 169)\n",
- "Coordinates:\n",
- " * time (time) datetime64[ns] 1kB 2024-01-15 ... 2024-...\n",
- "Data variables:\n",
- " GasGrid(Gas) (time) float64 1kB 35.31 31.86 ... 135.3 nan\n",
- " Boiler(Gas) (time) float64 1kB 35.31 31.86 ... 135.3 nan\n",
- " Boiler(Heat) (time) float64 1kB 32.48 29.31 ... 124.5 nan\n",
- " ThermalStorage(Charge) (time) float64 1kB 0.0 -3.748e-13 ... 100.0 nan\n",
- " ThermalStorage(Discharge) (time) float64 1kB 0.0 -5.275e-13 ... nan\n",
- " Office(Heat) (time) float64 1kB 32.48 29.31 ... 24.48 nan, figure=Figure({\n",
- " 'data': [{'hovertemplate': 'variable=GasGrid(Gas)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'GasGrid(Gas)',\n",
- " 'line': {'color': '#636EFA', 'dash': 'solid'},\n",
- " 'marker': {'symbol': 'circle'},\n",
- " 'mode': 'lines',\n",
- " 'name': 'GasGrid(Gas)',\n",
- " 'showlegend': True,\n",
- " 'type': 'scattergl',\n",
- " 'x': array(['2024-01-15T00:00:00.000000000', '2024-01-15T01:00:00.000000000',\n",
- " '2024-01-15T02:00:00.000000000', '2024-01-15T03:00:00.000000000',\n",
- " '2024-01-15T04:00:00.000000000', '2024-01-15T05:00:00.000000000',\n",
- " '2024-01-15T06:00:00.000000000', '2024-01-15T07:00:00.000000000',\n",
- " '2024-01-15T08:00:00.000000000', '2024-01-15T09:00:00.000000000',\n",
- " '2024-01-15T10:00:00.000000000', '2024-01-15T11:00:00.000000000',\n",
- " '2024-01-15T12:00:00.000000000', '2024-01-15T13:00:00.000000000',\n",
- " '2024-01-15T14:00:00.000000000', '2024-01-15T15:00:00.000000000',\n",
- " '2024-01-15T16:00:00.000000000', '2024-01-15T17:00:00.000000000',\n",
- " '2024-01-15T18:00:00.000000000', '2024-01-15T19:00:00.000000000',\n",
- " '2024-01-15T20:00:00.000000000', '2024-01-15T21:00:00.000000000',\n",
- " '2024-01-15T22:00:00.000000000', '2024-01-15T23:00:00.000000000',\n",
- " '2024-01-16T00:00:00.000000000', '2024-01-16T01:00:00.000000000',\n",
- " '2024-01-16T02:00:00.000000000', '2024-01-16T03:00:00.000000000',\n",
- " '2024-01-16T04:00:00.000000000', '2024-01-16T05:00:00.000000000',\n",
- " '2024-01-16T06:00:00.000000000', '2024-01-16T07:00:00.000000000',\n",
- " '2024-01-16T08:00:00.000000000', '2024-01-16T09:00:00.000000000',\n",
- " '2024-01-16T10:00:00.000000000', '2024-01-16T11:00:00.000000000',\n",
- " '2024-01-16T12:00:00.000000000', '2024-01-16T13:00:00.000000000',\n",
- " '2024-01-16T14:00:00.000000000', '2024-01-16T15:00:00.000000000',\n",
- " '2024-01-16T16:00:00.000000000', '2024-01-16T17:00:00.000000000',\n",
- " '2024-01-16T18:00:00.000000000', '2024-01-16T19:00:00.000000000',\n",
- " '2024-01-16T20:00:00.000000000', '2024-01-16T21:00:00.000000000',\n",
- " '2024-01-16T22:00:00.000000000', '2024-01-16T23:00:00.000000000',\n",
- " '2024-01-17T00:00:00.000000000', '2024-01-17T01:00:00.000000000',\n",
- " '2024-01-17T02:00:00.000000000', '2024-01-17T03:00:00.000000000',\n",
- " '2024-01-17T04:00:00.000000000', '2024-01-17T05:00:00.000000000',\n",
- " '2024-01-17T06:00:00.000000000', '2024-01-17T07:00:00.000000000',\n",
- " '2024-01-17T08:00:00.000000000', '2024-01-17T09:00:00.000000000',\n",
- " '2024-01-17T10:00:00.000000000', '2024-01-17T11:00:00.000000000',\n",
- " '2024-01-17T12:00:00.000000000', '2024-01-17T13:00:00.000000000',\n",
- " '2024-01-17T14:00:00.000000000', '2024-01-17T15:00:00.000000000',\n",
- " '2024-01-17T16:00:00.000000000', '2024-01-17T17:00:00.000000000',\n",
- " '2024-01-17T18:00:00.000000000', '2024-01-17T19:00:00.000000000',\n",
- " '2024-01-17T20:00:00.000000000', '2024-01-17T21:00:00.000000000',\n",
- " '2024-01-17T22:00:00.000000000', '2024-01-17T23:00:00.000000000',\n",
- " '2024-01-18T00:00:00.000000000', '2024-01-18T01:00:00.000000000',\n",
- " '2024-01-18T02:00:00.000000000', '2024-01-18T03:00:00.000000000',\n",
- " '2024-01-18T04:00:00.000000000', '2024-01-18T05:00:00.000000000',\n",
- " '2024-01-18T06:00:00.000000000', '2024-01-18T07:00:00.000000000',\n",
- " '2024-01-18T08:00:00.000000000', '2024-01-18T09:00:00.000000000',\n",
- " '2024-01-18T10:00:00.000000000', '2024-01-18T11:00:00.000000000',\n",
- " '2024-01-18T12:00:00.000000000', '2024-01-18T13:00:00.000000000',\n",
- " '2024-01-18T14:00:00.000000000', '2024-01-18T15:00:00.000000000',\n",
- " '2024-01-18T16:00:00.000000000', '2024-01-18T17:00:00.000000000',\n",
- " '2024-01-18T18:00:00.000000000', '2024-01-18T19:00:00.000000000',\n",
- " '2024-01-18T20:00:00.000000000', '2024-01-18T21:00:00.000000000',\n",
- " '2024-01-18T22:00:00.000000000', '2024-01-18T23:00:00.000000000',\n",
- " '2024-01-19T00:00:00.000000000', '2024-01-19T01:00:00.000000000',\n",
- " '2024-01-19T02:00:00.000000000', '2024-01-19T03:00:00.000000000',\n",
- " '2024-01-19T04:00:00.000000000', '2024-01-19T05:00:00.000000000',\n",
- " '2024-01-19T06:00:00.000000000', '2024-01-19T07:00:00.000000000',\n",
- " '2024-01-19T08:00:00.000000000', '2024-01-19T09:00:00.000000000',\n",
- " '2024-01-19T10:00:00.000000000', '2024-01-19T11:00:00.000000000',\n",
- " '2024-01-19T12:00:00.000000000', '2024-01-19T13:00:00.000000000',\n",
- " '2024-01-19T14:00:00.000000000', '2024-01-19T15:00:00.000000000',\n",
- " '2024-01-19T16:00:00.000000000', '2024-01-19T17:00:00.000000000',\n",
- " '2024-01-19T18:00:00.000000000', '2024-01-19T19:00:00.000000000',\n",
- " '2024-01-19T20:00:00.000000000', '2024-01-19T21:00:00.000000000',\n",
- " '2024-01-19T22:00:00.000000000', '2024-01-19T23:00:00.000000000',\n",
- " '2024-01-20T00:00:00.000000000', '2024-01-20T01:00:00.000000000',\n",
- " '2024-01-20T02:00:00.000000000', '2024-01-20T03:00:00.000000000',\n",
- " '2024-01-20T04:00:00.000000000', '2024-01-20T05:00:00.000000000',\n",
- " '2024-01-20T06:00:00.000000000', '2024-01-20T07:00:00.000000000',\n",
- " '2024-01-20T08:00:00.000000000', '2024-01-20T09:00:00.000000000',\n",
- " '2024-01-20T10:00:00.000000000', '2024-01-20T11:00:00.000000000',\n",
- " '2024-01-20T12:00:00.000000000', '2024-01-20T13:00:00.000000000',\n",
- " '2024-01-20T14:00:00.000000000', '2024-01-20T15:00:00.000000000',\n",
- " '2024-01-20T16:00:00.000000000', '2024-01-20T17:00:00.000000000',\n",
- " '2024-01-20T18:00:00.000000000', '2024-01-20T19:00:00.000000000',\n",
- " '2024-01-20T20:00:00.000000000', '2024-01-20T21:00:00.000000000',\n",
- " '2024-01-20T22:00:00.000000000', '2024-01-20T23:00:00.000000000',\n",
- " '2024-01-21T00:00:00.000000000', '2024-01-21T01:00:00.000000000',\n",
- " '2024-01-21T02:00:00.000000000', '2024-01-21T03:00:00.000000000',\n",
- " '2024-01-21T04:00:00.000000000', '2024-01-21T05:00:00.000000000',\n",
- " '2024-01-21T06:00:00.000000000', '2024-01-21T07:00:00.000000000',\n",
- " '2024-01-21T08:00:00.000000000', '2024-01-21T09:00:00.000000000',\n",
- " '2024-01-21T10:00:00.000000000', '2024-01-21T11:00:00.000000000',\n",
- " '2024-01-21T12:00:00.000000000', '2024-01-21T13:00:00.000000000',\n",
- " '2024-01-21T14:00:00.000000000', '2024-01-21T15:00:00.000000000',\n",
- " '2024-01-21T16:00:00.000000000', '2024-01-21T17:00:00.000000000',\n",
- " '2024-01-21T18:00:00.000000000', '2024-01-21T19:00:00.000000000',\n",
- " '2024-01-21T20:00:00.000000000', '2024-01-21T21:00:00.000000000',\n",
- " '2024-01-21T22:00:00.000000000', '2024-01-21T23:00:00.000000000',\n",
- " '2024-01-22T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('GuEHDXSnQUD261BXdds/QI2yoZ56EE' ... 'SmN701QKxDuYXg6WBAAAAAAAAA+H8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'variable=Boiler(Gas)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'Boiler(Gas)',\n",
- " 'line': {'color': '#EF553B', 'dash': 'solid'},\n",
- " 'marker': {'symbol': 'circle'},\n",
- " 'mode': 'lines',\n",
- " 'name': 'Boiler(Gas)',\n",
- " 'showlegend': True,\n",
- " 'type': 'scattergl',\n",
- " 'x': array(['2024-01-15T00:00:00.000000000', '2024-01-15T01:00:00.000000000',\n",
- " '2024-01-15T02:00:00.000000000', '2024-01-15T03:00:00.000000000',\n",
- " '2024-01-15T04:00:00.000000000', '2024-01-15T05:00:00.000000000',\n",
- " '2024-01-15T06:00:00.000000000', '2024-01-15T07:00:00.000000000',\n",
- " '2024-01-15T08:00:00.000000000', '2024-01-15T09:00:00.000000000',\n",
- " '2024-01-15T10:00:00.000000000', '2024-01-15T11:00:00.000000000',\n",
- " '2024-01-15T12:00:00.000000000', '2024-01-15T13:00:00.000000000',\n",
- " '2024-01-15T14:00:00.000000000', '2024-01-15T15:00:00.000000000',\n",
- " '2024-01-15T16:00:00.000000000', '2024-01-15T17:00:00.000000000',\n",
- " '2024-01-15T18:00:00.000000000', '2024-01-15T19:00:00.000000000',\n",
- " '2024-01-15T20:00:00.000000000', '2024-01-15T21:00:00.000000000',\n",
- " '2024-01-15T22:00:00.000000000', '2024-01-15T23:00:00.000000000',\n",
- " '2024-01-16T00:00:00.000000000', '2024-01-16T01:00:00.000000000',\n",
- " '2024-01-16T02:00:00.000000000', '2024-01-16T03:00:00.000000000',\n",
- " '2024-01-16T04:00:00.000000000', '2024-01-16T05:00:00.000000000',\n",
- " '2024-01-16T06:00:00.000000000', '2024-01-16T07:00:00.000000000',\n",
- " '2024-01-16T08:00:00.000000000', '2024-01-16T09:00:00.000000000',\n",
- " '2024-01-16T10:00:00.000000000', '2024-01-16T11:00:00.000000000',\n",
- " '2024-01-16T12:00:00.000000000', '2024-01-16T13:00:00.000000000',\n",
- " '2024-01-16T14:00:00.000000000', '2024-01-16T15:00:00.000000000',\n",
- " '2024-01-16T16:00:00.000000000', '2024-01-16T17:00:00.000000000',\n",
- " '2024-01-16T18:00:00.000000000', '2024-01-16T19:00:00.000000000',\n",
- " '2024-01-16T20:00:00.000000000', '2024-01-16T21:00:00.000000000',\n",
- " '2024-01-16T22:00:00.000000000', '2024-01-16T23:00:00.000000000',\n",
- " '2024-01-17T00:00:00.000000000', '2024-01-17T01:00:00.000000000',\n",
- " '2024-01-17T02:00:00.000000000', '2024-01-17T03:00:00.000000000',\n",
- " '2024-01-17T04:00:00.000000000', '2024-01-17T05:00:00.000000000',\n",
- " '2024-01-17T06:00:00.000000000', '2024-01-17T07:00:00.000000000',\n",
- " '2024-01-17T08:00:00.000000000', '2024-01-17T09:00:00.000000000',\n",
- " '2024-01-17T10:00:00.000000000', '2024-01-17T11:00:00.000000000',\n",
- " '2024-01-17T12:00:00.000000000', '2024-01-17T13:00:00.000000000',\n",
- " '2024-01-17T14:00:00.000000000', '2024-01-17T15:00:00.000000000',\n",
- " '2024-01-17T16:00:00.000000000', '2024-01-17T17:00:00.000000000',\n",
- " '2024-01-17T18:00:00.000000000', '2024-01-17T19:00:00.000000000',\n",
- " '2024-01-17T20:00:00.000000000', '2024-01-17T21:00:00.000000000',\n",
- " '2024-01-17T22:00:00.000000000', '2024-01-17T23:00:00.000000000',\n",
- " '2024-01-18T00:00:00.000000000', '2024-01-18T01:00:00.000000000',\n",
- " '2024-01-18T02:00:00.000000000', '2024-01-18T03:00:00.000000000',\n",
- " '2024-01-18T04:00:00.000000000', '2024-01-18T05:00:00.000000000',\n",
- " '2024-01-18T06:00:00.000000000', '2024-01-18T07:00:00.000000000',\n",
- " '2024-01-18T08:00:00.000000000', '2024-01-18T09:00:00.000000000',\n",
- " '2024-01-18T10:00:00.000000000', '2024-01-18T11:00:00.000000000',\n",
- " '2024-01-18T12:00:00.000000000', '2024-01-18T13:00:00.000000000',\n",
- " '2024-01-18T14:00:00.000000000', '2024-01-18T15:00:00.000000000',\n",
- " '2024-01-18T16:00:00.000000000', '2024-01-18T17:00:00.000000000',\n",
- " '2024-01-18T18:00:00.000000000', '2024-01-18T19:00:00.000000000',\n",
- " '2024-01-18T20:00:00.000000000', '2024-01-18T21:00:00.000000000',\n",
- " '2024-01-18T22:00:00.000000000', '2024-01-18T23:00:00.000000000',\n",
- " '2024-01-19T00:00:00.000000000', '2024-01-19T01:00:00.000000000',\n",
- " '2024-01-19T02:00:00.000000000', '2024-01-19T03:00:00.000000000',\n",
- " '2024-01-19T04:00:00.000000000', '2024-01-19T05:00:00.000000000',\n",
- " '2024-01-19T06:00:00.000000000', '2024-01-19T07:00:00.000000000',\n",
- " '2024-01-19T08:00:00.000000000', '2024-01-19T09:00:00.000000000',\n",
- " '2024-01-19T10:00:00.000000000', '2024-01-19T11:00:00.000000000',\n",
- " '2024-01-19T12:00:00.000000000', '2024-01-19T13:00:00.000000000',\n",
- " '2024-01-19T14:00:00.000000000', '2024-01-19T15:00:00.000000000',\n",
- " '2024-01-19T16:00:00.000000000', '2024-01-19T17:00:00.000000000',\n",
- " '2024-01-19T18:00:00.000000000', '2024-01-19T19:00:00.000000000',\n",
- " '2024-01-19T20:00:00.000000000', '2024-01-19T21:00:00.000000000',\n",
- " '2024-01-19T22:00:00.000000000', '2024-01-19T23:00:00.000000000',\n",
- " '2024-01-20T00:00:00.000000000', '2024-01-20T01:00:00.000000000',\n",
- " '2024-01-20T02:00:00.000000000', '2024-01-20T03:00:00.000000000',\n",
- " '2024-01-20T04:00:00.000000000', '2024-01-20T05:00:00.000000000',\n",
- " '2024-01-20T06:00:00.000000000', '2024-01-20T07:00:00.000000000',\n",
- " '2024-01-20T08:00:00.000000000', '2024-01-20T09:00:00.000000000',\n",
- " '2024-01-20T10:00:00.000000000', '2024-01-20T11:00:00.000000000',\n",
- " '2024-01-20T12:00:00.000000000', '2024-01-20T13:00:00.000000000',\n",
- " '2024-01-20T14:00:00.000000000', '2024-01-20T15:00:00.000000000',\n",
- " '2024-01-20T16:00:00.000000000', '2024-01-20T17:00:00.000000000',\n",
- " '2024-01-20T18:00:00.000000000', '2024-01-20T19:00:00.000000000',\n",
- " '2024-01-20T20:00:00.000000000', '2024-01-20T21:00:00.000000000',\n",
- " '2024-01-20T22:00:00.000000000', '2024-01-20T23:00:00.000000000',\n",
- " '2024-01-21T00:00:00.000000000', '2024-01-21T01:00:00.000000000',\n",
- " '2024-01-21T02:00:00.000000000', '2024-01-21T03:00:00.000000000',\n",
- " '2024-01-21T04:00:00.000000000', '2024-01-21T05:00:00.000000000',\n",
- " '2024-01-21T06:00:00.000000000', '2024-01-21T07:00:00.000000000',\n",
- " '2024-01-21T08:00:00.000000000', '2024-01-21T09:00:00.000000000',\n",
- " '2024-01-21T10:00:00.000000000', '2024-01-21T11:00:00.000000000',\n",
- " '2024-01-21T12:00:00.000000000', '2024-01-21T13:00:00.000000000',\n",
- " '2024-01-21T14:00:00.000000000', '2024-01-21T15:00:00.000000000',\n",
- " '2024-01-21T16:00:00.000000000', '2024-01-21T17:00:00.000000000',\n",
- " '2024-01-21T18:00:00.000000000', '2024-01-21T19:00:00.000000000',\n",
- " '2024-01-21T20:00:00.000000000', '2024-01-21T21:00:00.000000000',\n",
- " '2024-01-21T22:00:00.000000000', '2024-01-21T23:00:00.000000000',\n",
- " '2024-01-22T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('GuEHDXSnQUD261BXdds/QI2yoZ56EE' ... 'SmN701QKxDuYXg6WBAAAAAAAAA+H8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'variable=Boiler(Heat)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'Boiler(Heat)',\n",
- " 'line': {'color': '#00CC96', 'dash': 'solid'},\n",
- " 'marker': {'symbol': 'circle'},\n",
- " 'mode': 'lines',\n",
- " 'name': 'Boiler(Heat)',\n",
- " 'showlegend': True,\n",
- " 'type': 'scattergl',\n",
- " 'x': array(['2024-01-15T00:00:00.000000000', '2024-01-15T01:00:00.000000000',\n",
- " '2024-01-15T02:00:00.000000000', '2024-01-15T03:00:00.000000000',\n",
- " '2024-01-15T04:00:00.000000000', '2024-01-15T05:00:00.000000000',\n",
- " '2024-01-15T06:00:00.000000000', '2024-01-15T07:00:00.000000000',\n",
- " '2024-01-15T08:00:00.000000000', '2024-01-15T09:00:00.000000000',\n",
- " '2024-01-15T10:00:00.000000000', '2024-01-15T11:00:00.000000000',\n",
- " '2024-01-15T12:00:00.000000000', '2024-01-15T13:00:00.000000000',\n",
- " '2024-01-15T14:00:00.000000000', '2024-01-15T15:00:00.000000000',\n",
- " '2024-01-15T16:00:00.000000000', '2024-01-15T17:00:00.000000000',\n",
- " '2024-01-15T18:00:00.000000000', '2024-01-15T19:00:00.000000000',\n",
- " '2024-01-15T20:00:00.000000000', '2024-01-15T21:00:00.000000000',\n",
- " '2024-01-15T22:00:00.000000000', '2024-01-15T23:00:00.000000000',\n",
- " '2024-01-16T00:00:00.000000000', '2024-01-16T01:00:00.000000000',\n",
- " '2024-01-16T02:00:00.000000000', '2024-01-16T03:00:00.000000000',\n",
- " '2024-01-16T04:00:00.000000000', '2024-01-16T05:00:00.000000000',\n",
- " '2024-01-16T06:00:00.000000000', '2024-01-16T07:00:00.000000000',\n",
- " '2024-01-16T08:00:00.000000000', '2024-01-16T09:00:00.000000000',\n",
- " '2024-01-16T10:00:00.000000000', '2024-01-16T11:00:00.000000000',\n",
- " '2024-01-16T12:00:00.000000000', '2024-01-16T13:00:00.000000000',\n",
- " '2024-01-16T14:00:00.000000000', '2024-01-16T15:00:00.000000000',\n",
- " '2024-01-16T16:00:00.000000000', '2024-01-16T17:00:00.000000000',\n",
- " '2024-01-16T18:00:00.000000000', '2024-01-16T19:00:00.000000000',\n",
- " '2024-01-16T20:00:00.000000000', '2024-01-16T21:00:00.000000000',\n",
- " '2024-01-16T22:00:00.000000000', '2024-01-16T23:00:00.000000000',\n",
- " '2024-01-17T00:00:00.000000000', '2024-01-17T01:00:00.000000000',\n",
- " '2024-01-17T02:00:00.000000000', '2024-01-17T03:00:00.000000000',\n",
- " '2024-01-17T04:00:00.000000000', '2024-01-17T05:00:00.000000000',\n",
- " '2024-01-17T06:00:00.000000000', '2024-01-17T07:00:00.000000000',\n",
- " '2024-01-17T08:00:00.000000000', '2024-01-17T09:00:00.000000000',\n",
- " '2024-01-17T10:00:00.000000000', '2024-01-17T11:00:00.000000000',\n",
- " '2024-01-17T12:00:00.000000000', '2024-01-17T13:00:00.000000000',\n",
- " '2024-01-17T14:00:00.000000000', '2024-01-17T15:00:00.000000000',\n",
- " '2024-01-17T16:00:00.000000000', '2024-01-17T17:00:00.000000000',\n",
- " '2024-01-17T18:00:00.000000000', '2024-01-17T19:00:00.000000000',\n",
- " '2024-01-17T20:00:00.000000000', '2024-01-17T21:00:00.000000000',\n",
- " '2024-01-17T22:00:00.000000000', '2024-01-17T23:00:00.000000000',\n",
- " '2024-01-18T00:00:00.000000000', '2024-01-18T01:00:00.000000000',\n",
- " '2024-01-18T02:00:00.000000000', '2024-01-18T03:00:00.000000000',\n",
- " '2024-01-18T04:00:00.000000000', '2024-01-18T05:00:00.000000000',\n",
- " '2024-01-18T06:00:00.000000000', '2024-01-18T07:00:00.000000000',\n",
- " '2024-01-18T08:00:00.000000000', '2024-01-18T09:00:00.000000000',\n",
- " '2024-01-18T10:00:00.000000000', '2024-01-18T11:00:00.000000000',\n",
- " '2024-01-18T12:00:00.000000000', '2024-01-18T13:00:00.000000000',\n",
- " '2024-01-18T14:00:00.000000000', '2024-01-18T15:00:00.000000000',\n",
- " '2024-01-18T16:00:00.000000000', '2024-01-18T17:00:00.000000000',\n",
- " '2024-01-18T18:00:00.000000000', '2024-01-18T19:00:00.000000000',\n",
- " '2024-01-18T20:00:00.000000000', '2024-01-18T21:00:00.000000000',\n",
- " '2024-01-18T22:00:00.000000000', '2024-01-18T23:00:00.000000000',\n",
- " '2024-01-19T00:00:00.000000000', '2024-01-19T01:00:00.000000000',\n",
- " '2024-01-19T02:00:00.000000000', '2024-01-19T03:00:00.000000000',\n",
- " '2024-01-19T04:00:00.000000000', '2024-01-19T05:00:00.000000000',\n",
- " '2024-01-19T06:00:00.000000000', '2024-01-19T07:00:00.000000000',\n",
- " '2024-01-19T08:00:00.000000000', '2024-01-19T09:00:00.000000000',\n",
- " '2024-01-19T10:00:00.000000000', '2024-01-19T11:00:00.000000000',\n",
- " '2024-01-19T12:00:00.000000000', '2024-01-19T13:00:00.000000000',\n",
- " '2024-01-19T14:00:00.000000000', '2024-01-19T15:00:00.000000000',\n",
- " '2024-01-19T16:00:00.000000000', '2024-01-19T17:00:00.000000000',\n",
- " '2024-01-19T18:00:00.000000000', '2024-01-19T19:00:00.000000000',\n",
- " '2024-01-19T20:00:00.000000000', '2024-01-19T21:00:00.000000000',\n",
- " '2024-01-19T22:00:00.000000000', '2024-01-19T23:00:00.000000000',\n",
- " '2024-01-20T00:00:00.000000000', '2024-01-20T01:00:00.000000000',\n",
- " '2024-01-20T02:00:00.000000000', '2024-01-20T03:00:00.000000000',\n",
- " '2024-01-20T04:00:00.000000000', '2024-01-20T05:00:00.000000000',\n",
- " '2024-01-20T06:00:00.000000000', '2024-01-20T07:00:00.000000000',\n",
- " '2024-01-20T08:00:00.000000000', '2024-01-20T09:00:00.000000000',\n",
- " '2024-01-20T10:00:00.000000000', '2024-01-20T11:00:00.000000000',\n",
- " '2024-01-20T12:00:00.000000000', '2024-01-20T13:00:00.000000000',\n",
- " '2024-01-20T14:00:00.000000000', '2024-01-20T15:00:00.000000000',\n",
- " '2024-01-20T16:00:00.000000000', '2024-01-20T17:00:00.000000000',\n",
- " '2024-01-20T18:00:00.000000000', '2024-01-20T19:00:00.000000000',\n",
- " '2024-01-20T20:00:00.000000000', '2024-01-20T21:00:00.000000000',\n",
- " '2024-01-20T22:00:00.000000000', '2024-01-20T23:00:00.000000000',\n",
- " '2024-01-21T00:00:00.000000000', '2024-01-21T01:00:00.000000000',\n",
- " '2024-01-21T02:00:00.000000000', '2024-01-21T03:00:00.000000000',\n",
- " '2024-01-21T04:00:00.000000000', '2024-01-21T05:00:00.000000000',\n",
- " '2024-01-21T06:00:00.000000000', '2024-01-21T07:00:00.000000000',\n",
- " '2024-01-21T08:00:00.000000000', '2024-01-21T09:00:00.000000000',\n",
- " '2024-01-21T10:00:00.000000000', '2024-01-21T11:00:00.000000000',\n",
- " '2024-01-21T12:00:00.000000000', '2024-01-21T13:00:00.000000000',\n",
- " '2024-01-21T14:00:00.000000000', '2024-01-21T15:00:00.000000000',\n",
- " '2024-01-21T16:00:00.000000000', '2024-01-21T17:00:00.000000000',\n",
- " '2024-01-21T18:00:00.000000000', '2024-01-21T19:00:00.000000000',\n",
- " '2024-01-21T20:00:00.000000000', '2024-01-21T21:00:00.000000000',\n",
- " '2024-01-21T22:00:00.000000000', '2024-01-21T23:00:00.000000000',\n",
- " '2024-01-22T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('5ZuWpeU9QED3U8WNBU89QHjXQkqFnk' ... '////8zQPW5+Ef5Hl9AAAAAAAAA+H8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'variable=ThermalStorage(Charge)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'ThermalStorage(Charge)',\n",
- " 'line': {'color': '#AB63FA', 'dash': 'solid'},\n",
- " 'marker': {'symbol': 'circle'},\n",
- " 'mode': 'lines',\n",
- " 'name': 'ThermalStorage(Charge)',\n",
- " 'showlegend': True,\n",
- " 'type': 'scattergl',\n",
- " 'x': array(['2024-01-15T00:00:00.000000000', '2024-01-15T01:00:00.000000000',\n",
- " '2024-01-15T02:00:00.000000000', '2024-01-15T03:00:00.000000000',\n",
- " '2024-01-15T04:00:00.000000000', '2024-01-15T05:00:00.000000000',\n",
- " '2024-01-15T06:00:00.000000000', '2024-01-15T07:00:00.000000000',\n",
- " '2024-01-15T08:00:00.000000000', '2024-01-15T09:00:00.000000000',\n",
- " '2024-01-15T10:00:00.000000000', '2024-01-15T11:00:00.000000000',\n",
- " '2024-01-15T12:00:00.000000000', '2024-01-15T13:00:00.000000000',\n",
- " '2024-01-15T14:00:00.000000000', '2024-01-15T15:00:00.000000000',\n",
- " '2024-01-15T16:00:00.000000000', '2024-01-15T17:00:00.000000000',\n",
- " '2024-01-15T18:00:00.000000000', '2024-01-15T19:00:00.000000000',\n",
- " '2024-01-15T20:00:00.000000000', '2024-01-15T21:00:00.000000000',\n",
- " '2024-01-15T22:00:00.000000000', '2024-01-15T23:00:00.000000000',\n",
- " '2024-01-16T00:00:00.000000000', '2024-01-16T01:00:00.000000000',\n",
- " '2024-01-16T02:00:00.000000000', '2024-01-16T03:00:00.000000000',\n",
- " '2024-01-16T04:00:00.000000000', '2024-01-16T05:00:00.000000000',\n",
- " '2024-01-16T06:00:00.000000000', '2024-01-16T07:00:00.000000000',\n",
- " '2024-01-16T08:00:00.000000000', '2024-01-16T09:00:00.000000000',\n",
- " '2024-01-16T10:00:00.000000000', '2024-01-16T11:00:00.000000000',\n",
- " '2024-01-16T12:00:00.000000000', '2024-01-16T13:00:00.000000000',\n",
- " '2024-01-16T14:00:00.000000000', '2024-01-16T15:00:00.000000000',\n",
- " '2024-01-16T16:00:00.000000000', '2024-01-16T17:00:00.000000000',\n",
- " '2024-01-16T18:00:00.000000000', '2024-01-16T19:00:00.000000000',\n",
- " '2024-01-16T20:00:00.000000000', '2024-01-16T21:00:00.000000000',\n",
- " '2024-01-16T22:00:00.000000000', '2024-01-16T23:00:00.000000000',\n",
- " '2024-01-17T00:00:00.000000000', '2024-01-17T01:00:00.000000000',\n",
- " '2024-01-17T02:00:00.000000000', '2024-01-17T03:00:00.000000000',\n",
- " '2024-01-17T04:00:00.000000000', '2024-01-17T05:00:00.000000000',\n",
- " '2024-01-17T06:00:00.000000000', '2024-01-17T07:00:00.000000000',\n",
- " '2024-01-17T08:00:00.000000000', '2024-01-17T09:00:00.000000000',\n",
- " '2024-01-17T10:00:00.000000000', '2024-01-17T11:00:00.000000000',\n",
- " '2024-01-17T12:00:00.000000000', '2024-01-17T13:00:00.000000000',\n",
- " '2024-01-17T14:00:00.000000000', '2024-01-17T15:00:00.000000000',\n",
- " '2024-01-17T16:00:00.000000000', '2024-01-17T17:00:00.000000000',\n",
- " '2024-01-17T18:00:00.000000000', '2024-01-17T19:00:00.000000000',\n",
- " '2024-01-17T20:00:00.000000000', '2024-01-17T21:00:00.000000000',\n",
- " '2024-01-17T22:00:00.000000000', '2024-01-17T23:00:00.000000000',\n",
- " '2024-01-18T00:00:00.000000000', '2024-01-18T01:00:00.000000000',\n",
- " '2024-01-18T02:00:00.000000000', '2024-01-18T03:00:00.000000000',\n",
- " '2024-01-18T04:00:00.000000000', '2024-01-18T05:00:00.000000000',\n",
- " '2024-01-18T06:00:00.000000000', '2024-01-18T07:00:00.000000000',\n",
- " '2024-01-18T08:00:00.000000000', '2024-01-18T09:00:00.000000000',\n",
- " '2024-01-18T10:00:00.000000000', '2024-01-18T11:00:00.000000000',\n",
- " '2024-01-18T12:00:00.000000000', '2024-01-18T13:00:00.000000000',\n",
- " '2024-01-18T14:00:00.000000000', '2024-01-18T15:00:00.000000000',\n",
- " '2024-01-18T16:00:00.000000000', '2024-01-18T17:00:00.000000000',\n",
- " '2024-01-18T18:00:00.000000000', '2024-01-18T19:00:00.000000000',\n",
- " '2024-01-18T20:00:00.000000000', '2024-01-18T21:00:00.000000000',\n",
- " '2024-01-18T22:00:00.000000000', '2024-01-18T23:00:00.000000000',\n",
- " '2024-01-19T00:00:00.000000000', '2024-01-19T01:00:00.000000000',\n",
- " '2024-01-19T02:00:00.000000000', '2024-01-19T03:00:00.000000000',\n",
- " '2024-01-19T04:00:00.000000000', '2024-01-19T05:00:00.000000000',\n",
- " '2024-01-19T06:00:00.000000000', '2024-01-19T07:00:00.000000000',\n",
- " '2024-01-19T08:00:00.000000000', '2024-01-19T09:00:00.000000000',\n",
- " '2024-01-19T10:00:00.000000000', '2024-01-19T11:00:00.000000000',\n",
- " '2024-01-19T12:00:00.000000000', '2024-01-19T13:00:00.000000000',\n",
- " '2024-01-19T14:00:00.000000000', '2024-01-19T15:00:00.000000000',\n",
- " '2024-01-19T16:00:00.000000000', '2024-01-19T17:00:00.000000000',\n",
- " '2024-01-19T18:00:00.000000000', '2024-01-19T19:00:00.000000000',\n",
- " '2024-01-19T20:00:00.000000000', '2024-01-19T21:00:00.000000000',\n",
- " '2024-01-19T22:00:00.000000000', '2024-01-19T23:00:00.000000000',\n",
- " '2024-01-20T00:00:00.000000000', '2024-01-20T01:00:00.000000000',\n",
- " '2024-01-20T02:00:00.000000000', '2024-01-20T03:00:00.000000000',\n",
- " '2024-01-20T04:00:00.000000000', '2024-01-20T05:00:00.000000000',\n",
- " '2024-01-20T06:00:00.000000000', '2024-01-20T07:00:00.000000000',\n",
- " '2024-01-20T08:00:00.000000000', '2024-01-20T09:00:00.000000000',\n",
- " '2024-01-20T10:00:00.000000000', '2024-01-20T11:00:00.000000000',\n",
- " '2024-01-20T12:00:00.000000000', '2024-01-20T13:00:00.000000000',\n",
- " '2024-01-20T14:00:00.000000000', '2024-01-20T15:00:00.000000000',\n",
- " '2024-01-20T16:00:00.000000000', '2024-01-20T17:00:00.000000000',\n",
- " '2024-01-20T18:00:00.000000000', '2024-01-20T19:00:00.000000000',\n",
- " '2024-01-20T20:00:00.000000000', '2024-01-20T21:00:00.000000000',\n",
- " '2024-01-20T22:00:00.000000000', '2024-01-20T23:00:00.000000000',\n",
- " '2024-01-21T00:00:00.000000000', '2024-01-21T01:00:00.000000000',\n",
- " '2024-01-21T02:00:00.000000000', '2024-01-21T03:00:00.000000000',\n",
- " '2024-01-21T04:00:00.000000000', '2024-01-21T05:00:00.000000000',\n",
- " '2024-01-21T06:00:00.000000000', '2024-01-21T07:00:00.000000000',\n",
- " '2024-01-21T08:00:00.000000000', '2024-01-21T09:00:00.000000000',\n",
- " '2024-01-21T10:00:00.000000000', '2024-01-21T11:00:00.000000000',\n",
- " '2024-01-21T12:00:00.000000000', '2024-01-21T13:00:00.000000000',\n",
- " '2024-01-21T14:00:00.000000000', '2024-01-21T15:00:00.000000000',\n",
- " '2024-01-21T16:00:00.000000000', '2024-01-21T17:00:00.000000000',\n",
- " '2024-01-21T18:00:00.000000000', '2024-01-21T19:00:00.000000000',\n",
- " '2024-01-21T20:00:00.000000000', '2024-01-21T21:00:00.000000000',\n",
- " '2024-01-21T22:00:00.000000000', '2024-01-21T23:00:00.000000000',\n",
- " '2024-01-22T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('AAAAAAAAAAAUfPDBB19avby8nSEx72' ... 'AAAAAAANj//////1hAAAAAAAAA+H8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'variable=ThermalStorage(Discharge)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'ThermalStorage(Discharge)',\n",
- " 'line': {'color': '#FFA15A', 'dash': 'solid'},\n",
- " 'marker': {'symbol': 'circle'},\n",
- " 'mode': 'lines',\n",
- " 'name': 'ThermalStorage(Discharge)',\n",
- " 'showlegend': True,\n",
- " 'type': 'scattergl',\n",
- " 'x': array(['2024-01-15T00:00:00.000000000', '2024-01-15T01:00:00.000000000',\n",
- " '2024-01-15T02:00:00.000000000', '2024-01-15T03:00:00.000000000',\n",
- " '2024-01-15T04:00:00.000000000', '2024-01-15T05:00:00.000000000',\n",
- " '2024-01-15T06:00:00.000000000', '2024-01-15T07:00:00.000000000',\n",
- " '2024-01-15T08:00:00.000000000', '2024-01-15T09:00:00.000000000',\n",
- " '2024-01-15T10:00:00.000000000', '2024-01-15T11:00:00.000000000',\n",
- " '2024-01-15T12:00:00.000000000', '2024-01-15T13:00:00.000000000',\n",
- " '2024-01-15T14:00:00.000000000', '2024-01-15T15:00:00.000000000',\n",
- " '2024-01-15T16:00:00.000000000', '2024-01-15T17:00:00.000000000',\n",
- " '2024-01-15T18:00:00.000000000', '2024-01-15T19:00:00.000000000',\n",
- " '2024-01-15T20:00:00.000000000', '2024-01-15T21:00:00.000000000',\n",
- " '2024-01-15T22:00:00.000000000', '2024-01-15T23:00:00.000000000',\n",
- " '2024-01-16T00:00:00.000000000', '2024-01-16T01:00:00.000000000',\n",
- " '2024-01-16T02:00:00.000000000', '2024-01-16T03:00:00.000000000',\n",
- " '2024-01-16T04:00:00.000000000', '2024-01-16T05:00:00.000000000',\n",
- " '2024-01-16T06:00:00.000000000', '2024-01-16T07:00:00.000000000',\n",
- " '2024-01-16T08:00:00.000000000', '2024-01-16T09:00:00.000000000',\n",
- " '2024-01-16T10:00:00.000000000', '2024-01-16T11:00:00.000000000',\n",
- " '2024-01-16T12:00:00.000000000', '2024-01-16T13:00:00.000000000',\n",
- " '2024-01-16T14:00:00.000000000', '2024-01-16T15:00:00.000000000',\n",
- " '2024-01-16T16:00:00.000000000', '2024-01-16T17:00:00.000000000',\n",
- " '2024-01-16T18:00:00.000000000', '2024-01-16T19:00:00.000000000',\n",
- " '2024-01-16T20:00:00.000000000', '2024-01-16T21:00:00.000000000',\n",
- " '2024-01-16T22:00:00.000000000', '2024-01-16T23:00:00.000000000',\n",
- " '2024-01-17T00:00:00.000000000', '2024-01-17T01:00:00.000000000',\n",
- " '2024-01-17T02:00:00.000000000', '2024-01-17T03:00:00.000000000',\n",
- " '2024-01-17T04:00:00.000000000', '2024-01-17T05:00:00.000000000',\n",
- " '2024-01-17T06:00:00.000000000', '2024-01-17T07:00:00.000000000',\n",
- " '2024-01-17T08:00:00.000000000', '2024-01-17T09:00:00.000000000',\n",
- " '2024-01-17T10:00:00.000000000', '2024-01-17T11:00:00.000000000',\n",
- " '2024-01-17T12:00:00.000000000', '2024-01-17T13:00:00.000000000',\n",
- " '2024-01-17T14:00:00.000000000', '2024-01-17T15:00:00.000000000',\n",
- " '2024-01-17T16:00:00.000000000', '2024-01-17T17:00:00.000000000',\n",
- " '2024-01-17T18:00:00.000000000', '2024-01-17T19:00:00.000000000',\n",
- " '2024-01-17T20:00:00.000000000', '2024-01-17T21:00:00.000000000',\n",
- " '2024-01-17T22:00:00.000000000', '2024-01-17T23:00:00.000000000',\n",
- " '2024-01-18T00:00:00.000000000', '2024-01-18T01:00:00.000000000',\n",
- " '2024-01-18T02:00:00.000000000', '2024-01-18T03:00:00.000000000',\n",
- " '2024-01-18T04:00:00.000000000', '2024-01-18T05:00:00.000000000',\n",
- " '2024-01-18T06:00:00.000000000', '2024-01-18T07:00:00.000000000',\n",
- " '2024-01-18T08:00:00.000000000', '2024-01-18T09:00:00.000000000',\n",
- " '2024-01-18T10:00:00.000000000', '2024-01-18T11:00:00.000000000',\n",
- " '2024-01-18T12:00:00.000000000', '2024-01-18T13:00:00.000000000',\n",
- " '2024-01-18T14:00:00.000000000', '2024-01-18T15:00:00.000000000',\n",
- " '2024-01-18T16:00:00.000000000', '2024-01-18T17:00:00.000000000',\n",
- " '2024-01-18T18:00:00.000000000', '2024-01-18T19:00:00.000000000',\n",
- " '2024-01-18T20:00:00.000000000', '2024-01-18T21:00:00.000000000',\n",
- " '2024-01-18T22:00:00.000000000', '2024-01-18T23:00:00.000000000',\n",
- " '2024-01-19T00:00:00.000000000', '2024-01-19T01:00:00.000000000',\n",
- " '2024-01-19T02:00:00.000000000', '2024-01-19T03:00:00.000000000',\n",
- " '2024-01-19T04:00:00.000000000', '2024-01-19T05:00:00.000000000',\n",
- " '2024-01-19T06:00:00.000000000', '2024-01-19T07:00:00.000000000',\n",
- " '2024-01-19T08:00:00.000000000', '2024-01-19T09:00:00.000000000',\n",
- " '2024-01-19T10:00:00.000000000', '2024-01-19T11:00:00.000000000',\n",
- " '2024-01-19T12:00:00.000000000', '2024-01-19T13:00:00.000000000',\n",
- " '2024-01-19T14:00:00.000000000', '2024-01-19T15:00:00.000000000',\n",
- " '2024-01-19T16:00:00.000000000', '2024-01-19T17:00:00.000000000',\n",
- " '2024-01-19T18:00:00.000000000', '2024-01-19T19:00:00.000000000',\n",
- " '2024-01-19T20:00:00.000000000', '2024-01-19T21:00:00.000000000',\n",
- " '2024-01-19T22:00:00.000000000', '2024-01-19T23:00:00.000000000',\n",
- " '2024-01-20T00:00:00.000000000', '2024-01-20T01:00:00.000000000',\n",
- " '2024-01-20T02:00:00.000000000', '2024-01-20T03:00:00.000000000',\n",
- " '2024-01-20T04:00:00.000000000', '2024-01-20T05:00:00.000000000',\n",
- " '2024-01-20T06:00:00.000000000', '2024-01-20T07:00:00.000000000',\n",
- " '2024-01-20T08:00:00.000000000', '2024-01-20T09:00:00.000000000',\n",
- " '2024-01-20T10:00:00.000000000', '2024-01-20T11:00:00.000000000',\n",
- " '2024-01-20T12:00:00.000000000', '2024-01-20T13:00:00.000000000',\n",
- " '2024-01-20T14:00:00.000000000', '2024-01-20T15:00:00.000000000',\n",
- " '2024-01-20T16:00:00.000000000', '2024-01-20T17:00:00.000000000',\n",
- " '2024-01-20T18:00:00.000000000', '2024-01-20T19:00:00.000000000',\n",
- " '2024-01-20T20:00:00.000000000', '2024-01-20T21:00:00.000000000',\n",
- " '2024-01-20T22:00:00.000000000', '2024-01-20T23:00:00.000000000',\n",
- " '2024-01-21T00:00:00.000000000', '2024-01-21T01:00:00.000000000',\n",
- " '2024-01-21T02:00:00.000000000', '2024-01-21T03:00:00.000000000',\n",
- " '2024-01-21T04:00:00.000000000', '2024-01-21T05:00:00.000000000',\n",
- " '2024-01-21T06:00:00.000000000', '2024-01-21T07:00:00.000000000',\n",
- " '2024-01-21T08:00:00.000000000', '2024-01-21T09:00:00.000000000',\n",
- " '2024-01-21T10:00:00.000000000', '2024-01-21T11:00:00.000000000',\n",
- " '2024-01-21T12:00:00.000000000', '2024-01-21T13:00:00.000000000',\n",
- " '2024-01-21T14:00:00.000000000', '2024-01-21T15:00:00.000000000',\n",
- " '2024-01-21T16:00:00.000000000', '2024-01-21T17:00:00.000000000',\n",
- " '2024-01-21T18:00:00.000000000', '2024-01-21T19:00:00.000000000',\n",
- " '2024-01-21T20:00:00.000000000', '2024-01-21T21:00:00.000000000',\n",
- " '2024-01-21T22:00:00.000000000', '2024-01-21T23:00:00.000000000',\n",
- " '2024-01-22T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('AAAAAAAAAAAKPvjgg49ivby8nSEx72' ... 'AAAAAgPWP9SoFav2i9AAAAAAAA+H8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'variable=Office(Heat)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'Office(Heat)',\n",
- " 'line': {'color': '#19D3F3', 'dash': 'solid'},\n",
- " 'marker': {'symbol': 'circle'},\n",
- " 'mode': 'lines',\n",
- " 'name': 'Office(Heat)',\n",
- " 'showlegend': True,\n",
- " 'type': 'scattergl',\n",
- " 'x': array(['2024-01-15T00:00:00.000000000', '2024-01-15T01:00:00.000000000',\n",
- " '2024-01-15T02:00:00.000000000', '2024-01-15T03:00:00.000000000',\n",
- " '2024-01-15T04:00:00.000000000', '2024-01-15T05:00:00.000000000',\n",
- " '2024-01-15T06:00:00.000000000', '2024-01-15T07:00:00.000000000',\n",
- " '2024-01-15T08:00:00.000000000', '2024-01-15T09:00:00.000000000',\n",
- " '2024-01-15T10:00:00.000000000', '2024-01-15T11:00:00.000000000',\n",
- " '2024-01-15T12:00:00.000000000', '2024-01-15T13:00:00.000000000',\n",
- " '2024-01-15T14:00:00.000000000', '2024-01-15T15:00:00.000000000',\n",
- " '2024-01-15T16:00:00.000000000', '2024-01-15T17:00:00.000000000',\n",
- " '2024-01-15T18:00:00.000000000', '2024-01-15T19:00:00.000000000',\n",
- " '2024-01-15T20:00:00.000000000', '2024-01-15T21:00:00.000000000',\n",
- " '2024-01-15T22:00:00.000000000', '2024-01-15T23:00:00.000000000',\n",
- " '2024-01-16T00:00:00.000000000', '2024-01-16T01:00:00.000000000',\n",
- " '2024-01-16T02:00:00.000000000', '2024-01-16T03:00:00.000000000',\n",
- " '2024-01-16T04:00:00.000000000', '2024-01-16T05:00:00.000000000',\n",
- " '2024-01-16T06:00:00.000000000', '2024-01-16T07:00:00.000000000',\n",
- " '2024-01-16T08:00:00.000000000', '2024-01-16T09:00:00.000000000',\n",
- " '2024-01-16T10:00:00.000000000', '2024-01-16T11:00:00.000000000',\n",
- " '2024-01-16T12:00:00.000000000', '2024-01-16T13:00:00.000000000',\n",
- " '2024-01-16T14:00:00.000000000', '2024-01-16T15:00:00.000000000',\n",
- " '2024-01-16T16:00:00.000000000', '2024-01-16T17:00:00.000000000',\n",
- " '2024-01-16T18:00:00.000000000', '2024-01-16T19:00:00.000000000',\n",
- " '2024-01-16T20:00:00.000000000', '2024-01-16T21:00:00.000000000',\n",
- " '2024-01-16T22:00:00.000000000', '2024-01-16T23:00:00.000000000',\n",
- " '2024-01-17T00:00:00.000000000', '2024-01-17T01:00:00.000000000',\n",
- " '2024-01-17T02:00:00.000000000', '2024-01-17T03:00:00.000000000',\n",
- " '2024-01-17T04:00:00.000000000', '2024-01-17T05:00:00.000000000',\n",
- " '2024-01-17T06:00:00.000000000', '2024-01-17T07:00:00.000000000',\n",
- " '2024-01-17T08:00:00.000000000', '2024-01-17T09:00:00.000000000',\n",
- " '2024-01-17T10:00:00.000000000', '2024-01-17T11:00:00.000000000',\n",
- " '2024-01-17T12:00:00.000000000', '2024-01-17T13:00:00.000000000',\n",
- " '2024-01-17T14:00:00.000000000', '2024-01-17T15:00:00.000000000',\n",
- " '2024-01-17T16:00:00.000000000', '2024-01-17T17:00:00.000000000',\n",
- " '2024-01-17T18:00:00.000000000', '2024-01-17T19:00:00.000000000',\n",
- " '2024-01-17T20:00:00.000000000', '2024-01-17T21:00:00.000000000',\n",
- " '2024-01-17T22:00:00.000000000', '2024-01-17T23:00:00.000000000',\n",
- " '2024-01-18T00:00:00.000000000', '2024-01-18T01:00:00.000000000',\n",
- " '2024-01-18T02:00:00.000000000', '2024-01-18T03:00:00.000000000',\n",
- " '2024-01-18T04:00:00.000000000', '2024-01-18T05:00:00.000000000',\n",
- " '2024-01-18T06:00:00.000000000', '2024-01-18T07:00:00.000000000',\n",
- " '2024-01-18T08:00:00.000000000', '2024-01-18T09:00:00.000000000',\n",
- " '2024-01-18T10:00:00.000000000', '2024-01-18T11:00:00.000000000',\n",
- " '2024-01-18T12:00:00.000000000', '2024-01-18T13:00:00.000000000',\n",
- " '2024-01-18T14:00:00.000000000', '2024-01-18T15:00:00.000000000',\n",
- " '2024-01-18T16:00:00.000000000', '2024-01-18T17:00:00.000000000',\n",
- " '2024-01-18T18:00:00.000000000', '2024-01-18T19:00:00.000000000',\n",
- " '2024-01-18T20:00:00.000000000', '2024-01-18T21:00:00.000000000',\n",
- " '2024-01-18T22:00:00.000000000', '2024-01-18T23:00:00.000000000',\n",
- " '2024-01-19T00:00:00.000000000', '2024-01-19T01:00:00.000000000',\n",
- " '2024-01-19T02:00:00.000000000', '2024-01-19T03:00:00.000000000',\n",
- " '2024-01-19T04:00:00.000000000', '2024-01-19T05:00:00.000000000',\n",
- " '2024-01-19T06:00:00.000000000', '2024-01-19T07:00:00.000000000',\n",
- " '2024-01-19T08:00:00.000000000', '2024-01-19T09:00:00.000000000',\n",
- " '2024-01-19T10:00:00.000000000', '2024-01-19T11:00:00.000000000',\n",
- " '2024-01-19T12:00:00.000000000', '2024-01-19T13:00:00.000000000',\n",
- " '2024-01-19T14:00:00.000000000', '2024-01-19T15:00:00.000000000',\n",
- " '2024-01-19T16:00:00.000000000', '2024-01-19T17:00:00.000000000',\n",
- " '2024-01-19T18:00:00.000000000', '2024-01-19T19:00:00.000000000',\n",
- " '2024-01-19T20:00:00.000000000', '2024-01-19T21:00:00.000000000',\n",
- " '2024-01-19T22:00:00.000000000', '2024-01-19T23:00:00.000000000',\n",
- " '2024-01-20T00:00:00.000000000', '2024-01-20T01:00:00.000000000',\n",
- " '2024-01-20T02:00:00.000000000', '2024-01-20T03:00:00.000000000',\n",
- " '2024-01-20T04:00:00.000000000', '2024-01-20T05:00:00.000000000',\n",
- " '2024-01-20T06:00:00.000000000', '2024-01-20T07:00:00.000000000',\n",
- " '2024-01-20T08:00:00.000000000', '2024-01-20T09:00:00.000000000',\n",
- " '2024-01-20T10:00:00.000000000', '2024-01-20T11:00:00.000000000',\n",
- " '2024-01-20T12:00:00.000000000', '2024-01-20T13:00:00.000000000',\n",
- " '2024-01-20T14:00:00.000000000', '2024-01-20T15:00:00.000000000',\n",
- " '2024-01-20T16:00:00.000000000', '2024-01-20T17:00:00.000000000',\n",
- " '2024-01-20T18:00:00.000000000', '2024-01-20T19:00:00.000000000',\n",
- " '2024-01-20T20:00:00.000000000', '2024-01-20T21:00:00.000000000',\n",
- " '2024-01-20T22:00:00.000000000', '2024-01-20T23:00:00.000000000',\n",
- " '2024-01-21T00:00:00.000000000', '2024-01-21T01:00:00.000000000',\n",
- " '2024-01-21T02:00:00.000000000', '2024-01-21T03:00:00.000000000',\n",
- " '2024-01-21T04:00:00.000000000', '2024-01-21T05:00:00.000000000',\n",
- " '2024-01-21T06:00:00.000000000', '2024-01-21T07:00:00.000000000',\n",
- " '2024-01-21T08:00:00.000000000', '2024-01-21T09:00:00.000000000',\n",
- " '2024-01-21T10:00:00.000000000', '2024-01-21T11:00:00.000000000',\n",
- " '2024-01-21T12:00:00.000000000', '2024-01-21T13:00:00.000000000',\n",
- " '2024-01-21T14:00:00.000000000', '2024-01-21T15:00:00.000000000',\n",
- " '2024-01-21T16:00:00.000000000', '2024-01-21T17:00:00.000000000',\n",
- " '2024-01-21T18:00:00.000000000', '2024-01-21T19:00:00.000000000',\n",
- " '2024-01-21T20:00:00.000000000', '2024-01-21T21:00:00.000000000',\n",
- " '2024-01-21T22:00:00.000000000', '2024-01-21T23:00:00.000000000',\n",
- " '2024-01-22T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('5ZuWpeU9QEDMU8WNBU89QGDXQkqFnk' ... 'AAAAA0QK7n4h/lezhAAAAAAAAA+H8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'}],\n",
- " 'layout': {'legend': {'title': {'text': 'variable'}, 'tracegroupgap': 0},\n",
- " 'template': '...',\n",
- " 'title': {'text': 'Flows (flow_rate)'},\n",
- " 'xaxis': {'anchor': 'y', 'domain': [0.0, 1.0], 'title': {'text': 'time'}},\n",
- " 'yaxis': {'anchor': 'x', 'domain': [0.0, 1.0], 'title': {'text': 'value'}}}\n",
- "}))"
- ],
- "text/html": [
- ""
- ]
- },
- "execution_count": 10,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "execution_count": 10
+ ]
},
{
"cell_type": "code",
+ "execution_count": null,
"id": "21",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T14:13:16.936035Z",
- "start_time": "2025-12-13T14:13:16.880022Z"
- }
- },
+ "metadata": {},
+ "outputs": [],
"source": [
"# Flows filtered by component\n",
"simple.statistics.plot.flows(component='Boiler')"
- ],
- "outputs": [
- {
- "data": {
- "text/plain": [
- "PlotResult(data= Size: 4kB\n",
- "Dimensions: (time: 169)\n",
- "Coordinates:\n",
- " * time (time) datetime64[ns] 1kB 2024-01-15 ... 2024-01-22\n",
- "Data variables:\n",
- " Boiler(Gas) (time) float64 1kB 35.31 31.86 36.13 110.2 ... 21.74 135.3 nan\n",
- " Boiler(Heat) (time) float64 1kB 32.48 29.31 33.24 101.4 ... 20.0 124.5 nan, figure=Figure({\n",
- " 'data': [{'hovertemplate': 'variable=Boiler(Gas)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'Boiler(Gas)',\n",
- " 'line': {'color': '#636EFA', 'dash': 'solid'},\n",
- " 'marker': {'symbol': 'circle'},\n",
- " 'mode': 'lines',\n",
- " 'name': 'Boiler(Gas)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'type': 'scatter',\n",
- " 'x': array(['2024-01-15T00:00:00.000000000', '2024-01-15T01:00:00.000000000',\n",
- " '2024-01-15T02:00:00.000000000', '2024-01-15T03:00:00.000000000',\n",
- " '2024-01-15T04:00:00.000000000', '2024-01-15T05:00:00.000000000',\n",
- " '2024-01-15T06:00:00.000000000', '2024-01-15T07:00:00.000000000',\n",
- " '2024-01-15T08:00:00.000000000', '2024-01-15T09:00:00.000000000',\n",
- " '2024-01-15T10:00:00.000000000', '2024-01-15T11:00:00.000000000',\n",
- " '2024-01-15T12:00:00.000000000', '2024-01-15T13:00:00.000000000',\n",
- " '2024-01-15T14:00:00.000000000', '2024-01-15T15:00:00.000000000',\n",
- " '2024-01-15T16:00:00.000000000', '2024-01-15T17:00:00.000000000',\n",
- " '2024-01-15T18:00:00.000000000', '2024-01-15T19:00:00.000000000',\n",
- " '2024-01-15T20:00:00.000000000', '2024-01-15T21:00:00.000000000',\n",
- " '2024-01-15T22:00:00.000000000', '2024-01-15T23:00:00.000000000',\n",
- " '2024-01-16T00:00:00.000000000', '2024-01-16T01:00:00.000000000',\n",
- " '2024-01-16T02:00:00.000000000', '2024-01-16T03:00:00.000000000',\n",
- " '2024-01-16T04:00:00.000000000', '2024-01-16T05:00:00.000000000',\n",
- " '2024-01-16T06:00:00.000000000', '2024-01-16T07:00:00.000000000',\n",
- " '2024-01-16T08:00:00.000000000', '2024-01-16T09:00:00.000000000',\n",
- " '2024-01-16T10:00:00.000000000', '2024-01-16T11:00:00.000000000',\n",
- " '2024-01-16T12:00:00.000000000', '2024-01-16T13:00:00.000000000',\n",
- " '2024-01-16T14:00:00.000000000', '2024-01-16T15:00:00.000000000',\n",
- " '2024-01-16T16:00:00.000000000', '2024-01-16T17:00:00.000000000',\n",
- " '2024-01-16T18:00:00.000000000', '2024-01-16T19:00:00.000000000',\n",
- " '2024-01-16T20:00:00.000000000', '2024-01-16T21:00:00.000000000',\n",
- " '2024-01-16T22:00:00.000000000', '2024-01-16T23:00:00.000000000',\n",
- " '2024-01-17T00:00:00.000000000', '2024-01-17T01:00:00.000000000',\n",
- " '2024-01-17T02:00:00.000000000', '2024-01-17T03:00:00.000000000',\n",
- " '2024-01-17T04:00:00.000000000', '2024-01-17T05:00:00.000000000',\n",
- " '2024-01-17T06:00:00.000000000', '2024-01-17T07:00:00.000000000',\n",
- " '2024-01-17T08:00:00.000000000', '2024-01-17T09:00:00.000000000',\n",
- " '2024-01-17T10:00:00.000000000', '2024-01-17T11:00:00.000000000',\n",
- " '2024-01-17T12:00:00.000000000', '2024-01-17T13:00:00.000000000',\n",
- " '2024-01-17T14:00:00.000000000', '2024-01-17T15:00:00.000000000',\n",
- " '2024-01-17T16:00:00.000000000', '2024-01-17T17:00:00.000000000',\n",
- " '2024-01-17T18:00:00.000000000', '2024-01-17T19:00:00.000000000',\n",
- " '2024-01-17T20:00:00.000000000', '2024-01-17T21:00:00.000000000',\n",
- " '2024-01-17T22:00:00.000000000', '2024-01-17T23:00:00.000000000',\n",
- " '2024-01-18T00:00:00.000000000', '2024-01-18T01:00:00.000000000',\n",
- " '2024-01-18T02:00:00.000000000', '2024-01-18T03:00:00.000000000',\n",
- " '2024-01-18T04:00:00.000000000', '2024-01-18T05:00:00.000000000',\n",
- " '2024-01-18T06:00:00.000000000', '2024-01-18T07:00:00.000000000',\n",
- " '2024-01-18T08:00:00.000000000', '2024-01-18T09:00:00.000000000',\n",
- " '2024-01-18T10:00:00.000000000', '2024-01-18T11:00:00.000000000',\n",
- " '2024-01-18T12:00:00.000000000', '2024-01-18T13:00:00.000000000',\n",
- " '2024-01-18T14:00:00.000000000', '2024-01-18T15:00:00.000000000',\n",
- " '2024-01-18T16:00:00.000000000', '2024-01-18T17:00:00.000000000',\n",
- " '2024-01-18T18:00:00.000000000', '2024-01-18T19:00:00.000000000',\n",
- " '2024-01-18T20:00:00.000000000', '2024-01-18T21:00:00.000000000',\n",
- " '2024-01-18T22:00:00.000000000', '2024-01-18T23:00:00.000000000',\n",
- " '2024-01-19T00:00:00.000000000', '2024-01-19T01:00:00.000000000',\n",
- " '2024-01-19T02:00:00.000000000', '2024-01-19T03:00:00.000000000',\n",
- " '2024-01-19T04:00:00.000000000', '2024-01-19T05:00:00.000000000',\n",
- " '2024-01-19T06:00:00.000000000', '2024-01-19T07:00:00.000000000',\n",
- " '2024-01-19T08:00:00.000000000', '2024-01-19T09:00:00.000000000',\n",
- " '2024-01-19T10:00:00.000000000', '2024-01-19T11:00:00.000000000',\n",
- " '2024-01-19T12:00:00.000000000', '2024-01-19T13:00:00.000000000',\n",
- " '2024-01-19T14:00:00.000000000', '2024-01-19T15:00:00.000000000',\n",
- " '2024-01-19T16:00:00.000000000', '2024-01-19T17:00:00.000000000',\n",
- " '2024-01-19T18:00:00.000000000', '2024-01-19T19:00:00.000000000',\n",
- " '2024-01-19T20:00:00.000000000', '2024-01-19T21:00:00.000000000',\n",
- " '2024-01-19T22:00:00.000000000', '2024-01-19T23:00:00.000000000',\n",
- " '2024-01-20T00:00:00.000000000', '2024-01-20T01:00:00.000000000',\n",
- " '2024-01-20T02:00:00.000000000', '2024-01-20T03:00:00.000000000',\n",
- " '2024-01-20T04:00:00.000000000', '2024-01-20T05:00:00.000000000',\n",
- " '2024-01-20T06:00:00.000000000', '2024-01-20T07:00:00.000000000',\n",
- " '2024-01-20T08:00:00.000000000', '2024-01-20T09:00:00.000000000',\n",
- " '2024-01-20T10:00:00.000000000', '2024-01-20T11:00:00.000000000',\n",
- " '2024-01-20T12:00:00.000000000', '2024-01-20T13:00:00.000000000',\n",
- " '2024-01-20T14:00:00.000000000', '2024-01-20T15:00:00.000000000',\n",
- " '2024-01-20T16:00:00.000000000', '2024-01-20T17:00:00.000000000',\n",
- " '2024-01-20T18:00:00.000000000', '2024-01-20T19:00:00.000000000',\n",
- " '2024-01-20T20:00:00.000000000', '2024-01-20T21:00:00.000000000',\n",
- " '2024-01-20T22:00:00.000000000', '2024-01-20T23:00:00.000000000',\n",
- " '2024-01-21T00:00:00.000000000', '2024-01-21T01:00:00.000000000',\n",
- " '2024-01-21T02:00:00.000000000', '2024-01-21T03:00:00.000000000',\n",
- " '2024-01-21T04:00:00.000000000', '2024-01-21T05:00:00.000000000',\n",
- " '2024-01-21T06:00:00.000000000', '2024-01-21T07:00:00.000000000',\n",
- " '2024-01-21T08:00:00.000000000', '2024-01-21T09:00:00.000000000',\n",
- " '2024-01-21T10:00:00.000000000', '2024-01-21T11:00:00.000000000',\n",
- " '2024-01-21T12:00:00.000000000', '2024-01-21T13:00:00.000000000',\n",
- " '2024-01-21T14:00:00.000000000', '2024-01-21T15:00:00.000000000',\n",
- " '2024-01-21T16:00:00.000000000', '2024-01-21T17:00:00.000000000',\n",
- " '2024-01-21T18:00:00.000000000', '2024-01-21T19:00:00.000000000',\n",
- " '2024-01-21T20:00:00.000000000', '2024-01-21T21:00:00.000000000',\n",
- " '2024-01-21T22:00:00.000000000', '2024-01-21T23:00:00.000000000',\n",
- " '2024-01-22T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('GuEHDXSnQUD261BXdds/QI2yoZ56EE' ... 'SmN701QKxDuYXg6WBAAAAAAAAA+H8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'variable=Boiler(Heat)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'Boiler(Heat)',\n",
- " 'line': {'color': '#EF553B', 'dash': 'solid'},\n",
- " 'marker': {'symbol': 'circle'},\n",
- " 'mode': 'lines',\n",
- " 'name': 'Boiler(Heat)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'type': 'scatter',\n",
- " 'x': array(['2024-01-15T00:00:00.000000000', '2024-01-15T01:00:00.000000000',\n",
- " '2024-01-15T02:00:00.000000000', '2024-01-15T03:00:00.000000000',\n",
- " '2024-01-15T04:00:00.000000000', '2024-01-15T05:00:00.000000000',\n",
- " '2024-01-15T06:00:00.000000000', '2024-01-15T07:00:00.000000000',\n",
- " '2024-01-15T08:00:00.000000000', '2024-01-15T09:00:00.000000000',\n",
- " '2024-01-15T10:00:00.000000000', '2024-01-15T11:00:00.000000000',\n",
- " '2024-01-15T12:00:00.000000000', '2024-01-15T13:00:00.000000000',\n",
- " '2024-01-15T14:00:00.000000000', '2024-01-15T15:00:00.000000000',\n",
- " '2024-01-15T16:00:00.000000000', '2024-01-15T17:00:00.000000000',\n",
- " '2024-01-15T18:00:00.000000000', '2024-01-15T19:00:00.000000000',\n",
- " '2024-01-15T20:00:00.000000000', '2024-01-15T21:00:00.000000000',\n",
- " '2024-01-15T22:00:00.000000000', '2024-01-15T23:00:00.000000000',\n",
- " '2024-01-16T00:00:00.000000000', '2024-01-16T01:00:00.000000000',\n",
- " '2024-01-16T02:00:00.000000000', '2024-01-16T03:00:00.000000000',\n",
- " '2024-01-16T04:00:00.000000000', '2024-01-16T05:00:00.000000000',\n",
- " '2024-01-16T06:00:00.000000000', '2024-01-16T07:00:00.000000000',\n",
- " '2024-01-16T08:00:00.000000000', '2024-01-16T09:00:00.000000000',\n",
- " '2024-01-16T10:00:00.000000000', '2024-01-16T11:00:00.000000000',\n",
- " '2024-01-16T12:00:00.000000000', '2024-01-16T13:00:00.000000000',\n",
- " '2024-01-16T14:00:00.000000000', '2024-01-16T15:00:00.000000000',\n",
- " '2024-01-16T16:00:00.000000000', '2024-01-16T17:00:00.000000000',\n",
- " '2024-01-16T18:00:00.000000000', '2024-01-16T19:00:00.000000000',\n",
- " '2024-01-16T20:00:00.000000000', '2024-01-16T21:00:00.000000000',\n",
- " '2024-01-16T22:00:00.000000000', '2024-01-16T23:00:00.000000000',\n",
- " '2024-01-17T00:00:00.000000000', '2024-01-17T01:00:00.000000000',\n",
- " '2024-01-17T02:00:00.000000000', '2024-01-17T03:00:00.000000000',\n",
- " '2024-01-17T04:00:00.000000000', '2024-01-17T05:00:00.000000000',\n",
- " '2024-01-17T06:00:00.000000000', '2024-01-17T07:00:00.000000000',\n",
- " '2024-01-17T08:00:00.000000000', '2024-01-17T09:00:00.000000000',\n",
- " '2024-01-17T10:00:00.000000000', '2024-01-17T11:00:00.000000000',\n",
- " '2024-01-17T12:00:00.000000000', '2024-01-17T13:00:00.000000000',\n",
- " '2024-01-17T14:00:00.000000000', '2024-01-17T15:00:00.000000000',\n",
- " '2024-01-17T16:00:00.000000000', '2024-01-17T17:00:00.000000000',\n",
- " '2024-01-17T18:00:00.000000000', '2024-01-17T19:00:00.000000000',\n",
- " '2024-01-17T20:00:00.000000000', '2024-01-17T21:00:00.000000000',\n",
- " '2024-01-17T22:00:00.000000000', '2024-01-17T23:00:00.000000000',\n",
- " '2024-01-18T00:00:00.000000000', '2024-01-18T01:00:00.000000000',\n",
- " '2024-01-18T02:00:00.000000000', '2024-01-18T03:00:00.000000000',\n",
- " '2024-01-18T04:00:00.000000000', '2024-01-18T05:00:00.000000000',\n",
- " '2024-01-18T06:00:00.000000000', '2024-01-18T07:00:00.000000000',\n",
- " '2024-01-18T08:00:00.000000000', '2024-01-18T09:00:00.000000000',\n",
- " '2024-01-18T10:00:00.000000000', '2024-01-18T11:00:00.000000000',\n",
- " '2024-01-18T12:00:00.000000000', '2024-01-18T13:00:00.000000000',\n",
- " '2024-01-18T14:00:00.000000000', '2024-01-18T15:00:00.000000000',\n",
- " '2024-01-18T16:00:00.000000000', '2024-01-18T17:00:00.000000000',\n",
- " '2024-01-18T18:00:00.000000000', '2024-01-18T19:00:00.000000000',\n",
- " '2024-01-18T20:00:00.000000000', '2024-01-18T21:00:00.000000000',\n",
- " '2024-01-18T22:00:00.000000000', '2024-01-18T23:00:00.000000000',\n",
- " '2024-01-19T00:00:00.000000000', '2024-01-19T01:00:00.000000000',\n",
- " '2024-01-19T02:00:00.000000000', '2024-01-19T03:00:00.000000000',\n",
- " '2024-01-19T04:00:00.000000000', '2024-01-19T05:00:00.000000000',\n",
- " '2024-01-19T06:00:00.000000000', '2024-01-19T07:00:00.000000000',\n",
- " '2024-01-19T08:00:00.000000000', '2024-01-19T09:00:00.000000000',\n",
- " '2024-01-19T10:00:00.000000000', '2024-01-19T11:00:00.000000000',\n",
- " '2024-01-19T12:00:00.000000000', '2024-01-19T13:00:00.000000000',\n",
- " '2024-01-19T14:00:00.000000000', '2024-01-19T15:00:00.000000000',\n",
- " '2024-01-19T16:00:00.000000000', '2024-01-19T17:00:00.000000000',\n",
- " '2024-01-19T18:00:00.000000000', '2024-01-19T19:00:00.000000000',\n",
- " '2024-01-19T20:00:00.000000000', '2024-01-19T21:00:00.000000000',\n",
- " '2024-01-19T22:00:00.000000000', '2024-01-19T23:00:00.000000000',\n",
- " '2024-01-20T00:00:00.000000000', '2024-01-20T01:00:00.000000000',\n",
- " '2024-01-20T02:00:00.000000000', '2024-01-20T03:00:00.000000000',\n",
- " '2024-01-20T04:00:00.000000000', '2024-01-20T05:00:00.000000000',\n",
- " '2024-01-20T06:00:00.000000000', '2024-01-20T07:00:00.000000000',\n",
- " '2024-01-20T08:00:00.000000000', '2024-01-20T09:00:00.000000000',\n",
- " '2024-01-20T10:00:00.000000000', '2024-01-20T11:00:00.000000000',\n",
- " '2024-01-20T12:00:00.000000000', '2024-01-20T13:00:00.000000000',\n",
- " '2024-01-20T14:00:00.000000000', '2024-01-20T15:00:00.000000000',\n",
- " '2024-01-20T16:00:00.000000000', '2024-01-20T17:00:00.000000000',\n",
- " '2024-01-20T18:00:00.000000000', '2024-01-20T19:00:00.000000000',\n",
- " '2024-01-20T20:00:00.000000000', '2024-01-20T21:00:00.000000000',\n",
- " '2024-01-20T22:00:00.000000000', '2024-01-20T23:00:00.000000000',\n",
- " '2024-01-21T00:00:00.000000000', '2024-01-21T01:00:00.000000000',\n",
- " '2024-01-21T02:00:00.000000000', '2024-01-21T03:00:00.000000000',\n",
- " '2024-01-21T04:00:00.000000000', '2024-01-21T05:00:00.000000000',\n",
- " '2024-01-21T06:00:00.000000000', '2024-01-21T07:00:00.000000000',\n",
- " '2024-01-21T08:00:00.000000000', '2024-01-21T09:00:00.000000000',\n",
- " '2024-01-21T10:00:00.000000000', '2024-01-21T11:00:00.000000000',\n",
- " '2024-01-21T12:00:00.000000000', '2024-01-21T13:00:00.000000000',\n",
- " '2024-01-21T14:00:00.000000000', '2024-01-21T15:00:00.000000000',\n",
- " '2024-01-21T16:00:00.000000000', '2024-01-21T17:00:00.000000000',\n",
- " '2024-01-21T18:00:00.000000000', '2024-01-21T19:00:00.000000000',\n",
- " '2024-01-21T20:00:00.000000000', '2024-01-21T21:00:00.000000000',\n",
- " '2024-01-21T22:00:00.000000000', '2024-01-21T23:00:00.000000000',\n",
- " '2024-01-22T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('5ZuWpeU9QED3U8WNBU89QHjXQkqFnk' ... '////8zQPW5+Ef5Hl9AAAAAAAAA+H8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'}],\n",
- " 'layout': {'legend': {'title': {'text': 'variable'}, 'tracegroupgap': 0},\n",
- " 'template': '...',\n",
- " 'title': {'text': 'Flows (flow_rate)'},\n",
- " 'xaxis': {'anchor': 'y', 'domain': [0.0, 1.0], 'title': {'text': 'time'}},\n",
- " 'yaxis': {'anchor': 'x', 'domain': [0.0, 1.0], 'title': {'text': 'value'}}}\n",
- "}))"
- ],
- "text/html": [
- ""
- ]
- },
- "execution_count": 11,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "execution_count": 11
+ ]
},
{
"cell_type": "markdown",
- "id": "32",
+ "id": "22",
"metadata": {},
"source": [
"### 3.4 Storage Plot\n",
@@ -2626,346 +268,17 @@
},
{
"cell_type": "code",
- "id": "33",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T14:13:17.166751Z",
- "start_time": "2025-12-13T14:13:16.985913Z"
- }
- },
+ "execution_count": null,
+ "id": "23",
+ "metadata": {},
+ "outputs": [],
"source": [
"simple.statistics.plot.storage('ThermalStorage')"
- ],
- "outputs": [
- {
- "data": {
- "text/plain": [
- "PlotResult(data= Size: 5kB\n",
- "Dimensions: (time: 169)\n",
- "Coordinates:\n",
- " * time (time) datetime64[ns] 1kB 2024-01-15 ... 2024-...\n",
- "Data variables:\n",
- " ThermalStorage(Charge) (time) float64 1kB 0.0 -3.748e-13 ... 100.0 nan\n",
- " ThermalStorage(Discharge) (time) float64 1kB -0.0 5.275e-13 ... nan\n",
- " charge_state (time) float64 1kB 250.0 248.8 ... 102.5 200.0, figure=Figure({\n",
- " 'data': [{'hovertemplate': 'variable=ThermalStorage(Charge)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'ThermalStorage(Charge)',\n",
- " 'marker': {'color': '#D62728', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'ThermalStorage(Charge)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-15T00:00:00.000000000', '2024-01-15T01:00:00.000000000',\n",
- " '2024-01-15T02:00:00.000000000', '2024-01-15T03:00:00.000000000',\n",
- " '2024-01-15T04:00:00.000000000', '2024-01-15T05:00:00.000000000',\n",
- " '2024-01-15T06:00:00.000000000', '2024-01-15T07:00:00.000000000',\n",
- " '2024-01-15T08:00:00.000000000', '2024-01-15T09:00:00.000000000',\n",
- " '2024-01-15T10:00:00.000000000', '2024-01-15T11:00:00.000000000',\n",
- " '2024-01-15T12:00:00.000000000', '2024-01-15T13:00:00.000000000',\n",
- " '2024-01-15T14:00:00.000000000', '2024-01-15T15:00:00.000000000',\n",
- " '2024-01-15T16:00:00.000000000', '2024-01-15T17:00:00.000000000',\n",
- " '2024-01-15T18:00:00.000000000', '2024-01-15T19:00:00.000000000',\n",
- " '2024-01-15T20:00:00.000000000', '2024-01-15T21:00:00.000000000',\n",
- " '2024-01-15T22:00:00.000000000', '2024-01-15T23:00:00.000000000',\n",
- " '2024-01-16T00:00:00.000000000', '2024-01-16T01:00:00.000000000',\n",
- " '2024-01-16T02:00:00.000000000', '2024-01-16T03:00:00.000000000',\n",
- " '2024-01-16T04:00:00.000000000', '2024-01-16T05:00:00.000000000',\n",
- " '2024-01-16T06:00:00.000000000', '2024-01-16T07:00:00.000000000',\n",
- " '2024-01-16T08:00:00.000000000', '2024-01-16T09:00:00.000000000',\n",
- " '2024-01-16T10:00:00.000000000', '2024-01-16T11:00:00.000000000',\n",
- " '2024-01-16T12:00:00.000000000', '2024-01-16T13:00:00.000000000',\n",
- " '2024-01-16T14:00:00.000000000', '2024-01-16T15:00:00.000000000',\n",
- " '2024-01-16T16:00:00.000000000', '2024-01-16T17:00:00.000000000',\n",
- " '2024-01-16T18:00:00.000000000', '2024-01-16T19:00:00.000000000',\n",
- " '2024-01-16T20:00:00.000000000', '2024-01-16T21:00:00.000000000',\n",
- " '2024-01-16T22:00:00.000000000', '2024-01-16T23:00:00.000000000',\n",
- " '2024-01-17T00:00:00.000000000', '2024-01-17T01:00:00.000000000',\n",
- " '2024-01-17T02:00:00.000000000', '2024-01-17T03:00:00.000000000',\n",
- " '2024-01-17T04:00:00.000000000', '2024-01-17T05:00:00.000000000',\n",
- " '2024-01-17T06:00:00.000000000', '2024-01-17T07:00:00.000000000',\n",
- " '2024-01-17T08:00:00.000000000', '2024-01-17T09:00:00.000000000',\n",
- " '2024-01-17T10:00:00.000000000', '2024-01-17T11:00:00.000000000',\n",
- " '2024-01-17T12:00:00.000000000', '2024-01-17T13:00:00.000000000',\n",
- " '2024-01-17T14:00:00.000000000', '2024-01-17T15:00:00.000000000',\n",
- " '2024-01-17T16:00:00.000000000', '2024-01-17T17:00:00.000000000',\n",
- " '2024-01-17T18:00:00.000000000', '2024-01-17T19:00:00.000000000',\n",
- " '2024-01-17T20:00:00.000000000', '2024-01-17T21:00:00.000000000',\n",
- " '2024-01-17T22:00:00.000000000', '2024-01-17T23:00:00.000000000',\n",
- " '2024-01-18T00:00:00.000000000', '2024-01-18T01:00:00.000000000',\n",
- " '2024-01-18T02:00:00.000000000', '2024-01-18T03:00:00.000000000',\n",
- " '2024-01-18T04:00:00.000000000', '2024-01-18T05:00:00.000000000',\n",
- " '2024-01-18T06:00:00.000000000', '2024-01-18T07:00:00.000000000',\n",
- " '2024-01-18T08:00:00.000000000', '2024-01-18T09:00:00.000000000',\n",
- " '2024-01-18T10:00:00.000000000', '2024-01-18T11:00:00.000000000',\n",
- " '2024-01-18T12:00:00.000000000', '2024-01-18T13:00:00.000000000',\n",
- " '2024-01-18T14:00:00.000000000', '2024-01-18T15:00:00.000000000',\n",
- " '2024-01-18T16:00:00.000000000', '2024-01-18T17:00:00.000000000',\n",
- " '2024-01-18T18:00:00.000000000', '2024-01-18T19:00:00.000000000',\n",
- " '2024-01-18T20:00:00.000000000', '2024-01-18T21:00:00.000000000',\n",
- " '2024-01-18T22:00:00.000000000', '2024-01-18T23:00:00.000000000',\n",
- " '2024-01-19T00:00:00.000000000', '2024-01-19T01:00:00.000000000',\n",
- " '2024-01-19T02:00:00.000000000', '2024-01-19T03:00:00.000000000',\n",
- " '2024-01-19T04:00:00.000000000', '2024-01-19T05:00:00.000000000',\n",
- " '2024-01-19T06:00:00.000000000', '2024-01-19T07:00:00.000000000',\n",
- " '2024-01-19T08:00:00.000000000', '2024-01-19T09:00:00.000000000',\n",
- " '2024-01-19T10:00:00.000000000', '2024-01-19T11:00:00.000000000',\n",
- " '2024-01-19T12:00:00.000000000', '2024-01-19T13:00:00.000000000',\n",
- " '2024-01-19T14:00:00.000000000', '2024-01-19T15:00:00.000000000',\n",
- " '2024-01-19T16:00:00.000000000', '2024-01-19T17:00:00.000000000',\n",
- " '2024-01-19T18:00:00.000000000', '2024-01-19T19:00:00.000000000',\n",
- " '2024-01-19T20:00:00.000000000', '2024-01-19T21:00:00.000000000',\n",
- " '2024-01-19T22:00:00.000000000', '2024-01-19T23:00:00.000000000',\n",
- " '2024-01-20T00:00:00.000000000', '2024-01-20T01:00:00.000000000',\n",
- " '2024-01-20T02:00:00.000000000', '2024-01-20T03:00:00.000000000',\n",
- " '2024-01-20T04:00:00.000000000', '2024-01-20T05:00:00.000000000',\n",
- " '2024-01-20T06:00:00.000000000', '2024-01-20T07:00:00.000000000',\n",
- " '2024-01-20T08:00:00.000000000', '2024-01-20T09:00:00.000000000',\n",
- " '2024-01-20T10:00:00.000000000', '2024-01-20T11:00:00.000000000',\n",
- " '2024-01-20T12:00:00.000000000', '2024-01-20T13:00:00.000000000',\n",
- " '2024-01-20T14:00:00.000000000', '2024-01-20T15:00:00.000000000',\n",
- " '2024-01-20T16:00:00.000000000', '2024-01-20T17:00:00.000000000',\n",
- " '2024-01-20T18:00:00.000000000', '2024-01-20T19:00:00.000000000',\n",
- " '2024-01-20T20:00:00.000000000', '2024-01-20T21:00:00.000000000',\n",
- " '2024-01-20T22:00:00.000000000', '2024-01-20T23:00:00.000000000',\n",
- " '2024-01-21T00:00:00.000000000', '2024-01-21T01:00:00.000000000',\n",
- " '2024-01-21T02:00:00.000000000', '2024-01-21T03:00:00.000000000',\n",
- " '2024-01-21T04:00:00.000000000', '2024-01-21T05:00:00.000000000',\n",
- " '2024-01-21T06:00:00.000000000', '2024-01-21T07:00:00.000000000',\n",
- " '2024-01-21T08:00:00.000000000', '2024-01-21T09:00:00.000000000',\n",
- " '2024-01-21T10:00:00.000000000', '2024-01-21T11:00:00.000000000',\n",
- " '2024-01-21T12:00:00.000000000', '2024-01-21T13:00:00.000000000',\n",
- " '2024-01-21T14:00:00.000000000', '2024-01-21T15:00:00.000000000',\n",
- " '2024-01-21T16:00:00.000000000', '2024-01-21T17:00:00.000000000',\n",
- " '2024-01-21T18:00:00.000000000', '2024-01-21T19:00:00.000000000',\n",
- " '2024-01-21T20:00:00.000000000', '2024-01-21T21:00:00.000000000',\n",
- " '2024-01-21T22:00:00.000000000', '2024-01-21T23:00:00.000000000',\n",
- " '2024-01-22T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('AAAAAAAAAAAUfPDBB19avby8nSEx72' ... 'AAAAAAANj//////1hAAAAAAAAA+H8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'variable=ThermalStorage(Discharge)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'ThermalStorage(Discharge)',\n",
- " 'marker': {'color': '#D62728', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'ThermalStorage(Discharge)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-15T00:00:00.000000000', '2024-01-15T01:00:00.000000000',\n",
- " '2024-01-15T02:00:00.000000000', '2024-01-15T03:00:00.000000000',\n",
- " '2024-01-15T04:00:00.000000000', '2024-01-15T05:00:00.000000000',\n",
- " '2024-01-15T06:00:00.000000000', '2024-01-15T07:00:00.000000000',\n",
- " '2024-01-15T08:00:00.000000000', '2024-01-15T09:00:00.000000000',\n",
- " '2024-01-15T10:00:00.000000000', '2024-01-15T11:00:00.000000000',\n",
- " '2024-01-15T12:00:00.000000000', '2024-01-15T13:00:00.000000000',\n",
- " '2024-01-15T14:00:00.000000000', '2024-01-15T15:00:00.000000000',\n",
- " '2024-01-15T16:00:00.000000000', '2024-01-15T17:00:00.000000000',\n",
- " '2024-01-15T18:00:00.000000000', '2024-01-15T19:00:00.000000000',\n",
- " '2024-01-15T20:00:00.000000000', '2024-01-15T21:00:00.000000000',\n",
- " '2024-01-15T22:00:00.000000000', '2024-01-15T23:00:00.000000000',\n",
- " '2024-01-16T00:00:00.000000000', '2024-01-16T01:00:00.000000000',\n",
- " '2024-01-16T02:00:00.000000000', '2024-01-16T03:00:00.000000000',\n",
- " '2024-01-16T04:00:00.000000000', '2024-01-16T05:00:00.000000000',\n",
- " '2024-01-16T06:00:00.000000000', '2024-01-16T07:00:00.000000000',\n",
- " '2024-01-16T08:00:00.000000000', '2024-01-16T09:00:00.000000000',\n",
- " '2024-01-16T10:00:00.000000000', '2024-01-16T11:00:00.000000000',\n",
- " '2024-01-16T12:00:00.000000000', '2024-01-16T13:00:00.000000000',\n",
- " '2024-01-16T14:00:00.000000000', '2024-01-16T15:00:00.000000000',\n",
- " '2024-01-16T16:00:00.000000000', '2024-01-16T17:00:00.000000000',\n",
- " '2024-01-16T18:00:00.000000000', '2024-01-16T19:00:00.000000000',\n",
- " '2024-01-16T20:00:00.000000000', '2024-01-16T21:00:00.000000000',\n",
- " '2024-01-16T22:00:00.000000000', '2024-01-16T23:00:00.000000000',\n",
- " '2024-01-17T00:00:00.000000000', '2024-01-17T01:00:00.000000000',\n",
- " '2024-01-17T02:00:00.000000000', '2024-01-17T03:00:00.000000000',\n",
- " '2024-01-17T04:00:00.000000000', '2024-01-17T05:00:00.000000000',\n",
- " '2024-01-17T06:00:00.000000000', '2024-01-17T07:00:00.000000000',\n",
- " '2024-01-17T08:00:00.000000000', '2024-01-17T09:00:00.000000000',\n",
- " '2024-01-17T10:00:00.000000000', '2024-01-17T11:00:00.000000000',\n",
- " '2024-01-17T12:00:00.000000000', '2024-01-17T13:00:00.000000000',\n",
- " '2024-01-17T14:00:00.000000000', '2024-01-17T15:00:00.000000000',\n",
- " '2024-01-17T16:00:00.000000000', '2024-01-17T17:00:00.000000000',\n",
- " '2024-01-17T18:00:00.000000000', '2024-01-17T19:00:00.000000000',\n",
- " '2024-01-17T20:00:00.000000000', '2024-01-17T21:00:00.000000000',\n",
- " '2024-01-17T22:00:00.000000000', '2024-01-17T23:00:00.000000000',\n",
- " '2024-01-18T00:00:00.000000000', '2024-01-18T01:00:00.000000000',\n",
- " '2024-01-18T02:00:00.000000000', '2024-01-18T03:00:00.000000000',\n",
- " '2024-01-18T04:00:00.000000000', '2024-01-18T05:00:00.000000000',\n",
- " '2024-01-18T06:00:00.000000000', '2024-01-18T07:00:00.000000000',\n",
- " '2024-01-18T08:00:00.000000000', '2024-01-18T09:00:00.000000000',\n",
- " '2024-01-18T10:00:00.000000000', '2024-01-18T11:00:00.000000000',\n",
- " '2024-01-18T12:00:00.000000000', '2024-01-18T13:00:00.000000000',\n",
- " '2024-01-18T14:00:00.000000000', '2024-01-18T15:00:00.000000000',\n",
- " '2024-01-18T16:00:00.000000000', '2024-01-18T17:00:00.000000000',\n",
- " '2024-01-18T18:00:00.000000000', '2024-01-18T19:00:00.000000000',\n",
- " '2024-01-18T20:00:00.000000000', '2024-01-18T21:00:00.000000000',\n",
- " '2024-01-18T22:00:00.000000000', '2024-01-18T23:00:00.000000000',\n",
- " '2024-01-19T00:00:00.000000000', '2024-01-19T01:00:00.000000000',\n",
- " '2024-01-19T02:00:00.000000000', '2024-01-19T03:00:00.000000000',\n",
- " '2024-01-19T04:00:00.000000000', '2024-01-19T05:00:00.000000000',\n",
- " '2024-01-19T06:00:00.000000000', '2024-01-19T07:00:00.000000000',\n",
- " '2024-01-19T08:00:00.000000000', '2024-01-19T09:00:00.000000000',\n",
- " '2024-01-19T10:00:00.000000000', '2024-01-19T11:00:00.000000000',\n",
- " '2024-01-19T12:00:00.000000000', '2024-01-19T13:00:00.000000000',\n",
- " '2024-01-19T14:00:00.000000000', '2024-01-19T15:00:00.000000000',\n",
- " '2024-01-19T16:00:00.000000000', '2024-01-19T17:00:00.000000000',\n",
- " '2024-01-19T18:00:00.000000000', '2024-01-19T19:00:00.000000000',\n",
- " '2024-01-19T20:00:00.000000000', '2024-01-19T21:00:00.000000000',\n",
- " '2024-01-19T22:00:00.000000000', '2024-01-19T23:00:00.000000000',\n",
- " '2024-01-20T00:00:00.000000000', '2024-01-20T01:00:00.000000000',\n",
- " '2024-01-20T02:00:00.000000000', '2024-01-20T03:00:00.000000000',\n",
- " '2024-01-20T04:00:00.000000000', '2024-01-20T05:00:00.000000000',\n",
- " '2024-01-20T06:00:00.000000000', '2024-01-20T07:00:00.000000000',\n",
- " '2024-01-20T08:00:00.000000000', '2024-01-20T09:00:00.000000000',\n",
- " '2024-01-20T10:00:00.000000000', '2024-01-20T11:00:00.000000000',\n",
- " '2024-01-20T12:00:00.000000000', '2024-01-20T13:00:00.000000000',\n",
- " '2024-01-20T14:00:00.000000000', '2024-01-20T15:00:00.000000000',\n",
- " '2024-01-20T16:00:00.000000000', '2024-01-20T17:00:00.000000000',\n",
- " '2024-01-20T18:00:00.000000000', '2024-01-20T19:00:00.000000000',\n",
- " '2024-01-20T20:00:00.000000000', '2024-01-20T21:00:00.000000000',\n",
- " '2024-01-20T22:00:00.000000000', '2024-01-20T23:00:00.000000000',\n",
- " '2024-01-21T00:00:00.000000000', '2024-01-21T01:00:00.000000000',\n",
- " '2024-01-21T02:00:00.000000000', '2024-01-21T03:00:00.000000000',\n",
- " '2024-01-21T04:00:00.000000000', '2024-01-21T05:00:00.000000000',\n",
- " '2024-01-21T06:00:00.000000000', '2024-01-21T07:00:00.000000000',\n",
- " '2024-01-21T08:00:00.000000000', '2024-01-21T09:00:00.000000000',\n",
- " '2024-01-21T10:00:00.000000000', '2024-01-21T11:00:00.000000000',\n",
- " '2024-01-21T12:00:00.000000000', '2024-01-21T13:00:00.000000000',\n",
- " '2024-01-21T14:00:00.000000000', '2024-01-21T15:00:00.000000000',\n",
- " '2024-01-21T16:00:00.000000000', '2024-01-21T17:00:00.000000000',\n",
- " '2024-01-21T18:00:00.000000000', '2024-01-21T19:00:00.000000000',\n",
- " '2024-01-21T20:00:00.000000000', '2024-01-21T21:00:00.000000000',\n",
- " '2024-01-21T22:00:00.000000000', '2024-01-21T23:00:00.000000000',\n",
- " '2024-01-22T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('AAAAAAAAAIAKPvjgg49iPby8nSEx72' ... 'AAAAAgvWP9SoFav2g9AAAAAAAA+P8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'time=%{x}
value=%{y}',\n",
- " 'legendgroup': '',\n",
- " 'line': {'color': 'black', 'width': 2},\n",
- " 'marker': {'symbol': 'circle'},\n",
- " 'mode': 'lines',\n",
- " 'name': 'charge_state',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'type': 'scatter',\n",
- " 'x': array(['2024-01-15T00:00:00.000000000', '2024-01-15T01:00:00.000000000',\n",
- " '2024-01-15T02:00:00.000000000', '2024-01-15T03:00:00.000000000',\n",
- " '2024-01-15T04:00:00.000000000', '2024-01-15T05:00:00.000000000',\n",
- " '2024-01-15T06:00:00.000000000', '2024-01-15T07:00:00.000000000',\n",
- " '2024-01-15T08:00:00.000000000', '2024-01-15T09:00:00.000000000',\n",
- " '2024-01-15T10:00:00.000000000', '2024-01-15T11:00:00.000000000',\n",
- " '2024-01-15T12:00:00.000000000', '2024-01-15T13:00:00.000000000',\n",
- " '2024-01-15T14:00:00.000000000', '2024-01-15T15:00:00.000000000',\n",
- " '2024-01-15T16:00:00.000000000', '2024-01-15T17:00:00.000000000',\n",
- " '2024-01-15T18:00:00.000000000', '2024-01-15T19:00:00.000000000',\n",
- " '2024-01-15T20:00:00.000000000', '2024-01-15T21:00:00.000000000',\n",
- " '2024-01-15T22:00:00.000000000', '2024-01-15T23:00:00.000000000',\n",
- " '2024-01-16T00:00:00.000000000', '2024-01-16T01:00:00.000000000',\n",
- " '2024-01-16T02:00:00.000000000', '2024-01-16T03:00:00.000000000',\n",
- " '2024-01-16T04:00:00.000000000', '2024-01-16T05:00:00.000000000',\n",
- " '2024-01-16T06:00:00.000000000', '2024-01-16T07:00:00.000000000',\n",
- " '2024-01-16T08:00:00.000000000', '2024-01-16T09:00:00.000000000',\n",
- " '2024-01-16T10:00:00.000000000', '2024-01-16T11:00:00.000000000',\n",
- " '2024-01-16T12:00:00.000000000', '2024-01-16T13:00:00.000000000',\n",
- " '2024-01-16T14:00:00.000000000', '2024-01-16T15:00:00.000000000',\n",
- " '2024-01-16T16:00:00.000000000', '2024-01-16T17:00:00.000000000',\n",
- " '2024-01-16T18:00:00.000000000', '2024-01-16T19:00:00.000000000',\n",
- " '2024-01-16T20:00:00.000000000', '2024-01-16T21:00:00.000000000',\n",
- " '2024-01-16T22:00:00.000000000', '2024-01-16T23:00:00.000000000',\n",
- " '2024-01-17T00:00:00.000000000', '2024-01-17T01:00:00.000000000',\n",
- " '2024-01-17T02:00:00.000000000', '2024-01-17T03:00:00.000000000',\n",
- " '2024-01-17T04:00:00.000000000', '2024-01-17T05:00:00.000000000',\n",
- " '2024-01-17T06:00:00.000000000', '2024-01-17T07:00:00.000000000',\n",
- " '2024-01-17T08:00:00.000000000', '2024-01-17T09:00:00.000000000',\n",
- " '2024-01-17T10:00:00.000000000', '2024-01-17T11:00:00.000000000',\n",
- " '2024-01-17T12:00:00.000000000', '2024-01-17T13:00:00.000000000',\n",
- " '2024-01-17T14:00:00.000000000', '2024-01-17T15:00:00.000000000',\n",
- " '2024-01-17T16:00:00.000000000', '2024-01-17T17:00:00.000000000',\n",
- " '2024-01-17T18:00:00.000000000', '2024-01-17T19:00:00.000000000',\n",
- " '2024-01-17T20:00:00.000000000', '2024-01-17T21:00:00.000000000',\n",
- " '2024-01-17T22:00:00.000000000', '2024-01-17T23:00:00.000000000',\n",
- " '2024-01-18T00:00:00.000000000', '2024-01-18T01:00:00.000000000',\n",
- " '2024-01-18T02:00:00.000000000', '2024-01-18T03:00:00.000000000',\n",
- " '2024-01-18T04:00:00.000000000', '2024-01-18T05:00:00.000000000',\n",
- " '2024-01-18T06:00:00.000000000', '2024-01-18T07:00:00.000000000',\n",
- " '2024-01-18T08:00:00.000000000', '2024-01-18T09:00:00.000000000',\n",
- " '2024-01-18T10:00:00.000000000', '2024-01-18T11:00:00.000000000',\n",
- " '2024-01-18T12:00:00.000000000', '2024-01-18T13:00:00.000000000',\n",
- " '2024-01-18T14:00:00.000000000', '2024-01-18T15:00:00.000000000',\n",
- " '2024-01-18T16:00:00.000000000', '2024-01-18T17:00:00.000000000',\n",
- " '2024-01-18T18:00:00.000000000', '2024-01-18T19:00:00.000000000',\n",
- " '2024-01-18T20:00:00.000000000', '2024-01-18T21:00:00.000000000',\n",
- " '2024-01-18T22:00:00.000000000', '2024-01-18T23:00:00.000000000',\n",
- " '2024-01-19T00:00:00.000000000', '2024-01-19T01:00:00.000000000',\n",
- " '2024-01-19T02:00:00.000000000', '2024-01-19T03:00:00.000000000',\n",
- " '2024-01-19T04:00:00.000000000', '2024-01-19T05:00:00.000000000',\n",
- " '2024-01-19T06:00:00.000000000', '2024-01-19T07:00:00.000000000',\n",
- " '2024-01-19T08:00:00.000000000', '2024-01-19T09:00:00.000000000',\n",
- " '2024-01-19T10:00:00.000000000', '2024-01-19T11:00:00.000000000',\n",
- " '2024-01-19T12:00:00.000000000', '2024-01-19T13:00:00.000000000',\n",
- " '2024-01-19T14:00:00.000000000', '2024-01-19T15:00:00.000000000',\n",
- " '2024-01-19T16:00:00.000000000', '2024-01-19T17:00:00.000000000',\n",
- " '2024-01-19T18:00:00.000000000', '2024-01-19T19:00:00.000000000',\n",
- " '2024-01-19T20:00:00.000000000', '2024-01-19T21:00:00.000000000',\n",
- " '2024-01-19T22:00:00.000000000', '2024-01-19T23:00:00.000000000',\n",
- " '2024-01-20T00:00:00.000000000', '2024-01-20T01:00:00.000000000',\n",
- " '2024-01-20T02:00:00.000000000', '2024-01-20T03:00:00.000000000',\n",
- " '2024-01-20T04:00:00.000000000', '2024-01-20T05:00:00.000000000',\n",
- " '2024-01-20T06:00:00.000000000', '2024-01-20T07:00:00.000000000',\n",
- " '2024-01-20T08:00:00.000000000', '2024-01-20T09:00:00.000000000',\n",
- " '2024-01-20T10:00:00.000000000', '2024-01-20T11:00:00.000000000',\n",
- " '2024-01-20T12:00:00.000000000', '2024-01-20T13:00:00.000000000',\n",
- " '2024-01-20T14:00:00.000000000', '2024-01-20T15:00:00.000000000',\n",
- " '2024-01-20T16:00:00.000000000', '2024-01-20T17:00:00.000000000',\n",
- " '2024-01-20T18:00:00.000000000', '2024-01-20T19:00:00.000000000',\n",
- " '2024-01-20T20:00:00.000000000', '2024-01-20T21:00:00.000000000',\n",
- " '2024-01-20T22:00:00.000000000', '2024-01-20T23:00:00.000000000',\n",
- " '2024-01-21T00:00:00.000000000', '2024-01-21T01:00:00.000000000',\n",
- " '2024-01-21T02:00:00.000000000', '2024-01-21T03:00:00.000000000',\n",
- " '2024-01-21T04:00:00.000000000', '2024-01-21T05:00:00.000000000',\n",
- " '2024-01-21T06:00:00.000000000', '2024-01-21T07:00:00.000000000',\n",
- " '2024-01-21T08:00:00.000000000', '2024-01-21T09:00:00.000000000',\n",
- " '2024-01-21T10:00:00.000000000', '2024-01-21T11:00:00.000000000',\n",
- " '2024-01-21T12:00:00.000000000', '2024-01-21T13:00:00.000000000',\n",
- " '2024-01-21T14:00:00.000000000', '2024-01-21T15:00:00.000000000',\n",
- " '2024-01-21T16:00:00.000000000', '2024-01-21T17:00:00.000000000',\n",
- " '2024-01-21T18:00:00.000000000', '2024-01-21T19:00:00.000000000',\n",
- " '2024-01-21T20:00:00.000000000', '2024-01-21T21:00:00.000000000',\n",
- " '2024-01-21T22:00:00.000000000', '2024-01-21T23:00:00.000000000',\n",
- " '2024-01-22T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('AAAAAABAb0AAAAAAABhvQDkzMzMz8G' ... 'LbxcFZQPDkQtTNoFlAAAAAAAAAaUA='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y2'}],\n",
- " 'layout': {'bargap': 0,\n",
- " 'bargroupgap': 0,\n",
- " 'barmode': 'relative',\n",
- " 'legend': {'title': {'text': 'variable'}, 'tracegroupgap': 0},\n",
- " 'template': '...',\n",
- " 'title': {'text': 'ThermalStorage Operation (flow_rate)'},\n",
- " 'xaxis': {'anchor': 'y', 'domain': [0.0, 1.0], 'title': {'text': 'time'}},\n",
- " 'yaxis': {'anchor': 'x', 'domain': [0.0, 1.0], 'title': {'text': 'value'}},\n",
- " 'yaxis2': {'overlaying': 'y', 'showgrid': False, 'side': 'right', 'title': {'text': 'Charge State'}}}\n",
- "}))"
- ],
- "text/html": [
- ""
- ]
- },
- "execution_count": 12,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "execution_count": 12
+ ]
},
{
"cell_type": "markdown",
- "id": "34",
+ "id": "24",
"metadata": {},
"source": [
"### 3.5 Charge States Plot\n",
@@ -2975,146 +288,17 @@
},
{
"cell_type": "code",
- "id": "35",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T14:13:17.297322Z",
- "start_time": "2025-12-13T14:13:17.214857Z"
- }
- },
+ "execution_count": null,
+ "id": "25",
+ "metadata": {},
+ "outputs": [],
"source": [
"simple.statistics.plot.charge_states('ThermalStorage')"
- ],
- "outputs": [
- {
- "data": {
- "text/plain": [
- "PlotResult(data= Size: 3kB\n",
- "Dimensions: (time: 169)\n",
- "Coordinates:\n",
- " * time (time) datetime64[ns] 1kB 2024-01-15 ... 2024-01-22\n",
- "Data variables:\n",
- " ThermalStorage (time) float64 1kB 250.0 248.8 247.5 ... 103.0 102.5 200.0, figure=Figure({\n",
- " 'data': [{'hovertemplate': 'variable=ThermalStorage
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'ThermalStorage',\n",
- " 'line': {'color': '#636EFA', 'dash': 'solid'},\n",
- " 'marker': {'symbol': 'circle'},\n",
- " 'mode': 'lines',\n",
- " 'name': 'ThermalStorage',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'type': 'scatter',\n",
- " 'x': array(['2024-01-15T00:00:00.000000000', '2024-01-15T01:00:00.000000000',\n",
- " '2024-01-15T02:00:00.000000000', '2024-01-15T03:00:00.000000000',\n",
- " '2024-01-15T04:00:00.000000000', '2024-01-15T05:00:00.000000000',\n",
- " '2024-01-15T06:00:00.000000000', '2024-01-15T07:00:00.000000000',\n",
- " '2024-01-15T08:00:00.000000000', '2024-01-15T09:00:00.000000000',\n",
- " '2024-01-15T10:00:00.000000000', '2024-01-15T11:00:00.000000000',\n",
- " '2024-01-15T12:00:00.000000000', '2024-01-15T13:00:00.000000000',\n",
- " '2024-01-15T14:00:00.000000000', '2024-01-15T15:00:00.000000000',\n",
- " '2024-01-15T16:00:00.000000000', '2024-01-15T17:00:00.000000000',\n",
- " '2024-01-15T18:00:00.000000000', '2024-01-15T19:00:00.000000000',\n",
- " '2024-01-15T20:00:00.000000000', '2024-01-15T21:00:00.000000000',\n",
- " '2024-01-15T22:00:00.000000000', '2024-01-15T23:00:00.000000000',\n",
- " '2024-01-16T00:00:00.000000000', '2024-01-16T01:00:00.000000000',\n",
- " '2024-01-16T02:00:00.000000000', '2024-01-16T03:00:00.000000000',\n",
- " '2024-01-16T04:00:00.000000000', '2024-01-16T05:00:00.000000000',\n",
- " '2024-01-16T06:00:00.000000000', '2024-01-16T07:00:00.000000000',\n",
- " '2024-01-16T08:00:00.000000000', '2024-01-16T09:00:00.000000000',\n",
- " '2024-01-16T10:00:00.000000000', '2024-01-16T11:00:00.000000000',\n",
- " '2024-01-16T12:00:00.000000000', '2024-01-16T13:00:00.000000000',\n",
- " '2024-01-16T14:00:00.000000000', '2024-01-16T15:00:00.000000000',\n",
- " '2024-01-16T16:00:00.000000000', '2024-01-16T17:00:00.000000000',\n",
- " '2024-01-16T18:00:00.000000000', '2024-01-16T19:00:00.000000000',\n",
- " '2024-01-16T20:00:00.000000000', '2024-01-16T21:00:00.000000000',\n",
- " '2024-01-16T22:00:00.000000000', '2024-01-16T23:00:00.000000000',\n",
- " '2024-01-17T00:00:00.000000000', '2024-01-17T01:00:00.000000000',\n",
- " '2024-01-17T02:00:00.000000000', '2024-01-17T03:00:00.000000000',\n",
- " '2024-01-17T04:00:00.000000000', '2024-01-17T05:00:00.000000000',\n",
- " '2024-01-17T06:00:00.000000000', '2024-01-17T07:00:00.000000000',\n",
- " '2024-01-17T08:00:00.000000000', '2024-01-17T09:00:00.000000000',\n",
- " '2024-01-17T10:00:00.000000000', '2024-01-17T11:00:00.000000000',\n",
- " '2024-01-17T12:00:00.000000000', '2024-01-17T13:00:00.000000000',\n",
- " '2024-01-17T14:00:00.000000000', '2024-01-17T15:00:00.000000000',\n",
- " '2024-01-17T16:00:00.000000000', '2024-01-17T17:00:00.000000000',\n",
- " '2024-01-17T18:00:00.000000000', '2024-01-17T19:00:00.000000000',\n",
- " '2024-01-17T20:00:00.000000000', '2024-01-17T21:00:00.000000000',\n",
- " '2024-01-17T22:00:00.000000000', '2024-01-17T23:00:00.000000000',\n",
- " '2024-01-18T00:00:00.000000000', '2024-01-18T01:00:00.000000000',\n",
- " '2024-01-18T02:00:00.000000000', '2024-01-18T03:00:00.000000000',\n",
- " '2024-01-18T04:00:00.000000000', '2024-01-18T05:00:00.000000000',\n",
- " '2024-01-18T06:00:00.000000000', '2024-01-18T07:00:00.000000000',\n",
- " '2024-01-18T08:00:00.000000000', '2024-01-18T09:00:00.000000000',\n",
- " '2024-01-18T10:00:00.000000000', '2024-01-18T11:00:00.000000000',\n",
- " '2024-01-18T12:00:00.000000000', '2024-01-18T13:00:00.000000000',\n",
- " '2024-01-18T14:00:00.000000000', '2024-01-18T15:00:00.000000000',\n",
- " '2024-01-18T16:00:00.000000000', '2024-01-18T17:00:00.000000000',\n",
- " '2024-01-18T18:00:00.000000000', '2024-01-18T19:00:00.000000000',\n",
- " '2024-01-18T20:00:00.000000000', '2024-01-18T21:00:00.000000000',\n",
- " '2024-01-18T22:00:00.000000000', '2024-01-18T23:00:00.000000000',\n",
- " '2024-01-19T00:00:00.000000000', '2024-01-19T01:00:00.000000000',\n",
- " '2024-01-19T02:00:00.000000000', '2024-01-19T03:00:00.000000000',\n",
- " '2024-01-19T04:00:00.000000000', '2024-01-19T05:00:00.000000000',\n",
- " '2024-01-19T06:00:00.000000000', '2024-01-19T07:00:00.000000000',\n",
- " '2024-01-19T08:00:00.000000000', '2024-01-19T09:00:00.000000000',\n",
- " '2024-01-19T10:00:00.000000000', '2024-01-19T11:00:00.000000000',\n",
- " '2024-01-19T12:00:00.000000000', '2024-01-19T13:00:00.000000000',\n",
- " '2024-01-19T14:00:00.000000000', '2024-01-19T15:00:00.000000000',\n",
- " '2024-01-19T16:00:00.000000000', '2024-01-19T17:00:00.000000000',\n",
- " '2024-01-19T18:00:00.000000000', '2024-01-19T19:00:00.000000000',\n",
- " '2024-01-19T20:00:00.000000000', '2024-01-19T21:00:00.000000000',\n",
- " '2024-01-19T22:00:00.000000000', '2024-01-19T23:00:00.000000000',\n",
- " '2024-01-20T00:00:00.000000000', '2024-01-20T01:00:00.000000000',\n",
- " '2024-01-20T02:00:00.000000000', '2024-01-20T03:00:00.000000000',\n",
- " '2024-01-20T04:00:00.000000000', '2024-01-20T05:00:00.000000000',\n",
- " '2024-01-20T06:00:00.000000000', '2024-01-20T07:00:00.000000000',\n",
- " '2024-01-20T08:00:00.000000000', '2024-01-20T09:00:00.000000000',\n",
- " '2024-01-20T10:00:00.000000000', '2024-01-20T11:00:00.000000000',\n",
- " '2024-01-20T12:00:00.000000000', '2024-01-20T13:00:00.000000000',\n",
- " '2024-01-20T14:00:00.000000000', '2024-01-20T15:00:00.000000000',\n",
- " '2024-01-20T16:00:00.000000000', '2024-01-20T17:00:00.000000000',\n",
- " '2024-01-20T18:00:00.000000000', '2024-01-20T19:00:00.000000000',\n",
- " '2024-01-20T20:00:00.000000000', '2024-01-20T21:00:00.000000000',\n",
- " '2024-01-20T22:00:00.000000000', '2024-01-20T23:00:00.000000000',\n",
- " '2024-01-21T00:00:00.000000000', '2024-01-21T01:00:00.000000000',\n",
- " '2024-01-21T02:00:00.000000000', '2024-01-21T03:00:00.000000000',\n",
- " '2024-01-21T04:00:00.000000000', '2024-01-21T05:00:00.000000000',\n",
- " '2024-01-21T06:00:00.000000000', '2024-01-21T07:00:00.000000000',\n",
- " '2024-01-21T08:00:00.000000000', '2024-01-21T09:00:00.000000000',\n",
- " '2024-01-21T10:00:00.000000000', '2024-01-21T11:00:00.000000000',\n",
- " '2024-01-21T12:00:00.000000000', '2024-01-21T13:00:00.000000000',\n",
- " '2024-01-21T14:00:00.000000000', '2024-01-21T15:00:00.000000000',\n",
- " '2024-01-21T16:00:00.000000000', '2024-01-21T17:00:00.000000000',\n",
- " '2024-01-21T18:00:00.000000000', '2024-01-21T19:00:00.000000000',\n",
- " '2024-01-21T20:00:00.000000000', '2024-01-21T21:00:00.000000000',\n",
- " '2024-01-21T22:00:00.000000000', '2024-01-21T23:00:00.000000000',\n",
- " '2024-01-22T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('AAAAAABAb0AAAAAAABhvQDkzMzMz8G' ... 'LbxcFZQPDkQtTNoFlAAAAAAAAAaUA='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'}],\n",
- " 'layout': {'legend': {'title': {'text': 'variable'}, 'tracegroupgap': 0},\n",
- " 'template': '...',\n",
- " 'title': {'text': 'Storage Charge States'},\n",
- " 'xaxis': {'anchor': 'y', 'domain': [0.0, 1.0], 'title': {'text': 'time'}},\n",
- " 'yaxis': {'anchor': 'x', 'domain': [0.0, 1.0], 'title': {'text': 'Charge State'}}}\n",
- "}))"
- ],
- "text/html": [
- ""
- ]
- },
- "execution_count": 13,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "execution_count": 13
+ ]
},
{
"cell_type": "markdown",
- "id": "36",
+ "id": "26",
"metadata": {},
"source": [
"## 4. Aggregated Plots"
@@ -3122,7 +306,7 @@
},
{
"cell_type": "markdown",
- "id": "37",
+ "id": "27",
"metadata": {},
"source": [
"### 4.1 Sizes Plot\n",
@@ -3132,267 +316,17 @@
},
{
"cell_type": "code",
- "id": "38",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T14:17:12.906249Z",
- "start_time": "2025-12-13T14:17:12.823893Z"
- }
- },
- "source": "multiperiod.statistics.plot.sizes()",
- "outputs": [
- {
- "data": {
- "text/plain": [
- "PlotResult(data= Size: 208B\n",
- "Dimensions: (period: 3, scenario: 2)\n",
- "Coordinates:\n",
- " * period (period) int64 24B 2024 2025 2026\n",
- " * scenario (scenario) scenario=high_demand
period=2024
Size=%{y}',\n",
- " 'legendgroup': 'Boiler(Heat)',\n",
- " 'marker': {'color': '#30123b', 'pattern': {'shape': ''}},\n",
- " 'name': 'Boiler(Heat)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['Boiler(Heat)'], dtype=object),\n",
- " 'xaxis': 'x4',\n",
- " 'y': {'bdata': 'PvP9oLpQWkA=', 'dtype': 'f8'},\n",
- " 'yaxis': 'y4'},\n",
- " {'hovertemplate': 'Flow=%{x}
scenario=high_demand
period=2025
Size=%{y}',\n",
- " 'legendgroup': 'Boiler(Heat)',\n",
- " 'marker': {'color': '#30123b', 'pattern': {'shape': ''}},\n",
- " 'name': 'Boiler(Heat)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': False,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['Boiler(Heat)'], dtype=object),\n",
- " 'xaxis': 'x5',\n",
- " 'y': {'bdata': 'PvP9oLpQWkA=', 'dtype': 'f8'},\n",
- " 'yaxis': 'y5'},\n",
- " {'hovertemplate': 'Flow=%{x}
scenario=high_demand
period=2026
Size=%{y}',\n",
- " 'legendgroup': 'Boiler(Heat)',\n",
- " 'marker': {'color': '#30123b', 'pattern': {'shape': ''}},\n",
- " 'name': 'Boiler(Heat)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': False,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['Boiler(Heat)'], dtype=object),\n",
- " 'xaxis': 'x6',\n",
- " 'y': {'bdata': 'PvP9oLpQWkA=', 'dtype': 'f8'},\n",
- " 'yaxis': 'y6'},\n",
- " {'hovertemplate': 'Flow=%{x}
scenario=low_demand
period=2024
Size=%{y}',\n",
- " 'legendgroup': 'Boiler(Heat)',\n",
- " 'marker': {'color': '#30123b', 'pattern': {'shape': ''}},\n",
- " 'name': 'Boiler(Heat)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': False,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['Boiler(Heat)'], dtype=object),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': 'PvP9oLpQWkA=', 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'Flow=%{x}
scenario=low_demand
period=2025
Size=%{y}',\n",
- " 'legendgroup': 'Boiler(Heat)',\n",
- " 'marker': {'color': '#30123b', 'pattern': {'shape': ''}},\n",
- " 'name': 'Boiler(Heat)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': False,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['Boiler(Heat)'], dtype=object),\n",
- " 'xaxis': 'x2',\n",
- " 'y': {'bdata': 'PvP9oLpQWkA=', 'dtype': 'f8'},\n",
- " 'yaxis': 'y2'},\n",
- " {'hovertemplate': 'Flow=%{x}
scenario=low_demand
period=2026
Size=%{y}',\n",
- " 'legendgroup': 'Boiler(Heat)',\n",
- " 'marker': {'color': '#30123b', 'pattern': {'shape': ''}},\n",
- " 'name': 'Boiler(Heat)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': False,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['Boiler(Heat)'], dtype=object),\n",
- " 'xaxis': 'x3',\n",
- " 'y': {'bdata': 'PvP9oLpQWkA=', 'dtype': 'f8'},\n",
- " 'yaxis': 'y3'},\n",
- " {'hovertemplate': 'Flow=%{x}
scenario=high_demand
period=2024
Size=%{y}',\n",
- " 'legendgroup': 'ThermalStorage',\n",
- " 'marker': {'color': '#7a0402', 'pattern': {'shape': ''}},\n",
- " 'name': 'ThermalStorage',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['ThermalStorage'], dtype=object),\n",
- " 'xaxis': 'x4',\n",
- " 'y': {'bdata': 'AAAAAAAAAAA=', 'dtype': 'f8'},\n",
- " 'yaxis': 'y4'},\n",
- " {'hovertemplate': 'Flow=%{x}
scenario=high_demand
period=2025
Size=%{y}',\n",
- " 'legendgroup': 'ThermalStorage',\n",
- " 'marker': {'color': '#7a0402', 'pattern': {'shape': ''}},\n",
- " 'name': 'ThermalStorage',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': False,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['ThermalStorage'], dtype=object),\n",
- " 'xaxis': 'x5',\n",
- " 'y': {'bdata': 'AAAAAAAAAAA=', 'dtype': 'f8'},\n",
- " 'yaxis': 'y5'},\n",
- " {'hovertemplate': 'Flow=%{x}
scenario=high_demand
period=2026
Size=%{y}',\n",
- " 'legendgroup': 'ThermalStorage',\n",
- " 'marker': {'color': '#7a0402', 'pattern': {'shape': ''}},\n",
- " 'name': 'ThermalStorage',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': False,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['ThermalStorage'], dtype=object),\n",
- " 'xaxis': 'x6',\n",
- " 'y': {'bdata': 'AAAAAAAAAAA=', 'dtype': 'f8'},\n",
- " 'yaxis': 'y6'},\n",
- " {'hovertemplate': 'Flow=%{x}
scenario=low_demand
period=2024
Size=%{y}',\n",
- " 'legendgroup': 'ThermalStorage',\n",
- " 'marker': {'color': '#7a0402', 'pattern': {'shape': ''}},\n",
- " 'name': 'ThermalStorage',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': False,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['ThermalStorage'], dtype=object),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': 'AAAAAAAAAAA=', 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'Flow=%{x}
scenario=low_demand
period=2025
Size=%{y}',\n",
- " 'legendgroup': 'ThermalStorage',\n",
- " 'marker': {'color': '#7a0402', 'pattern': {'shape': ''}},\n",
- " 'name': 'ThermalStorage',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': False,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['ThermalStorage'], dtype=object),\n",
- " 'xaxis': 'x2',\n",
- " 'y': {'bdata': 'AAAAAAAAAAA=', 'dtype': 'f8'},\n",
- " 'yaxis': 'y2'},\n",
- " {'hovertemplate': 'Flow=%{x}
scenario=low_demand
period=2026
Size=%{y}',\n",
- " 'legendgroup': 'ThermalStorage',\n",
- " 'marker': {'color': '#7a0402', 'pattern': {'shape': ''}},\n",
- " 'name': 'ThermalStorage',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': False,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['ThermalStorage'], dtype=object),\n",
- " 'xaxis': 'x3',\n",
- " 'y': {'bdata': 'AAAAAAAAAAA=', 'dtype': 'f8'},\n",
- " 'yaxis': 'y3'}],\n",
- " 'layout': {'annotations': [{'font': {},\n",
- " 'showarrow': False,\n",
- " 'text': 'period=2024',\n",
- " 'x': 0.15666666666666665,\n",
- " 'xanchor': 'center',\n",
- " 'xref': 'paper',\n",
- " 'y': 1.0,\n",
- " 'yanchor': 'bottom',\n",
- " 'yref': 'paper'},\n",
- " {'font': {},\n",
- " 'showarrow': False,\n",
- " 'text': 'period=2025',\n",
- " 'x': 0.49,\n",
- " 'xanchor': 'center',\n",
- " 'xref': 'paper',\n",
- " 'y': 1.0,\n",
- " 'yanchor': 'bottom',\n",
- " 'yref': 'paper'},\n",
- " {'font': {},\n",
- " 'showarrow': False,\n",
- " 'text': 'period=2026',\n",
- " 'x': 0.8233333333333333,\n",
- " 'xanchor': 'center',\n",
- " 'xref': 'paper',\n",
- " 'y': 1.0,\n",
- " 'yanchor': 'bottom',\n",
- " 'yref': 'paper'},\n",
- " {'font': {},\n",
- " 'showarrow': False,\n",
- " 'text': 'scenario=low_demand',\n",
- " 'textangle': 90,\n",
- " 'x': 0.98,\n",
- " 'xanchor': 'left',\n",
- " 'xref': 'paper',\n",
- " 'y': 0.2425,\n",
- " 'yanchor': 'middle',\n",
- " 'yref': 'paper'},\n",
- " {'font': {},\n",
- " 'showarrow': False,\n",
- " 'text': 'scenario=high_demand',\n",
- " 'textangle': 90,\n",
- " 'x': 0.98,\n",
- " 'xanchor': 'left',\n",
- " 'xref': 'paper',\n",
- " 'y': 0.7575000000000001,\n",
- " 'yanchor': 'middle',\n",
- " 'yref': 'paper'}],\n",
- " 'barmode': 'relative',\n",
- " 'legend': {'title': {'text': 'Flow'}, 'tracegroupgap': 0},\n",
- " 'template': '...',\n",
- " 'title': {'text': 'Investment Sizes'},\n",
- " 'xaxis': {'anchor': 'y',\n",
- " 'categoryarray': [Boiler(Heat), ThermalStorage],\n",
- " 'categoryorder': 'array',\n",
- " 'domain': [0.0, 0.3133333333333333],\n",
- " 'title': {'text': 'Flow'}},\n",
- " 'xaxis2': {'anchor': 'y2',\n",
- " 'categoryarray': [Boiler(Heat), ThermalStorage],\n",
- " 'categoryorder': 'array',\n",
- " 'domain': [0.3333333333333333, 0.6466666666666666],\n",
- " 'matches': 'x',\n",
- " 'title': {'text': 'Flow'}},\n",
- " 'xaxis3': {'anchor': 'y3',\n",
- " 'categoryarray': [Boiler(Heat), ThermalStorage],\n",
- " 'categoryorder': 'array',\n",
- " 'domain': [0.6666666666666666, 0.98],\n",
- " 'matches': 'x',\n",
- " 'title': {'text': 'Flow'}},\n",
- " 'xaxis4': {'anchor': 'y4', 'domain': [0.0, 0.3133333333333333], 'matches': 'x', 'showticklabels': False},\n",
- " 'xaxis5': {'anchor': 'y5',\n",
- " 'domain': [0.3333333333333333, 0.6466666666666666],\n",
- " 'matches': 'x',\n",
- " 'showticklabels': False},\n",
- " 'xaxis6': {'anchor': 'y6', 'domain': [0.6666666666666666, 0.98], 'matches': 'x', 'showticklabels': False},\n",
- " 'yaxis': {'anchor': 'x', 'domain': [0.0, 0.485], 'title': {'text': 'Size'}},\n",
- " 'yaxis2': {'anchor': 'x2', 'domain': [0.0, 0.485], 'matches': 'y', 'showticklabels': False},\n",
- " 'yaxis3': {'anchor': 'x3', 'domain': [0.0, 0.485], 'matches': 'y', 'showticklabels': False},\n",
- " 'yaxis4': {'anchor': 'x4', 'domain': [0.515, 1.0], 'matches': 'y', 'title': {'text': 'Size'}},\n",
- " 'yaxis5': {'anchor': 'x5', 'domain': [0.515, 1.0], 'matches': 'y', 'showticklabels': False},\n",
- " 'yaxis6': {'anchor': 'x6', 'domain': [0.515, 1.0], 'matches': 'y', 'showticklabels': False}}\n",
- "}))"
- ],
- "text/html": [
- ""
- ]
- },
- "execution_count": 46,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "execution_count": 46
+ "execution_count": null,
+ "id": "28",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "multiperiod.statistics.plot.sizes()"
+ ]
},
{
"cell_type": "markdown",
- "id": "39",
+ "id": "29",
"metadata": {},
"source": [
"### 4.2 Effects Plot\n",
@@ -3402,315 +336,38 @@
},
{
"cell_type": "code",
- "id": "40",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T14:13:17.440231Z",
- "start_time": "2025-12-13T14:13:17.355184Z"
- }
- },
+ "execution_count": null,
+ "id": "30",
+ "metadata": {},
+ "outputs": [],
"source": [
"simple.statistics.plot.effects(effect='costs')"
- ],
- "outputs": [
- {
- "data": {
- "text/plain": [
- "PlotResult(data= Size: 24B\n",
- "Dimensions: (effect: 1, component: 1)\n",
- "Coordinates:\n",
- " * effect (effect) object 8B 'costs'\n",
- " * component (component) object 8B 'GasGrid'\n",
- "Data variables:\n",
- " total (effect, component) float64 8B 558.8, figure=Figure({\n",
- " 'data': [{'hovertemplate': 'component=%{x}
value=%{y}',\n",
- " 'legendgroup': 'GasGrid',\n",
- " 'marker': {'color': '#a4fc3b', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'GasGrid',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['GasGrid'], dtype=object),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': 'sDkY5qR2gUA=', 'dtype': 'f8'},\n",
- " 'yaxis': 'y'}],\n",
- " 'layout': {'bargap': 0,\n",
- " 'bargroupgap': 0,\n",
- " 'barmode': 'relative',\n",
- " 'legend': {'title': {'text': 'component'}, 'tracegroupgap': 0},\n",
- " 'template': '...',\n",
- " 'title': {'text': 'costs (total) by component'},\n",
- " 'xaxis': {'anchor': 'y',\n",
- " 'categoryarray': [GasGrid],\n",
- " 'categoryorder': 'array',\n",
- " 'domain': [0.0, 1.0],\n",
- " 'title': {'text': 'component'}},\n",
- " 'yaxis': {'anchor': 'x', 'domain': [0.0, 1.0], 'title': {'text': 'value'}}}\n",
- "}))"
- ],
- "text/html": [
- ""
- ]
- },
- "execution_count": 15,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "execution_count": 15
+ ]
},
{
"cell_type": "code",
- "id": "41",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T14:13:17.547032Z",
- "start_time": "2025-12-13T14:13:17.454197Z"
- }
- },
+ "execution_count": null,
+ "id": "31",
+ "metadata": {},
+ "outputs": [],
"source": [
"# Multi-effect system: compare costs and CO2\n",
"complex_sys.statistics.plot.effects(effect='costs')"
- ],
- "outputs": [
- {
- "data": {
- "text/plain": [
- "PlotResult(data= Size: 104B\n",
- "Dimensions: (effect: 1, component: 6)\n",
- "Coordinates:\n",
- " * effect (effect) object 8B 'costs'\n",
- " * component (component) object 48B 'CHP' ... 'HeatStorage'\n",
- "Data variables:\n",
- " total (effect, component) float64 48B 76.0 -297.4 102.9 420.8 0.0 0.0, figure=Figure({\n",
- " 'data': [{'hovertemplate': 'component=%{x}
value=%{y}',\n",
- " 'legendgroup': 'CHP',\n",
- " 'marker': {'color': '#30123b', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'CHP',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['CHP'], dtype=object),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': 'AAAAAAAAU0A=', 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'component=%{x}
value=%{y}',\n",
- " 'legendgroup': 'ElectricityExport',\n",
- " 'marker': {'color': '#3c99f9', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'ElectricityExport',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['ElectricityExport'], dtype=object),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': 'QuE7D7GWcsA=', 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'component=%{x}
value=%{y}',\n",
- " 'legendgroup': 'ElectricityImport',\n",
- " 'marker': {'color': '#49f683', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'ElectricityImport',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['ElectricityImport'], dtype=object),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': 'mB7bhVm8WUA=', 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'component=%{x}
value=%{y}',\n",
- " 'legendgroup': 'GasGrid',\n",
- " 'marker': {'color': '#dfda36', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'GasGrid',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['GasGrid'], dtype=object),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': 'VVvjiWRNekA=', 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'component=%{x}
value=%{y}',\n",
- " 'legendgroup': 'HeatPump',\n",
- " 'marker': {'color': '#ee5a12', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'HeatPump',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['HeatPump'], dtype=object),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': 'AAAAAAAAAAA=', 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'component=%{x}
value=%{y}',\n",
- " 'legendgroup': 'HeatStorage',\n",
- " 'marker': {'color': '#7a0402', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'HeatStorage',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['HeatStorage'], dtype=object),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': 'AAAAAAAAAAA=', 'dtype': 'f8'},\n",
- " 'yaxis': 'y'}],\n",
- " 'layout': {'bargap': 0,\n",
- " 'bargroupgap': 0,\n",
- " 'barmode': 'relative',\n",
- " 'legend': {'title': {'text': 'component'}, 'tracegroupgap': 0},\n",
- " 'template': '...',\n",
- " 'title': {'text': 'costs (total) by component'},\n",
- " 'xaxis': {'anchor': 'y',\n",
- " 'categoryarray': [CHP, ElectricityExport,\n",
- " ElectricityImport, GasGrid, HeatPump,\n",
- " HeatStorage],\n",
- " 'categoryorder': 'array',\n",
- " 'domain': [0.0, 1.0],\n",
- " 'title': {'text': 'component'}},\n",
- " 'yaxis': {'anchor': 'x', 'domain': [0.0, 1.0], 'title': {'text': 'value'}}}\n",
- "}))"
- ],
- "text/html": [
- ""
- ]
- },
- "execution_count": 16,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "execution_count": 16
+ ]
},
{
"cell_type": "code",
- "id": "42",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T14:13:17.616154Z",
- "start_time": "2025-12-13T14:13:17.558702Z"
- }
- },
+ "execution_count": null,
+ "id": "32",
+ "metadata": {},
+ "outputs": [],
"source": [
"complex_sys.statistics.plot.effects(effect='CO2')"
- ],
- "outputs": [
- {
- "data": {
- "text/plain": [
- "PlotResult(data= Size: 104B\n",
- "Dimensions: (effect: 1, component: 6)\n",
- "Coordinates:\n",
- " * effect (effect) object 8B 'CO2'\n",
- " * component (component) object 48B 'CHP' ... 'HeatStorage'\n",
- "Data variables:\n",
- " total (effect, component) float64 48B 0.0 0.0 255.1 1.403e+03 0.0 0.0, figure=Figure({\n",
- " 'data': [{'hovertemplate': 'component=%{x}
value=%{y}',\n",
- " 'legendgroup': 'CHP',\n",
- " 'marker': {'color': '#30123b', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'CHP',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['CHP'], dtype=object),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': 'AAAAAAAAAAA=', 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'component=%{x}
value=%{y}',\n",
- " 'legendgroup': 'ElectricityExport',\n",
- " 'marker': {'color': '#3c99f9', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'ElectricityExport',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['ElectricityExport'], dtype=object),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': 'AAAAAAAAAAA=', 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'component=%{x}
value=%{y}',\n",
- " 'legendgroup': 'ElectricityImport',\n",
- " 'marker': {'color': '#49f683', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'ElectricityImport',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['ElectricityImport'], dtype=object),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': 'PuZR52/jb0A=', 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'component=%{x}
value=%{y}',\n",
- " 'legendgroup': 'GasGrid',\n",
- " 'marker': {'color': '#dfda36', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'GasGrid',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['GasGrid'], dtype=object),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': 'HMySHSnrlUA=', 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'component=%{x}
value=%{y}',\n",
- " 'legendgroup': 'HeatPump',\n",
- " 'marker': {'color': '#ee5a12', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'HeatPump',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['HeatPump'], dtype=object),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': 'AAAAAAAAAAA=', 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'component=%{x}
value=%{y}',\n",
- " 'legendgroup': 'HeatStorage',\n",
- " 'marker': {'color': '#7a0402', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'HeatStorage',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['HeatStorage'], dtype=object),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': 'AAAAAAAAAAA=', 'dtype': 'f8'},\n",
- " 'yaxis': 'y'}],\n",
- " 'layout': {'bargap': 0,\n",
- " 'bargroupgap': 0,\n",
- " 'barmode': 'relative',\n",
- " 'legend': {'title': {'text': 'component'}, 'tracegroupgap': 0},\n",
- " 'template': '...',\n",
- " 'title': {'text': 'CO2 (total) by component'},\n",
- " 'xaxis': {'anchor': 'y',\n",
- " 'categoryarray': [CHP, ElectricityExport,\n",
- " ElectricityImport, GasGrid, HeatPump,\n",
- " HeatStorage],\n",
- " 'categoryorder': 'array',\n",
- " 'domain': [0.0, 1.0],\n",
- " 'title': {'text': 'component'}},\n",
- " 'yaxis': {'anchor': 'x', 'domain': [0.0, 1.0], 'title': {'text': 'value'}}}\n",
- "}))"
- ],
- "text/html": [
- ""
- ]
- },
- "execution_count": 17,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "execution_count": 17
+ ]
},
{
"cell_type": "markdown",
- "id": "43",
+ "id": "33",
"metadata": {},
"source": [
"### 4.3 Duration Curve\n",
@@ -3720,152 +377,28 @@
},
{
"cell_type": "code",
- "id": "44",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T14:13:17.659929Z",
- "start_time": "2025-12-13T14:13:17.624261Z"
- }
- },
+ "execution_count": null,
+ "id": "34",
+ "metadata": {},
+ "outputs": [],
"source": [
"simple.statistics.plot.duration_curve('Boiler(Heat)')"
- ],
- "outputs": [
- {
- "data": {
- "text/plain": [
- "PlotResult(data= Size: 3kB\n",
- "Dimensions: (duration: 169)\n",
- "Coordinates:\n",
- " * duration (duration) int64 1kB 0 1 2 3 4 5 6 ... 163 164 165 166 167 168\n",
- "Data variables:\n",
- " Boiler(Heat) (duration) float64 1kB nan 137.8 134.1 133.1 ... 0.0 0.0 0.0, figure=Figure({\n",
- " 'data': [{'hovertemplate': 'variable=Boiler(Heat)
duration=%{x}
value=%{y}',\n",
- " 'legendgroup': 'Boiler(Heat)',\n",
- " 'line': {'color': '#636EFA', 'dash': 'solid'},\n",
- " 'marker': {'symbol': 'circle'},\n",
- " 'mode': 'lines',\n",
- " 'name': 'Boiler(Heat)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'type': 'scatter',\n",
- " 'x': {'bdata': ('AAABAAIAAwAEAAUABgAHAAgACQAKAA' ... '4AnwCgAKEAogCjAKQApQCmAKcAqAA='),\n",
- " 'dtype': 'i2'},\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('/////////39oQtzNVzphQLt+ZyCBw2' ... 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAA='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'}],\n",
- " 'layout': {'legend': {'title': {'text': 'variable'}, 'tracegroupgap': 0},\n",
- " 'template': '...',\n",
- " 'title': {'text': 'Duration Curve'},\n",
- " 'xaxis': {'anchor': 'y', 'domain': [0.0, 1.0], 'title': {'text': 'Timesteps'}},\n",
- " 'yaxis': {'anchor': 'x', 'domain': [0.0, 1.0], 'title': {'text': 'value'}}}\n",
- "}))"
- ],
- "text/html": [
- ""
- ]
- },
- "execution_count": 18,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "execution_count": 18
+ ]
},
{
"cell_type": "code",
- "id": "45",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T14:13:17.711351Z",
- "start_time": "2025-12-13T14:13:17.670270Z"
- }
- },
+ "execution_count": null,
+ "id": "35",
+ "metadata": {},
+ "outputs": [],
"source": [
"# Multiple variables\n",
"complex_sys.statistics.plot.duration_curve(['CHP(Heat)', 'HeatPump(Heat)', 'BackupBoiler(Heat)'])"
- ],
- "outputs": [
- {
- "data": {
- "text/plain": [
- "PlotResult(data= Size: 2kB\n",
- "Dimensions: (duration: 73)\n",
- "Coordinates:\n",
- " * duration (duration) int64 584B 0 1 2 3 4 5 ... 67 68 69 70 71 72\n",
- "Data variables:\n",
- " CHP(Heat) (duration) float64 584B nan 80.88 80.62 ... 0.0 0.0 0.0\n",
- " HeatPump(Heat) (duration) float64 584B nan 0.0 0.0 0.0 ... 0.0 0.0 0.0\n",
- " BackupBoiler(Heat) (duration) float64 584B nan 63.11 ... -8.993e-15, figure=Figure({\n",
- " 'data': [{'hovertemplate': 'variable=CHP(Heat)
duration=%{x}
value=%{y}',\n",
- " 'legendgroup': 'CHP(Heat)',\n",
- " 'line': {'color': '#636EFA', 'dash': 'solid'},\n",
- " 'marker': {'symbol': 'circle'},\n",
- " 'mode': 'lines',\n",
- " 'name': 'CHP(Heat)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'type': 'scatter',\n",
- " 'x': {'bdata': ('AAECAwQFBgcICQoLDA0ODxAREhMUFR' ... 'Q1Njc4OTo7PD0+P0BBQkNERUZHSA=='),\n",
- " 'dtype': 'i1'},\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('/////////39Gwcq9YjhUQOyIZIeOJ1' ... 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAA='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'variable=HeatPump(Heat)
duration=%{x}
value=%{y}',\n",
- " 'legendgroup': 'HeatPump(Heat)',\n",
- " 'line': {'color': '#EF553B', 'dash': 'solid'},\n",
- " 'marker': {'symbol': 'circle'},\n",
- " 'mode': 'lines',\n",
- " 'name': 'HeatPump(Heat)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'type': 'scatter',\n",
- " 'x': {'bdata': ('AAECAwQFBgcICQoLDA0ODxAREhMUFR' ... 'Q1Njc4OTo7PD0+P0BBQkNERUZHSA=='),\n",
- " 'dtype': 'i1'},\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('/////////38AAAAAAAAAAAAAAAAAAA' ... 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAA='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'variable=BackupBoiler(Heat)
duration=%{x}
value=%{y}',\n",
- " 'legendgroup': 'BackupBoiler(Heat)',\n",
- " 'line': {'color': '#00CC96', 'dash': 'solid'},\n",
- " 'marker': {'symbol': 'circle'},\n",
- " 'mode': 'lines',\n",
- " 'name': 'BackupBoiler(Heat)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'type': 'scatter',\n",
- " 'x': {'bdata': ('AAECAwQFBgcICQoLDA0ODxAREhMUFR' ... 'Q1Njc4OTo7PD0+P0BBQkNERUZHSA=='),\n",
- " 'dtype': 'i1'},\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('/////////38h4dgzOo5PQDMD0m1cz0' ... 'AAAACwvAAAAAAAALi8AAAAAABABL0='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'}],\n",
- " 'layout': {'legend': {'title': {'text': 'variable'}, 'tracegroupgap': 0},\n",
- " 'template': '...',\n",
- " 'title': {'text': 'Duration Curve'},\n",
- " 'xaxis': {'anchor': 'y', 'domain': [0.0, 1.0], 'title': {'text': 'Timesteps'}},\n",
- " 'yaxis': {'anchor': 'x', 'domain': [0.0, 1.0], 'title': {'text': 'value'}}}\n",
- "}))"
- ],
- "text/html": [
- ""
- ]
- },
- "execution_count": 19,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "execution_count": 19
+ ]
},
{
"cell_type": "markdown",
- "id": "46",
+ "id": "36",
"metadata": {},
"source": [
"## 5. Heatmaps\n",
@@ -3875,218 +408,40 @@
},
{
"cell_type": "code",
- "id": "47",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T14:13:17.799982Z",
- "start_time": "2025-12-13T14:13:17.729391Z"
- }
- },
+ "execution_count": null,
+ "id": "37",
+ "metadata": {},
+ "outputs": [],
"source": [
"# Auto-reshape based on data frequency\n",
"simple.statistics.plot.heatmap('Boiler(Heat)')"
- ],
- "outputs": [
- {
- "data": {
- "text/plain": [
- "PlotResult(data= Size: 2kB\n",
- "Dimensions: (timeframe: 8, timestep: 24)\n",
- "Coordinates:\n",
- " * timeframe (timeframe) object 64B '2024-01-15' '2024-01-16' ... '2024-01-22'\n",
- " * timestep (timestep) object 192B '00:00' '01:00' ... '22:00' '23:00'\n",
- "Data variables:\n",
- " value (timestep, timeframe) float64 2kB 32.48 42.84 47.28 ... 124.5 nan, figure=Figure({\n",
- " 'data': [{'coloraxis': 'coloraxis',\n",
- " 'hovertemplate': 'timeframe: %{x}
timestep: %{y}
Boiler(Heat)|flow_rate: %{z}',\n",
- " 'name': '0',\n",
- " 'type': 'heatmap',\n",
- " 'x': array(['2024-01-15', '2024-01-16', '2024-01-17', '2024-01-18', '2024-01-19',\n",
- " '2024-01-20', '2024-01-21', '2024-01-22'], dtype=object),\n",
- " 'xaxis': 'x',\n",
- " 'y': array(['00:00', '01:00', '02:00', '03:00', '04:00', '05:00', '06:00', '07:00',\n",
- " '08:00', '09:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00',\n",
- " '16:00', '17:00', '18:00', '19:00', '20:00', '21:00', '22:00', '23:00'],\n",
- " dtype=object),\n",
- " 'yaxis': 'y',\n",
- " 'z': {'bdata': ('5ZuWpeU9QED8nmEA1mtFQOR8bxYopE' ... '//////M0D1ufhH+R5fQAAAAAAAAPh/'),\n",
- " 'dtype': 'f8',\n",
- " 'shape': '24, 8'}}],\n",
- " 'layout': {'coloraxis': {'colorbar': {'title': {'text': 'Boiler(Heat)|flow_rate'}},\n",
- " 'colorscale': [[0.0, '#30123b'],\n",
- " [0.07142857142857142, '#4145ab'],\n",
- " [0.14285714285714285, '#4675ed'],\n",
- " [0.21428571428571427, '#39a2fc'],\n",
- " [0.2857142857142857, '#1bcfd4'],\n",
- " [0.35714285714285715, '#24eca6'],\n",
- " [0.42857142857142855, '#61fc6c'], [0.5,\n",
- " '#a4fc3b'], [0.5714285714285714,\n",
- " '#d1e834'], [0.6428571428571429,\n",
- " '#f3c63a'], [0.7142857142857143,\n",
- " '#fe9b2d'], [0.7857142857142857,\n",
- " '#f36315'], [0.8571428571428571,\n",
- " '#d93806'], [0.9285714285714286,\n",
- " '#b11901'], [1.0, '#7a0402']]},\n",
- " 'margin': {'t': 60},\n",
- " 'template': '...',\n",
- " 'xaxis': {'anchor': 'y', 'domain': [0.0, 1.0], 'title': {'text': 'timeframe'}},\n",
- " 'yaxis': {'anchor': 'x', 'autorange': 'reversed', 'domain': [0.0, 1.0], 'title': {'text': 'timestep'}}}\n",
- "}))"
- ],
- "text/html": [
- ""
- ]
- },
- "execution_count": 20,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "execution_count": 20
+ ]
},
{
"cell_type": "code",
- "id": "48",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T14:13:17.849042Z",
- "start_time": "2025-12-13T14:13:17.808302Z"
- }
- },
+ "execution_count": null,
+ "id": "38",
+ "metadata": {},
+ "outputs": [],
"source": [
"# Storage charge state heatmap\n",
"simple.statistics.plot.heatmap('ThermalStorage')"
- ],
- "outputs": [
- {
- "data": {
- "text/plain": [
- "PlotResult(data= Size: 2kB\n",
- "Dimensions: (timeframe: 8, timestep: 24)\n",
- "Coordinates:\n",
- " * timeframe (timeframe) object 64B '2024-01-15' '2024-01-16' ... '2024-01-22'\n",
- " * timestep (timestep) object 192B '00:00' '01:00' ... '22:00' '23:00'\n",
- "Data variables:\n",
- " value (timestep, timeframe) float64 2kB 250.0 1.379e-14 ... 102.5 nan, figure=Figure({\n",
- " 'data': [{'coloraxis': 'coloraxis',\n",
- " 'hovertemplate': ('timeframe: %{x}
timestep: %' ... 'rge_state: %{z}'),\n",
- " 'name': '0',\n",
- " 'type': 'heatmap',\n",
- " 'x': array(['2024-01-15', '2024-01-16', '2024-01-17', '2024-01-18', '2024-01-19',\n",
- " '2024-01-20', '2024-01-21', '2024-01-22'], dtype=object),\n",
- " 'xaxis': 'x',\n",
- " 'y': array(['00:00', '01:00', '02:00', '03:00', '04:00', '05:00', '06:00', '07:00',\n",
- " '08:00', '09:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00',\n",
- " '16:00', '17:00', '18:00', '19:00', '20:00', '21:00', '22:00', '23:00'],\n",
- " dtype=object),\n",
- " 'yaxis': 'y',\n",
- " 'z': {'bdata': ('AAAAAABAb0DkBdNVug0PPZGJ+Pa5Lj' ... 'AAAAAAAADw5ELUzaBZQAAAAAAAAPh/'),\n",
- " 'dtype': 'f8',\n",
- " 'shape': '24, 8'}}],\n",
- " 'layout': {'coloraxis': {'colorbar': {'title': {'text': 'ThermalStorage|charge_state'}},\n",
- " 'colorscale': [[0.0, '#30123b'],\n",
- " [0.07142857142857142, '#4145ab'],\n",
- " [0.14285714285714285, '#4675ed'],\n",
- " [0.21428571428571427, '#39a2fc'],\n",
- " [0.2857142857142857, '#1bcfd4'],\n",
- " [0.35714285714285715, '#24eca6'],\n",
- " [0.42857142857142855, '#61fc6c'], [0.5,\n",
- " '#a4fc3b'], [0.5714285714285714,\n",
- " '#d1e834'], [0.6428571428571429,\n",
- " '#f3c63a'], [0.7142857142857143,\n",
- " '#fe9b2d'], [0.7857142857142857,\n",
- " '#f36315'], [0.8571428571428571,\n",
- " '#d93806'], [0.9285714285714286,\n",
- " '#b11901'], [1.0, '#7a0402']]},\n",
- " 'margin': {'t': 60},\n",
- " 'template': '...',\n",
- " 'xaxis': {'anchor': 'y', 'domain': [0.0, 1.0], 'title': {'text': 'timeframe'}},\n",
- " 'yaxis': {'anchor': 'x', 'autorange': 'reversed', 'domain': [0.0, 1.0], 'title': {'text': 'timestep'}}}\n",
- "}))"
- ],
- "text/html": [
- ""
- ]
- },
- "execution_count": 21,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "execution_count": 21
+ ]
},
{
"cell_type": "code",
- "id": "49",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T14:13:17.900833Z",
- "start_time": "2025-12-13T14:13:17.858196Z"
- }
- },
+ "execution_count": null,
+ "id": "39",
+ "metadata": {},
+ "outputs": [],
"source": [
"# Custom colorscale\n",
"simple.statistics.plot.heatmap('Office(Heat)', color_continuous_scale='Blues', title='Heat Demand Pattern')"
- ],
- "outputs": [
- {
- "data": {
- "text/plain": [
- "PlotResult(data= Size: 2kB\n",
- "Dimensions: (timeframe: 8, timestep: 24)\n",
- "Coordinates:\n",
- " * timeframe (timeframe) object 64B '2024-01-15' '2024-01-16' ... '2024-01-22'\n",
- " * timestep (timestep) object 192B '00:00' '01:00' ... '22:00' '23:00'\n",
- "Data variables:\n",
- " value (timestep, timeframe) float64 2kB 32.48 27.28 31.72 ... 24.48 nan, figure=Figure({\n",
- " 'data': [{'coloraxis': 'coloraxis',\n",
- " 'hovertemplate': 'timeframe: %{x}
timestep: %{y}
Office(Heat)|flow_rate: %{z}',\n",
- " 'name': '0',\n",
- " 'type': 'heatmap',\n",
- " 'x': array(['2024-01-15', '2024-01-16', '2024-01-17', '2024-01-18', '2024-01-19',\n",
- " '2024-01-20', '2024-01-21', '2024-01-22'], dtype=object),\n",
- " 'xaxis': 'x',\n",
- " 'y': array(['00:00', '01:00', '02:00', '03:00', '04:00', '05:00', '06:00', '07:00',\n",
- " '08:00', '09:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00',\n",
- " '16:00', '17:00', '18:00', '19:00', '20:00', '21:00', '22:00', '23:00'],\n",
- " dtype=object),\n",
- " 'yaxis': 'y',\n",
- " 'z': {'bdata': ('5ZuWpeU9QEDqSDirMEc7QB8FVNfUtz' ... 'AAAAAANECu5+If5Xs4QAAAAAAAAPh/'),\n",
- " 'dtype': 'f8',\n",
- " 'shape': '24, 8'}}],\n",
- " 'layout': {'coloraxis': {'colorbar': {'title': {'text': 'Office(Heat)|flow_rate'}},\n",
- " 'colorscale': [[0.0, 'rgb(247,251,255)'], [0.125,\n",
- " 'rgb(222,235,247)'], [0.25,\n",
- " 'rgb(198,219,239)'], [0.375,\n",
- " 'rgb(158,202,225)'], [0.5,\n",
- " 'rgb(107,174,214)'], [0.625,\n",
- " 'rgb(66,146,198)'], [0.75,\n",
- " 'rgb(33,113,181)'], [0.875,\n",
- " 'rgb(8,81,156)'], [1.0,\n",
- " 'rgb(8,48,107)']]},\n",
- " 'template': '...',\n",
- " 'title': {'text': 'Heat Demand Pattern'},\n",
- " 'xaxis': {'anchor': 'y', 'domain': [0.0, 1.0], 'title': {'text': 'timeframe'}},\n",
- " 'yaxis': {'anchor': 'x', 'autorange': 'reversed', 'domain': [0.0, 1.0], 'title': {'text': 'timestep'}}}\n",
- "}))"
- ],
- "text/html": [
- ""
- ]
- },
- "execution_count": 22,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "execution_count": 22
+ ]
},
{
"cell_type": "markdown",
- "id": "50",
+ "id": "40",
"metadata": {},
"source": [
"## 6. Sankey Diagrams\n",
@@ -4096,7 +451,7 @@
},
{
"cell_type": "markdown",
- "id": "51",
+ "id": "41",
"metadata": {},
"source": [
"### 6.1 Flow Sankey\n",
@@ -4106,134 +461,28 @@
},
{
"cell_type": "code",
- "id": "52",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T14:13:17.930662Z",
- "start_time": "2025-12-13T14:13:17.908846Z"
- }
- },
+ "execution_count": null,
+ "id": "42",
+ "metadata": {},
+ "outputs": [],
"source": [
"simple.statistics.plot.sankey.flows()"
- ],
- "outputs": [
- {
- "data": {
- "text/plain": [
- "PlotResult(data= Size: 1kB\n",
- "Dimensions: (link: 6)\n",
- "Coordinates:\n",
- " * link (link) int64 48B 0 1 2 3 4 5\n",
- " source (link) \n",
- " "
- ]
- },
- "execution_count": 23,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "execution_count": 23
+ ]
},
{
"cell_type": "code",
- "id": "53",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T14:13:17.970954Z",
- "start_time": "2025-12-13T14:13:17.939809Z"
- }
- },
+ "execution_count": null,
+ "id": "43",
+ "metadata": {},
+ "outputs": [],
"source": [
"# Complex system with multiple carriers\n",
"complex_sys.statistics.plot.sankey.flows()"
- ],
- "outputs": [
- {
- "data": {
- "text/plain": [
- "PlotResult(data= Size: 3kB\n",
- "Dimensions: (link: 10)\n",
- "Coordinates:\n",
- " * link (link) int64 80B 0 1 2 3 4 5 6 7 8 9\n",
- " source (link) \n",
- " "
- ]
- },
- "execution_count": 24,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "execution_count": 24
+ ]
},
{
"cell_type": "markdown",
- "id": "54",
+ "id": "44",
"metadata": {},
"source": [
"### 6.2 Sizes Sankey\n",
@@ -4243,59 +492,17 @@
},
{
"cell_type": "code",
- "id": "55",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T14:13:17.993818Z",
- "start_time": "2025-12-13T14:13:17.977340Z"
- }
- },
+ "execution_count": null,
+ "id": "45",
+ "metadata": {},
+ "outputs": [],
"source": [
"multiperiod.statistics.plot.sankey.sizes()"
- ],
- "outputs": [
- {
- "data": {
- "text/plain": [
- "PlotResult(data= Size: 120B\n",
- "Dimensions: (link: 1)\n",
- "Coordinates:\n",
- " * link (link) int64 8B 0\n",
- " source (link) \n",
- " "
- ]
- },
- "execution_count": 25,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "execution_count": 25
+ ]
},
{
"cell_type": "markdown",
- "id": "56",
+ "id": "46",
"metadata": {},
"source": [
"### 6.3 Peak Flow Sankey\n",
@@ -4305,67 +512,17 @@
},
{
"cell_type": "code",
- "id": "57",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T14:13:18.029364Z",
- "start_time": "2025-12-13T14:13:18.001651Z"
- }
- },
+ "execution_count": null,
+ "id": "47",
+ "metadata": {},
+ "outputs": [],
"source": [
"simple.statistics.plot.sankey.peak_flow()"
- ],
- "outputs": [
- {
- "data": {
- "text/plain": [
- "PlotResult(data= Size: 1kB\n",
- "Dimensions: (link: 6)\n",
- "Coordinates:\n",
- " * link (link) int64 48B 0 1 2 3 4 5\n",
- " source (link) \n",
- " "
- ]
- },
- "execution_count": 26,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "execution_count": 26
+ ]
},
{
"cell_type": "markdown",
- "id": "58",
+ "id": "48",
"metadata": {},
"source": [
"### 6.4 Effects Sankey\n",
@@ -4375,109 +532,28 @@
},
{
"cell_type": "code",
- "id": "59",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T14:13:18.051137Z",
- "start_time": "2025-12-13T14:13:18.037718Z"
- }
- },
+ "execution_count": null,
+ "id": "49",
+ "metadata": {},
+ "outputs": [],
"source": [
"simple.statistics.plot.sankey.effects(select={'effect': 'costs'})"
- ],
- "outputs": [
- {
- "data": {
- "text/plain": [
- "PlotResult(data= Size: 184B\n",
- "Dimensions: (link: 1)\n",
- "Coordinates:\n",
- " * link (link) int64 8B 0\n",
- " source (link) \n",
- " "
- ]
- },
- "execution_count": 27,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "execution_count": 27
+ ]
},
{
"cell_type": "code",
- "id": "60",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T14:13:18.072870Z",
- "start_time": "2025-12-13T14:13:18.057665Z"
- }
- },
+ "execution_count": null,
+ "id": "50",
+ "metadata": {},
+ "outputs": [],
"source": [
"# CO2 allocation in complex system\n",
"complex_sys.statistics.plot.sankey.effects(select={'effect': 'CO2'})"
- ],
- "outputs": [
- {
- "data": {
- "text/plain": [
- "PlotResult(data= Size: 488B\n",
- "Dimensions: (link: 2)\n",
- "Coordinates:\n",
- " * link (link) int64 16B 0 1\n",
- " source (link) \n",
- " "
- ]
- },
- "execution_count": 28,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "execution_count": 28
+ ]
},
{
"cell_type": "markdown",
- "id": "61",
+ "id": "51",
"metadata": {},
"source": [
"### 6.5 Filtering with `select`\n",
@@ -4487,62 +563,18 @@
},
{
"cell_type": "code",
- "id": "62",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T14:13:18.102271Z",
- "start_time": "2025-12-13T14:13:18.087615Z"
- }
- },
+ "execution_count": null,
+ "id": "52",
+ "metadata": {},
+ "outputs": [],
"source": [
"# Only heat flows\n",
"complex_sys.statistics.plot.sankey.flows(select={'bus': 'Heat'})"
- ],
- "outputs": [
- {
- "data": {
- "text/plain": [
- "PlotResult(data= Size: 576B\n",
- "Dimensions: (link: 3)\n",
- "Coordinates:\n",
- " * link (link) int64 24B 0 1 2\n",
- " source (link) \n",
- " "
- ]
- },
- "execution_count": 29,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "execution_count": 29
+ ]
},
{
"cell_type": "markdown",
- "id": "63",
+ "id": "53",
"metadata": {},
"source": [
"## 7. Topology Visualization\n",
@@ -4552,7 +584,7 @@
},
{
"cell_type": "markdown",
- "id": "64",
+ "id": "54",
"metadata": {},
"source": [
"### 7.1 Topology Plot\n",
@@ -4562,317 +594,27 @@
},
{
"cell_type": "code",
- "id": "65",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T14:13:18.129663Z",
- "start_time": "2025-12-13T14:13:18.109005Z"
- }
- },
+ "execution_count": null,
+ "id": "55",
+ "metadata": {},
+ "outputs": [],
"source": [
"simple.topology.plot()"
- ],
- "outputs": [
- {
- "data": {
- "text/plain": [
- "PlotResult(data= Size: 1kB\n",
- "Dimensions: (link: 6)\n",
- "Coordinates:\n",
- " * link (link) ',\n",
- " 'label': [Boiler(Gas), Boiler(Heat), GasGrid(Gas),\n",
- " Office(Heat), ThermalStorage(Charge),\n",
- " ThermalStorage(Discharge)],\n",
- " 'source': [5, 4, 0, 1, 1, 2],\n",
- " 'target': [4, 1, 5, 3, 2, 1],\n",
- " 'value': [1, 1, 1, 1, 1, 1]},\n",
- " 'node': {'color': [#636EFA, #D62728, #00CC96, #AB63FA, #EF553B,\n",
- " #1F77B4],\n",
- " 'customdata': [Source('GasGrid')
outputs:
*\n",
- " Flow('GasGrid(Gas)', bus='Gas', size=500.0,\n",
- " effects_per_flow_hour={'costs': ~0.1}),\n",
- " Bus('Heat', carrier='heat')
inputs:
\n",
- " * Flow('Boiler(Heat)', bus='Heat',\n",
- " size=150.0)
*\n",
- " Flow('ThermalStorage(Discharge)', bus='Heat',\n",
- " size=100.0,\n",
- " status_parameters=StatusParameters())
\n",
- " outputs:
*\n",
- " Flow('ThermalStorage(Charge)', bus='Heat',\n",
- " size=100.0,\n",
- " status_parameters=StatusParameters())
\n",
- " * Flow('Office(Heat)', bus='Heat', size=1.0,\n",
- " fixed_relative_profile=20.0-92.3),\n",
- " Storage('ThermalStorage',\n",
- " capacity_in_flow_hours=500.0,\n",
- " initial_charge_state=250.0,\n",
- " minimal_final_charge_state=200.0,\n",
- " eta_charge=1.0, eta_discharge=1.0,\n",
- " relative_loss_per_hour=0.0)
inputs:
\n",
- " * Flow('ThermalStorage(Charge)', bus='Heat',\n",
- " size=100.0,\n",
- " status_parameters=StatusParameters())
\n",
- " outputs:
*\n",
- " Flow('ThermalStorage(Discharge)', bus='Heat',\n",
- " size=100.0,\n",
- " status_parameters=StatusParameters()),\n",
- " Sink('Office')
inputs:
*\n",
- " Flow('Office(Heat)', bus='Heat', size=1.0,\n",
- " fixed_relative_profile=20.0-92.3),\n",
- " Boiler('Boiler', thermal_efficiency=0.9,\n",
- " fuel_flow=Flow('Boiler(Gas)', bus='Gas'),\n",
- " thermal_flow=Flow('Boiler(Heat)', bus='Heat',\n",
- " size=150.0))
inputs:
*\n",
- " Flow('Boiler(Gas)', bus='Gas')
\n",
- " outputs:
* Flow('Boiler(Heat)',\n",
- " bus='Heat', size=150.0), Bus('Gas',\n",
- " carrier='gas')
inputs:
*\n",
- " Flow('GasGrid(Gas)', bus='Gas', size=500.0,\n",
- " effects_per_flow_hour={'costs': ~0.1})
\n",
- " outputs:
* Flow('Boiler(Gas)',\n",
- " bus='Gas')],\n",
- " 'hovertemplate': '%{customdata}',\n",
- " 'label': [GasGrid, Heat, ThermalStorage, Office, Boiler,\n",
- " Gas],\n",
- " 'line': {'color': 'black', 'width': 0.5},\n",
- " 'pad': 15,\n",
- " 'thickness': 20},\n",
- " 'type': 'sankey'}],\n",
- " 'layout': {'template': '...', 'title': {'text': 'Flow System Topology'}}\n",
- "}))"
- ],
- "text/html": [
- ""
- ]
- },
- "execution_count": 30,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "execution_count": 30
+ ]
},
{
"cell_type": "code",
- "id": "66",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T14:13:18.157403Z",
- "start_time": "2025-12-13T14:13:18.136357Z"
- }
- },
+ "execution_count": null,
+ "id": "56",
+ "metadata": {},
+ "outputs": [],
"source": [
"complex_sys.topology.plot(title='Complex System Topology')"
- ],
- "outputs": [
- {
- "data": {
- "text/plain": [
- "PlotResult(data= Size: 3kB\n",
- "Dimensions: (link: 14)\n",
- "Coordinates:\n",
- " * link (link) ',\n",
- " 'label': [BackupBoiler(Gas), BackupBoiler(Heat), CHP(El),\n",
- " CHP(Gas), CHP(Heat), ElDemand(El),\n",
- " ElectricityExport(El), ElectricityImport(El),\n",
- " GasGrid(Gas), HeatDemand(Heat), HeatPump(El),\n",
- " HeatPump(Heat), HeatStorage(Charge),\n",
- " HeatStorage(Discharge)],\n",
- " 'source': [11, 1, 9, 11, 9, 0, 0, 10, 2, 6, 0, 3, 6, 8],\n",
- " 'target': [1, 6, 0, 9, 6, 4, 5, 0, 11, 7, 3, 6, 8, 6],\n",
- " 'value': [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]},\n",
- " 'node': {'color': [#FECB52, #19D3F3, #636EFA, #FFA15A, #FF97FF,\n",
- " #00CC96, #D62728, #B6E880, #FF6692, #AB63FA,\n",
- " #EF553B, #1F77B4],\n",
- " 'customdata': [Bus('Electricity',\n",
- " carrier='electricity')
inputs:
*\n",
- " Flow('ElectricityImport(El)',\n",
- " bus='Electricity', size=100.0,\n",
- " effects_per_flow_hour={'costs': 0.1-0.2,\n",
- " 'CO2': 0.3-0.4})
* Flow('CHP(El)',\n",
- " bus='Electricity', size=80.0,\n",
- " status_parameters=StatusParameters())
\n",
- " outputs:
*\n",
- " Flow('ElectricityExport(El)',\n",
- " bus='Electricity', size=50.0,\n",
- " effects_per_flow_hour={'costs': -0.2--\n",
- " 0.1})
* Flow('HeatPump(El)',\n",
- " bus='Electricity')
*\n",
- " Flow('ElDemand(El)', bus='Electricity',\n",
- " size=1.0, fixed_relative_profile=10.0-42.3),\n",
- " Boiler('BackupBoiler',\n",
- " thermal_efficiency=0.9,\n",
- " fuel_flow=Flow('BackupBoiler(Gas)',\n",
- " bus='Gas'),\n",
- " thermal_flow=Flow('BackupBoiler(Heat)',\n",
- " bus='Heat', size=80.0))
inputs:
*\n",
- " Flow('BackupBoiler(Gas)', bus='Gas')
\n",
- " outputs:
* Flow('BackupBoiler(Heat)',\n",
- " bus='Heat', size=80.0), Source('GasGrid')
\n",
- " outputs:
* Flow('GasGrid(Gas)',\n",
- " bus='Gas', size=300.0,\n",
- " effects_per_flow_hour={'costs': 0.1, 'CO2':\n",
- " 0.2}), HeatPump('HeatPump', cop=3.5,\n",
- " electrical_flow=Flow('HeatPump(El)',\n",
- " bus='Electricity'),\n",
- " thermal_flow=Flow('HeatPump(Heat)',\n",
- " bus='Heat', size=InvestP...)
inputs:
\n",
- " * Flow('HeatPump(El)', bus='Electricity')
\n",
- " outputs:
* Flow('HeatPump(Heat)',\n",
- " bus='Heat',\n",
- " size=InvestParameters(minimum_size=0.0,\n",
- " maximum_size...), Sink('ElDemand')
\n",
- " inputs:
* Flow('ElDemand(El)',\n",
- " bus='Electricity', size=1.0,\n",
- " fixed_relative_profile=10.0-42.3),\n",
- " Sink('ElectricityExport')
inputs:
\n",
- " * Flow('ElectricityExport(El)',\n",
- " bus='Electricity', size=50.0,\n",
- " effects_per_flow_hour={'costs': -0.2--0.1}),\n",
- " Bus('Heat', carrier='heat')
inputs:
\n",
- " * Flow('CHP(Heat)', bus='Heat', size=85.0,\n",
- " status_parameters=StatusParameters())
\n",
- " * Flow('HeatPump(Heat)', bus='Heat',\n",
- " size=InvestParameters(minimum_size=0.0,\n",
- " maximum_size...)
*\n",
- " Flow('BackupBoiler(Heat)', bus='Heat',\n",
- " size=80.0)
*\n",
- " Flow('HeatStorage(Discharge)', bus='Heat',\n",
- " size=50.0,\n",
- " status_parameters=StatusParameters())
\n",
- " outputs:
* Flow('HeatStorage(Charge)',\n",
- " bus='Heat', size=50.0,\n",
- " status_parameters=StatusParameters())
\n",
- " * Flow('HeatDemand(Heat)', bus='Heat',\n",
- " size=1.0, fixed_relative_profile=20.0-87.5),\n",
- " Sink('HeatDemand')
inputs:
*\n",
- " Flow('HeatDemand(Heat)', bus='Heat',\n",
- " size=1.0, fixed_relative_profile=20.0-87.5),\n",
- " Storage('HeatStorage', capacity_in_flow_hours\n",
- " =InvestParameters(minimum_size=0.0,\n",
- " maximum_size..., eta_charge=1.0,\n",
- " eta_discharge=1.0)
inputs:
*\n",
- " Flow('HeatStorage(Charge)', bus='Heat',\n",
- " size=50.0,\n",
- " status_parameters=StatusParameters())
\n",
- " outputs:
*\n",
- " Flow('HeatStorage(Discharge)', bus='Heat',\n",
- " size=50.0,\n",
- " status_parameters=StatusParameters()),\n",
- " LinearConverter('CHP', status_parameters=Stat\n",
- " usParameters(effects_per_active_hour={'cost..\n",
- " ., piecewise_conversion=PiecewiseConversion(p\n",
- " iecewises={'Gas': Piecewis...)
\n",
- " inputs:
* Flow('CHP(Gas)', bus='Gas',\n",
- " size=200.0,\n",
- " status_parameters=StatusParameters())
\n",
- " outputs:
* Flow('CHP(El)',\n",
- " bus='Electricity', size=80.0,\n",
- " status_parameters=StatusParameters())
\n",
- " * Flow('CHP(Heat)', bus='Heat', size=85.0,\n",
- " status_parameters=StatusParameters()),\n",
- " Source('ElectricityImport')
outputs:
\n",
- " * Flow('ElectricityImport(El)',\n",
- " bus='Electricity', size=100.0,\n",
- " effects_per_flow_hour={'costs': 0.1-0.2,\n",
- " 'CO2': 0.3-0.4}), Bus('Gas',\n",
- " carrier='gas')
inputs:
*\n",
- " Flow('GasGrid(Gas)', bus='Gas', size=300.0,\n",
- " effects_per_flow_hour={'costs': 0.1, 'CO2':\n",
- " 0.2})
outputs:
* Flow('CHP(Gas)',\n",
- " bus='Gas', size=200.0,\n",
- " status_parameters=StatusParameters())
\n",
- " * Flow('BackupBoiler(Gas)', bus='Gas')],\n",
- " 'hovertemplate': '%{customdata}',\n",
- " 'label': [Electricity, BackupBoiler, GasGrid, HeatPump,\n",
- " ElDemand, ElectricityExport, Heat, HeatDemand,\n",
- " HeatStorage, CHP, ElectricityImport, Gas],\n",
- " 'line': {'color': 'black', 'width': 0.5},\n",
- " 'pad': 15,\n",
- " 'thickness': 20},\n",
- " 'type': 'sankey'}],\n",
- " 'layout': {'template': '...', 'title': {'text': 'Complex System Topology'}}\n",
- "}))"
- ],
- "text/html": [
- ""
- ]
- },
- "execution_count": 31,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "execution_count": 31
+ ]
},
{
"cell_type": "markdown",
- "id": "67",
+ "id": "57",
"metadata": {},
"source": [
"### 7.2 Topology Info\n",
@@ -4882,13 +624,10 @@
},
{
"cell_type": "code",
- "id": "68",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T14:13:18.168871Z",
- "start_time": "2025-12-13T14:13:18.165083Z"
- }
- },
+ "execution_count": null,
+ "id": "58",
+ "metadata": {},
+ "outputs": [],
"source": [
"nodes, edges = simple.topology.infos()\n",
"\n",
@@ -4899,35 +638,11 @@
"print('\\nEdges (flows):')\n",
"for label, info in edges.items():\n",
" print(f' {info[\"start\"]} -> {info[\"end\"]}: {label}')"
- ],
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Nodes:\n",
- " GasGrid: Component\n",
- " Boiler: Component\n",
- " ThermalStorage: Component\n",
- " Office: Component\n",
- " Gas: Bus\n",
- " Heat: Bus\n",
- "\n",
- "Edges (flows):\n",
- " Gas -> Boiler: Boiler(Gas)\n",
- " Boiler -> Heat: Boiler(Heat)\n",
- " GasGrid -> Gas: GasGrid(Gas)\n",
- " Heat -> Office: Office(Heat)\n",
- " Heat -> ThermalStorage: ThermalStorage(Charge)\n",
- " ThermalStorage -> Heat: ThermalStorage(Discharge)\n"
- ]
- }
- ],
- "execution_count": 32
+ ]
},
{
"cell_type": "markdown",
- "id": "69",
+ "id": "59",
"metadata": {},
"source": [
"## 8. Multi-Period/Scenario Data\n",
@@ -4937,1289 +652,53 @@
},
{
"cell_type": "code",
- "id": "70",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T14:13:18.194588Z",
- "start_time": "2025-12-13T14:13:18.191374Z"
- }
- },
+ "execution_count": null,
+ "id": "60",
+ "metadata": {},
+ "outputs": [],
"source": [
"print('Multiperiod system dimensions:')\n",
"print(f' Periods: {list(multiperiod.periods)}')\n",
"print(f' Scenarios: {list(multiperiod.scenarios)}')\n",
"print(f' Solution dims: {dict(multiperiod.solution.sizes)}')"
- ],
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Multiperiod system dimensions:\n",
- " Periods: [2024, 2025, 2026]\n",
- " Scenarios: ['high_demand', 'low_demand']\n",
- " Solution dims: {'scenario': 2, 'period': 3, 'time': 49}\n"
- ]
- }
- ],
- "execution_count": 33
+ ]
},
{
"cell_type": "code",
- "id": "71",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T14:13:18.325331Z",
- "start_time": "2025-12-13T14:13:18.199791Z"
- }
- },
+ "execution_count": null,
+ "id": "61",
+ "metadata": {},
+ "outputs": [],
"source": [
"# Balance plot with faceting by scenario\n",
"multiperiod.statistics.plot.balance('Heat')"
- ],
- "outputs": [
- {
- "data": {
- "text/plain": [
- "PlotResult(data= Size: 10kB\n",
- "Dimensions: (time: 49, period: 3, scenario: 2)\n",
- "Coordinates:\n",
- " * time (time) datetime64[ns] 392B 2024-01-01 ... 2024...\n",
- " * period (period) int64 24B 2024 2025 2026\n",
- " * scenario (scenario) scena' ... '}
value=%{y}'),\n",
- " 'legendgroup': 'Boiler(Heat)',\n",
- " 'marker': {'color': '#EF553B', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'Boiler(Heat)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-01T00:00:00.000000000', '2024-01-01T01:00:00.000000000',\n",
- " '2024-01-01T02:00:00.000000000', '2024-01-01T03:00:00.000000000',\n",
- " '2024-01-01T04:00:00.000000000', '2024-01-01T05:00:00.000000000',\n",
- " '2024-01-01T06:00:00.000000000', '2024-01-01T07:00:00.000000000',\n",
- " '2024-01-01T08:00:00.000000000', '2024-01-01T09:00:00.000000000',\n",
- " '2024-01-01T10:00:00.000000000', '2024-01-01T11:00:00.000000000',\n",
- " '2024-01-01T12:00:00.000000000', '2024-01-01T13:00:00.000000000',\n",
- " '2024-01-01T14:00:00.000000000', '2024-01-01T15:00:00.000000000',\n",
- " '2024-01-01T16:00:00.000000000', '2024-01-01T17:00:00.000000000',\n",
- " '2024-01-01T18:00:00.000000000', '2024-01-01T19:00:00.000000000',\n",
- " '2024-01-01T20:00:00.000000000', '2024-01-01T21:00:00.000000000',\n",
- " '2024-01-01T22:00:00.000000000', '2024-01-01T23:00:00.000000000',\n",
- " '2024-01-02T00:00:00.000000000', '2024-01-02T01:00:00.000000000',\n",
- " '2024-01-02T02:00:00.000000000', '2024-01-02T03:00:00.000000000',\n",
- " '2024-01-02T04:00:00.000000000', '2024-01-02T05:00:00.000000000',\n",
- " '2024-01-02T06:00:00.000000000', '2024-01-02T07:00:00.000000000',\n",
- " '2024-01-02T08:00:00.000000000', '2024-01-02T09:00:00.000000000',\n",
- " '2024-01-02T10:00:00.000000000', '2024-01-02T11:00:00.000000000',\n",
- " '2024-01-02T12:00:00.000000000', '2024-01-02T13:00:00.000000000',\n",
- " '2024-01-02T14:00:00.000000000', '2024-01-02T15:00:00.000000000',\n",
- " '2024-01-02T16:00:00.000000000', '2024-01-02T17:00:00.000000000',\n",
- " '2024-01-02T18:00:00.000000000', '2024-01-02T19:00:00.000000000',\n",
- " '2024-01-02T20:00:00.000000000', '2024-01-02T21:00:00.000000000',\n",
- " '2024-01-02T22:00:00.000000000', '2024-01-02T23:00:00.000000000',\n",
- " '2024-01-03T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x4',\n",
- " 'y': {'bdata': ('5JuWpeU9RsDiqeLGgqdEwF3XQkqFnk' ... 'rxMNlDwFu20eeOpEfAAAAAAAAA+P8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y4'},\n",
- " {'hovertemplate': ('variable=Boiler(Heat)
scena' ... '}
value=%{y}'),\n",
- " 'legendgroup': 'Boiler(Heat)',\n",
- " 'marker': {'color': '#EF553B', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'Boiler(Heat)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': False,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-01T00:00:00.000000000', '2024-01-01T01:00:00.000000000',\n",
- " '2024-01-01T02:00:00.000000000', '2024-01-01T03:00:00.000000000',\n",
- " '2024-01-01T04:00:00.000000000', '2024-01-01T05:00:00.000000000',\n",
- " '2024-01-01T06:00:00.000000000', '2024-01-01T07:00:00.000000000',\n",
- " '2024-01-01T08:00:00.000000000', '2024-01-01T09:00:00.000000000',\n",
- " '2024-01-01T10:00:00.000000000', '2024-01-01T11:00:00.000000000',\n",
- " '2024-01-01T12:00:00.000000000', '2024-01-01T13:00:00.000000000',\n",
- " '2024-01-01T14:00:00.000000000', '2024-01-01T15:00:00.000000000',\n",
- " '2024-01-01T16:00:00.000000000', '2024-01-01T17:00:00.000000000',\n",
- " '2024-01-01T18:00:00.000000000', '2024-01-01T19:00:00.000000000',\n",
- " '2024-01-01T20:00:00.000000000', '2024-01-01T21:00:00.000000000',\n",
- " '2024-01-01T22:00:00.000000000', '2024-01-01T23:00:00.000000000',\n",
- " '2024-01-02T00:00:00.000000000', '2024-01-02T01:00:00.000000000',\n",
- " '2024-01-02T02:00:00.000000000', '2024-01-02T03:00:00.000000000',\n",
- " '2024-01-02T04:00:00.000000000', '2024-01-02T05:00:00.000000000',\n",
- " '2024-01-02T06:00:00.000000000', '2024-01-02T07:00:00.000000000',\n",
- " '2024-01-02T08:00:00.000000000', '2024-01-02T09:00:00.000000000',\n",
- " '2024-01-02T10:00:00.000000000', '2024-01-02T11:00:00.000000000',\n",
- " '2024-01-02T12:00:00.000000000', '2024-01-02T13:00:00.000000000',\n",
- " '2024-01-02T14:00:00.000000000', '2024-01-02T15:00:00.000000000',\n",
- " '2024-01-02T16:00:00.000000000', '2024-01-02T17:00:00.000000000',\n",
- " '2024-01-02T18:00:00.000000000', '2024-01-02T19:00:00.000000000',\n",
- " '2024-01-02T20:00:00.000000000', '2024-01-02T21:00:00.000000000',\n",
- " '2024-01-02T22:00:00.000000000', '2024-01-02T23:00:00.000000000',\n",
- " '2024-01-03T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x5',\n",
- " 'y': {'bdata': ('5JuWpeU9RsDiqeLGgqdEwF3XQkqFnk' ... 'rxMNlDwFu20eeOpEfAAAAAAAAA+P8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y5'},\n",
- " {'hovertemplate': ('variable=Boiler(Heat)
scena' ... '}
value=%{y}'),\n",
- " 'legendgroup': 'Boiler(Heat)',\n",
- " 'marker': {'color': '#EF553B', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'Boiler(Heat)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': False,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-01T00:00:00.000000000', '2024-01-01T01:00:00.000000000',\n",
- " '2024-01-01T02:00:00.000000000', '2024-01-01T03:00:00.000000000',\n",
- " '2024-01-01T04:00:00.000000000', '2024-01-01T05:00:00.000000000',\n",
- " '2024-01-01T06:00:00.000000000', '2024-01-01T07:00:00.000000000',\n",
- " '2024-01-01T08:00:00.000000000', '2024-01-01T09:00:00.000000000',\n",
- " '2024-01-01T10:00:00.000000000', '2024-01-01T11:00:00.000000000',\n",
- " '2024-01-01T12:00:00.000000000', '2024-01-01T13:00:00.000000000',\n",
- " '2024-01-01T14:00:00.000000000', '2024-01-01T15:00:00.000000000',\n",
- " '2024-01-01T16:00:00.000000000', '2024-01-01T17:00:00.000000000',\n",
- " '2024-01-01T18:00:00.000000000', '2024-01-01T19:00:00.000000000',\n",
- " '2024-01-01T20:00:00.000000000', '2024-01-01T21:00:00.000000000',\n",
- " '2024-01-01T22:00:00.000000000', '2024-01-01T23:00:00.000000000',\n",
- " '2024-01-02T00:00:00.000000000', '2024-01-02T01:00:00.000000000',\n",
- " '2024-01-02T02:00:00.000000000', '2024-01-02T03:00:00.000000000',\n",
- " '2024-01-02T04:00:00.000000000', '2024-01-02T05:00:00.000000000',\n",
- " '2024-01-02T06:00:00.000000000', '2024-01-02T07:00:00.000000000',\n",
- " '2024-01-02T08:00:00.000000000', '2024-01-02T09:00:00.000000000',\n",
- " '2024-01-02T10:00:00.000000000', '2024-01-02T11:00:00.000000000',\n",
- " '2024-01-02T12:00:00.000000000', '2024-01-02T13:00:00.000000000',\n",
- " '2024-01-02T14:00:00.000000000', '2024-01-02T15:00:00.000000000',\n",
- " '2024-01-02T16:00:00.000000000', '2024-01-02T17:00:00.000000000',\n",
- " '2024-01-02T18:00:00.000000000', '2024-01-02T19:00:00.000000000',\n",
- " '2024-01-02T20:00:00.000000000', '2024-01-02T21:00:00.000000000',\n",
- " '2024-01-02T22:00:00.000000000', '2024-01-02T23:00:00.000000000',\n",
- " '2024-01-03T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x6',\n",
- " 'y': {'bdata': ('5JuWpeU9RsDiqeLGgqdEwFvXQkqFnk' ... 'rxMNlDwFy20eeOpEfAAAAAAAAA+P8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y6'},\n",
- " {'hovertemplate': ('variable=Boiler(Heat)
scena' ... '}
value=%{y}'),\n",
- " 'legendgroup': 'Boiler(Heat)',\n",
- " 'marker': {'color': '#EF553B', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'Boiler(Heat)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': False,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-01T00:00:00.000000000', '2024-01-01T01:00:00.000000000',\n",
- " '2024-01-01T02:00:00.000000000', '2024-01-01T03:00:00.000000000',\n",
- " '2024-01-01T04:00:00.000000000', '2024-01-01T05:00:00.000000000',\n",
- " '2024-01-01T06:00:00.000000000', '2024-01-01T07:00:00.000000000',\n",
- " '2024-01-01T08:00:00.000000000', '2024-01-01T09:00:00.000000000',\n",
- " '2024-01-01T10:00:00.000000000', '2024-01-01T11:00:00.000000000',\n",
- " '2024-01-01T12:00:00.000000000', '2024-01-01T13:00:00.000000000',\n",
- " '2024-01-01T14:00:00.000000000', '2024-01-01T15:00:00.000000000',\n",
- " '2024-01-01T16:00:00.000000000', '2024-01-01T17:00:00.000000000',\n",
- " '2024-01-01T18:00:00.000000000', '2024-01-01T19:00:00.000000000',\n",
- " '2024-01-01T20:00:00.000000000', '2024-01-01T21:00:00.000000000',\n",
- " '2024-01-01T22:00:00.000000000', '2024-01-01T23:00:00.000000000',\n",
- " '2024-01-02T00:00:00.000000000', '2024-01-02T01:00:00.000000000',\n",
- " '2024-01-02T02:00:00.000000000', '2024-01-02T03:00:00.000000000',\n",
- " '2024-01-02T04:00:00.000000000', '2024-01-02T05:00:00.000000000',\n",
- " '2024-01-02T06:00:00.000000000', '2024-01-02T07:00:00.000000000',\n",
- " '2024-01-02T08:00:00.000000000', '2024-01-02T09:00:00.000000000',\n",
- " '2024-01-02T10:00:00.000000000', '2024-01-02T11:00:00.000000000',\n",
- " '2024-01-02T12:00:00.000000000', '2024-01-02T13:00:00.000000000',\n",
- " '2024-01-02T14:00:00.000000000', '2024-01-02T15:00:00.000000000',\n",
- " '2024-01-02T16:00:00.000000000', '2024-01-02T17:00:00.000000000',\n",
- " '2024-01-02T18:00:00.000000000', '2024-01-02T19:00:00.000000000',\n",
- " '2024-01-02T20:00:00.000000000', '2024-01-02T21:00:00.000000000',\n",
- " '2024-01-02T22:00:00.000000000', '2024-01-02T23:00:00.000000000',\n",
- " '2024-01-03T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('EgPMGubHPsD7i30z/HU4wBwgRYDluD' ... 'Vm3JI8wDayyUAFXDnAAAAAAAAA+P8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': ('variable=Boiler(Heat)
scena' ... '}
value=%{y}'),\n",
- " 'legendgroup': 'Boiler(Heat)',\n",
- " 'marker': {'color': '#EF553B', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'Boiler(Heat)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': False,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-01T00:00:00.000000000', '2024-01-01T01:00:00.000000000',\n",
- " '2024-01-01T02:00:00.000000000', '2024-01-01T03:00:00.000000000',\n",
- " '2024-01-01T04:00:00.000000000', '2024-01-01T05:00:00.000000000',\n",
- " '2024-01-01T06:00:00.000000000', '2024-01-01T07:00:00.000000000',\n",
- " '2024-01-01T08:00:00.000000000', '2024-01-01T09:00:00.000000000',\n",
- " '2024-01-01T10:00:00.000000000', '2024-01-01T11:00:00.000000000',\n",
- " '2024-01-01T12:00:00.000000000', '2024-01-01T13:00:00.000000000',\n",
- " '2024-01-01T14:00:00.000000000', '2024-01-01T15:00:00.000000000',\n",
- " '2024-01-01T16:00:00.000000000', '2024-01-01T17:00:00.000000000',\n",
- " '2024-01-01T18:00:00.000000000', '2024-01-01T19:00:00.000000000',\n",
- " '2024-01-01T20:00:00.000000000', '2024-01-01T21:00:00.000000000',\n",
- " '2024-01-01T22:00:00.000000000', '2024-01-01T23:00:00.000000000',\n",
- " '2024-01-02T00:00:00.000000000', '2024-01-02T01:00:00.000000000',\n",
- " '2024-01-02T02:00:00.000000000', '2024-01-02T03:00:00.000000000',\n",
- " '2024-01-02T04:00:00.000000000', '2024-01-02T05:00:00.000000000',\n",
- " '2024-01-02T06:00:00.000000000', '2024-01-02T07:00:00.000000000',\n",
- " '2024-01-02T08:00:00.000000000', '2024-01-02T09:00:00.000000000',\n",
- " '2024-01-02T10:00:00.000000000', '2024-01-02T11:00:00.000000000',\n",
- " '2024-01-02T12:00:00.000000000', '2024-01-02T13:00:00.000000000',\n",
- " '2024-01-02T14:00:00.000000000', '2024-01-02T15:00:00.000000000',\n",
- " '2024-01-02T16:00:00.000000000', '2024-01-02T17:00:00.000000000',\n",
- " '2024-01-02T18:00:00.000000000', '2024-01-02T19:00:00.000000000',\n",
- " '2024-01-02T20:00:00.000000000', '2024-01-02T21:00:00.000000000',\n",
- " '2024-01-02T22:00:00.000000000', '2024-01-02T23:00:00.000000000',\n",
- " '2024-01-03T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x2',\n",
- " 'y': {'bdata': ('EgPMGubHPsD7i30z/HU4wBwgRYDluD' ... 'Vm3JI8wDayyUAFXDnAAAAAAAAA+P8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y2'},\n",
- " {'hovertemplate': ('variable=Boiler(Heat)
scena' ... '}
value=%{y}'),\n",
- " 'legendgroup': 'Boiler(Heat)',\n",
- " 'marker': {'color': '#EF553B', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'Boiler(Heat)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': False,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-01T00:00:00.000000000', '2024-01-01T01:00:00.000000000',\n",
- " '2024-01-01T02:00:00.000000000', '2024-01-01T03:00:00.000000000',\n",
- " '2024-01-01T04:00:00.000000000', '2024-01-01T05:00:00.000000000',\n",
- " '2024-01-01T06:00:00.000000000', '2024-01-01T07:00:00.000000000',\n",
- " '2024-01-01T08:00:00.000000000', '2024-01-01T09:00:00.000000000',\n",
- " '2024-01-01T10:00:00.000000000', '2024-01-01T11:00:00.000000000',\n",
- " '2024-01-01T12:00:00.000000000', '2024-01-01T13:00:00.000000000',\n",
- " '2024-01-01T14:00:00.000000000', '2024-01-01T15:00:00.000000000',\n",
- " '2024-01-01T16:00:00.000000000', '2024-01-01T17:00:00.000000000',\n",
- " '2024-01-01T18:00:00.000000000', '2024-01-01T19:00:00.000000000',\n",
- " '2024-01-01T20:00:00.000000000', '2024-01-01T21:00:00.000000000',\n",
- " '2024-01-01T22:00:00.000000000', '2024-01-01T23:00:00.000000000',\n",
- " '2024-01-02T00:00:00.000000000', '2024-01-02T01:00:00.000000000',\n",
- " '2024-01-02T02:00:00.000000000', '2024-01-02T03:00:00.000000000',\n",
- " '2024-01-02T04:00:00.000000000', '2024-01-02T05:00:00.000000000',\n",
- " '2024-01-02T06:00:00.000000000', '2024-01-02T07:00:00.000000000',\n",
- " '2024-01-02T08:00:00.000000000', '2024-01-02T09:00:00.000000000',\n",
- " '2024-01-02T10:00:00.000000000', '2024-01-02T11:00:00.000000000',\n",
- " '2024-01-02T12:00:00.000000000', '2024-01-02T13:00:00.000000000',\n",
- " '2024-01-02T14:00:00.000000000', '2024-01-02T15:00:00.000000000',\n",
- " '2024-01-02T16:00:00.000000000', '2024-01-02T17:00:00.000000000',\n",
- " '2024-01-02T18:00:00.000000000', '2024-01-02T19:00:00.000000000',\n",
- " '2024-01-02T20:00:00.000000000', '2024-01-02T21:00:00.000000000',\n",
- " '2024-01-02T22:00:00.000000000', '2024-01-02T23:00:00.000000000',\n",
- " '2024-01-03T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x3',\n",
- " 'y': {'bdata': ('EgPMGubHPsD7i30z/HU4wBwgRYDluD' ... 'Vm3JI8wDayyUAFXDnAAAAAAAAA+P8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y3'},\n",
- " {'hovertemplate': ('variable=ThermalStorage(Discha' ... '}
value=%{y}'),\n",
- " 'legendgroup': 'ThermalStorage(Discharge)',\n",
- " 'marker': {'color': '#00CC96', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'ThermalStorage(Discharge)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-01T00:00:00.000000000', '2024-01-01T01:00:00.000000000',\n",
- " '2024-01-01T02:00:00.000000000', '2024-01-01T03:00:00.000000000',\n",
- " '2024-01-01T04:00:00.000000000', '2024-01-01T05:00:00.000000000',\n",
- " '2024-01-01T06:00:00.000000000', '2024-01-01T07:00:00.000000000',\n",
- " '2024-01-01T08:00:00.000000000', '2024-01-01T09:00:00.000000000',\n",
- " '2024-01-01T10:00:00.000000000', '2024-01-01T11:00:00.000000000',\n",
- " '2024-01-01T12:00:00.000000000', '2024-01-01T13:00:00.000000000',\n",
- " '2024-01-01T14:00:00.000000000', '2024-01-01T15:00:00.000000000',\n",
- " '2024-01-01T16:00:00.000000000', '2024-01-01T17:00:00.000000000',\n",
- " '2024-01-01T18:00:00.000000000', '2024-01-01T19:00:00.000000000',\n",
- " '2024-01-01T20:00:00.000000000', '2024-01-01T21:00:00.000000000',\n",
- " '2024-01-01T22:00:00.000000000', '2024-01-01T23:00:00.000000000',\n",
- " '2024-01-02T00:00:00.000000000', '2024-01-02T01:00:00.000000000',\n",
- " '2024-01-02T02:00:00.000000000', '2024-01-02T03:00:00.000000000',\n",
- " '2024-01-02T04:00:00.000000000', '2024-01-02T05:00:00.000000000',\n",
- " '2024-01-02T06:00:00.000000000', '2024-01-02T07:00:00.000000000',\n",
- " '2024-01-02T08:00:00.000000000', '2024-01-02T09:00:00.000000000',\n",
- " '2024-01-02T10:00:00.000000000', '2024-01-02T11:00:00.000000000',\n",
- " '2024-01-02T12:00:00.000000000', '2024-01-02T13:00:00.000000000',\n",
- " '2024-01-02T14:00:00.000000000', '2024-01-02T15:00:00.000000000',\n",
- " '2024-01-02T16:00:00.000000000', '2024-01-02T17:00:00.000000000',\n",
- " '2024-01-02T18:00:00.000000000', '2024-01-02T19:00:00.000000000',\n",
- " '2024-01-02T20:00:00.000000000', '2024-01-02T21:00:00.000000000',\n",
- " '2024-01-02T22:00:00.000000000', '2024-01-02T23:00:00.000000000',\n",
- " '2024-01-03T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x4',\n",
- " 'y': {'bdata': ('iAK1fqVASD1j/UqBWr9nPQo++OCDj2' ... 'jgg89hPWP9SoFav2g9AAAAAAAA+P8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y4'},\n",
- " {'hovertemplate': ('variable=ThermalStorage(Discha' ... '}
value=%{y}'),\n",
- " 'legendgroup': 'ThermalStorage(Discharge)',\n",
- " 'marker': {'color': '#00CC96', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'ThermalStorage(Discharge)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': False,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-01T00:00:00.000000000', '2024-01-01T01:00:00.000000000',\n",
- " '2024-01-01T02:00:00.000000000', '2024-01-01T03:00:00.000000000',\n",
- " '2024-01-01T04:00:00.000000000', '2024-01-01T05:00:00.000000000',\n",
- " '2024-01-01T06:00:00.000000000', '2024-01-01T07:00:00.000000000',\n",
- " '2024-01-01T08:00:00.000000000', '2024-01-01T09:00:00.000000000',\n",
- " '2024-01-01T10:00:00.000000000', '2024-01-01T11:00:00.000000000',\n",
- " '2024-01-01T12:00:00.000000000', '2024-01-01T13:00:00.000000000',\n",
- " '2024-01-01T14:00:00.000000000', '2024-01-01T15:00:00.000000000',\n",
- " '2024-01-01T16:00:00.000000000', '2024-01-01T17:00:00.000000000',\n",
- " '2024-01-01T18:00:00.000000000', '2024-01-01T19:00:00.000000000',\n",
- " '2024-01-01T20:00:00.000000000', '2024-01-01T21:00:00.000000000',\n",
- " '2024-01-01T22:00:00.000000000', '2024-01-01T23:00:00.000000000',\n",
- " '2024-01-02T00:00:00.000000000', '2024-01-02T01:00:00.000000000',\n",
- " '2024-01-02T02:00:00.000000000', '2024-01-02T03:00:00.000000000',\n",
- " '2024-01-02T04:00:00.000000000', '2024-01-02T05:00:00.000000000',\n",
- " '2024-01-02T06:00:00.000000000', '2024-01-02T07:00:00.000000000',\n",
- " '2024-01-02T08:00:00.000000000', '2024-01-02T09:00:00.000000000',\n",
- " '2024-01-02T10:00:00.000000000', '2024-01-02T11:00:00.000000000',\n",
- " '2024-01-02T12:00:00.000000000', '2024-01-02T13:00:00.000000000',\n",
- " '2024-01-02T14:00:00.000000000', '2024-01-02T15:00:00.000000000',\n",
- " '2024-01-02T16:00:00.000000000', '2024-01-02T17:00:00.000000000',\n",
- " '2024-01-02T18:00:00.000000000', '2024-01-02T19:00:00.000000000',\n",
- " '2024-01-02T20:00:00.000000000', '2024-01-02T21:00:00.000000000',\n",
- " '2024-01-02T22:00:00.000000000', '2024-01-02T23:00:00.000000000',\n",
- " '2024-01-03T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x5',\n",
- " 'y': {'bdata': ('iAK1fqVASD1j/UqBWr9nPQo++OCDj2' ... 'qBWr9oPWP9SoFav2g9AAAAAAAA+P8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y5'},\n",
- " {'hovertemplate': ('variable=ThermalStorage(Discha' ... '}
value=%{y}'),\n",
- " 'legendgroup': 'ThermalStorage(Discharge)',\n",
- " 'marker': {'color': '#00CC96', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'ThermalStorage(Discharge)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': False,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-01T00:00:00.000000000', '2024-01-01T01:00:00.000000000',\n",
- " '2024-01-01T02:00:00.000000000', '2024-01-01T03:00:00.000000000',\n",
- " '2024-01-01T04:00:00.000000000', '2024-01-01T05:00:00.000000000',\n",
- " '2024-01-01T06:00:00.000000000', '2024-01-01T07:00:00.000000000',\n",
- " '2024-01-01T08:00:00.000000000', '2024-01-01T09:00:00.000000000',\n",
- " '2024-01-01T10:00:00.000000000', '2024-01-01T11:00:00.000000000',\n",
- " '2024-01-01T12:00:00.000000000', '2024-01-01T13:00:00.000000000',\n",
- " '2024-01-01T14:00:00.000000000', '2024-01-01T15:00:00.000000000',\n",
- " '2024-01-01T16:00:00.000000000', '2024-01-01T17:00:00.000000000',\n",
- " '2024-01-01T18:00:00.000000000', '2024-01-01T19:00:00.000000000',\n",
- " '2024-01-01T20:00:00.000000000', '2024-01-01T21:00:00.000000000',\n",
- " '2024-01-01T22:00:00.000000000', '2024-01-01T23:00:00.000000000',\n",
- " '2024-01-02T00:00:00.000000000', '2024-01-02T01:00:00.000000000',\n",
- " '2024-01-02T02:00:00.000000000', '2024-01-02T03:00:00.000000000',\n",
- " '2024-01-02T04:00:00.000000000', '2024-01-02T05:00:00.000000000',\n",
- " '2024-01-02T06:00:00.000000000', '2024-01-02T07:00:00.000000000',\n",
- " '2024-01-02T08:00:00.000000000', '2024-01-02T09:00:00.000000000',\n",
- " '2024-01-02T10:00:00.000000000', '2024-01-02T11:00:00.000000000',\n",
- " '2024-01-02T12:00:00.000000000', '2024-01-02T13:00:00.000000000',\n",
- " '2024-01-02T14:00:00.000000000', '2024-01-02T15:00:00.000000000',\n",
- " '2024-01-02T16:00:00.000000000', '2024-01-02T17:00:00.000000000',\n",
- " '2024-01-02T18:00:00.000000000', '2024-01-02T19:00:00.000000000',\n",
- " '2024-01-02T20:00:00.000000000', '2024-01-02T21:00:00.000000000',\n",
- " '2024-01-02T22:00:00.000000000', '2024-01-02T23:00:00.000000000',\n",
- " '2024-01-03T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x6',\n",
- " 'y': {'bdata': ('iAK1fqVASD1j/UqBWr9oPby8nSExr2' ... 'qBWr9oPQo++OCDz2E9AAAAAAAA+P8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y6'},\n",
- " {'hovertemplate': ('variable=ThermalStorage(Discha' ... '}
value=%{y}'),\n",
- " 'legendgroup': 'ThermalStorage(Discharge)',\n",
- " 'marker': {'color': '#00CC96', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'ThermalStorage(Discharge)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': False,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-01T00:00:00.000000000', '2024-01-01T01:00:00.000000000',\n",
- " '2024-01-01T02:00:00.000000000', '2024-01-01T03:00:00.000000000',\n",
- " '2024-01-01T04:00:00.000000000', '2024-01-01T05:00:00.000000000',\n",
- " '2024-01-01T06:00:00.000000000', '2024-01-01T07:00:00.000000000',\n",
- " '2024-01-01T08:00:00.000000000', '2024-01-01T09:00:00.000000000',\n",
- " '2024-01-01T10:00:00.000000000', '2024-01-01T11:00:00.000000000',\n",
- " '2024-01-01T12:00:00.000000000', '2024-01-01T13:00:00.000000000',\n",
- " '2024-01-01T14:00:00.000000000', '2024-01-01T15:00:00.000000000',\n",
- " '2024-01-01T16:00:00.000000000', '2024-01-01T17:00:00.000000000',\n",
- " '2024-01-01T18:00:00.000000000', '2024-01-01T19:00:00.000000000',\n",
- " '2024-01-01T20:00:00.000000000', '2024-01-01T21:00:00.000000000',\n",
- " '2024-01-01T22:00:00.000000000', '2024-01-01T23:00:00.000000000',\n",
- " '2024-01-02T00:00:00.000000000', '2024-01-02T01:00:00.000000000',\n",
- " '2024-01-02T02:00:00.000000000', '2024-01-02T03:00:00.000000000',\n",
- " '2024-01-02T04:00:00.000000000', '2024-01-02T05:00:00.000000000',\n",
- " '2024-01-02T06:00:00.000000000', '2024-01-02T07:00:00.000000000',\n",
- " '2024-01-02T08:00:00.000000000', '2024-01-02T09:00:00.000000000',\n",
- " '2024-01-02T10:00:00.000000000', '2024-01-02T11:00:00.000000000',\n",
- " '2024-01-02T12:00:00.000000000', '2024-01-02T13:00:00.000000000',\n",
- " '2024-01-02T14:00:00.000000000', '2024-01-02T15:00:00.000000000',\n",
- " '2024-01-02T16:00:00.000000000', '2024-01-02T17:00:00.000000000',\n",
- " '2024-01-02T18:00:00.000000000', '2024-01-02T19:00:00.000000000',\n",
- " '2024-01-02T20:00:00.000000000', '2024-01-02T21:00:00.000000000',\n",
- " '2024-01-02T22:00:00.000000000', '2024-01-02T23:00:00.000000000',\n",
- " '2024-01-03T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('AAAAAAAAAIC3nSExb8dkPbedITFvx2' ... 'Exb8dkPbedITFvx2Q9AAAAAAAA+P8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': ('variable=ThermalStorage(Discha' ... '}
value=%{y}'),\n",
- " 'legendgroup': 'ThermalStorage(Discharge)',\n",
- " 'marker': {'color': '#00CC96', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'ThermalStorage(Discharge)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': False,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-01T00:00:00.000000000', '2024-01-01T01:00:00.000000000',\n",
- " '2024-01-01T02:00:00.000000000', '2024-01-01T03:00:00.000000000',\n",
- " '2024-01-01T04:00:00.000000000', '2024-01-01T05:00:00.000000000',\n",
- " '2024-01-01T06:00:00.000000000', '2024-01-01T07:00:00.000000000',\n",
- " '2024-01-01T08:00:00.000000000', '2024-01-01T09:00:00.000000000',\n",
- " '2024-01-01T10:00:00.000000000', '2024-01-01T11:00:00.000000000',\n",
- " '2024-01-01T12:00:00.000000000', '2024-01-01T13:00:00.000000000',\n",
- " '2024-01-01T14:00:00.000000000', '2024-01-01T15:00:00.000000000',\n",
- " '2024-01-01T16:00:00.000000000', '2024-01-01T17:00:00.000000000',\n",
- " '2024-01-01T18:00:00.000000000', '2024-01-01T19:00:00.000000000',\n",
- " '2024-01-01T20:00:00.000000000', '2024-01-01T21:00:00.000000000',\n",
- " '2024-01-01T22:00:00.000000000', '2024-01-01T23:00:00.000000000',\n",
- " '2024-01-02T00:00:00.000000000', '2024-01-02T01:00:00.000000000',\n",
- " '2024-01-02T02:00:00.000000000', '2024-01-02T03:00:00.000000000',\n",
- " '2024-01-02T04:00:00.000000000', '2024-01-02T05:00:00.000000000',\n",
- " '2024-01-02T06:00:00.000000000', '2024-01-02T07:00:00.000000000',\n",
- " '2024-01-02T08:00:00.000000000', '2024-01-02T09:00:00.000000000',\n",
- " '2024-01-02T10:00:00.000000000', '2024-01-02T11:00:00.000000000',\n",
- " '2024-01-02T12:00:00.000000000', '2024-01-02T13:00:00.000000000',\n",
- " '2024-01-02T14:00:00.000000000', '2024-01-02T15:00:00.000000000',\n",
- " '2024-01-02T16:00:00.000000000', '2024-01-02T17:00:00.000000000',\n",
- " '2024-01-02T18:00:00.000000000', '2024-01-02T19:00:00.000000000',\n",
- " '2024-01-02T20:00:00.000000000', '2024-01-02T21:00:00.000000000',\n",
- " '2024-01-02T22:00:00.000000000', '2024-01-02T23:00:00.000000000',\n",
- " '2024-01-03T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x2',\n",
- " 'y': {'bdata': ('AAAAAAAAAIC3nSExb8dkPbedITFvx2' ... 'Exb8dkPbedITFvx2Q9AAAAAAAA+P8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y2'},\n",
- " {'hovertemplate': ('variable=ThermalStorage(Discha' ... '}
value=%{y}'),\n",
- " 'legendgroup': 'ThermalStorage(Discharge)',\n",
- " 'marker': {'color': '#00CC96', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'ThermalStorage(Discharge)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': False,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-01T00:00:00.000000000', '2024-01-01T01:00:00.000000000',\n",
- " '2024-01-01T02:00:00.000000000', '2024-01-01T03:00:00.000000000',\n",
- " '2024-01-01T04:00:00.000000000', '2024-01-01T05:00:00.000000000',\n",
- " '2024-01-01T06:00:00.000000000', '2024-01-01T07:00:00.000000000',\n",
- " '2024-01-01T08:00:00.000000000', '2024-01-01T09:00:00.000000000',\n",
- " '2024-01-01T10:00:00.000000000', '2024-01-01T11:00:00.000000000',\n",
- " '2024-01-01T12:00:00.000000000', '2024-01-01T13:00:00.000000000',\n",
- " '2024-01-01T14:00:00.000000000', '2024-01-01T15:00:00.000000000',\n",
- " '2024-01-01T16:00:00.000000000', '2024-01-01T17:00:00.000000000',\n",
- " '2024-01-01T18:00:00.000000000', '2024-01-01T19:00:00.000000000',\n",
- " '2024-01-01T20:00:00.000000000', '2024-01-01T21:00:00.000000000',\n",
- " '2024-01-01T22:00:00.000000000', '2024-01-01T23:00:00.000000000',\n",
- " '2024-01-02T00:00:00.000000000', '2024-01-02T01:00:00.000000000',\n",
- " '2024-01-02T02:00:00.000000000', '2024-01-02T03:00:00.000000000',\n",
- " '2024-01-02T04:00:00.000000000', '2024-01-02T05:00:00.000000000',\n",
- " '2024-01-02T06:00:00.000000000', '2024-01-02T07:00:00.000000000',\n",
- " '2024-01-02T08:00:00.000000000', '2024-01-02T09:00:00.000000000',\n",
- " '2024-01-02T10:00:00.000000000', '2024-01-02T11:00:00.000000000',\n",
- " '2024-01-02T12:00:00.000000000', '2024-01-02T13:00:00.000000000',\n",
- " '2024-01-02T14:00:00.000000000', '2024-01-02T15:00:00.000000000',\n",
- " '2024-01-02T16:00:00.000000000', '2024-01-02T17:00:00.000000000',\n",
- " '2024-01-02T18:00:00.000000000', '2024-01-02T19:00:00.000000000',\n",
- " '2024-01-02T20:00:00.000000000', '2024-01-02T21:00:00.000000000',\n",
- " '2024-01-02T22:00:00.000000000', '2024-01-02T23:00:00.000000000',\n",
- " '2024-01-03T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x3',\n",
- " 'y': {'bdata': ('AAAAAAAAAIC3nSExb8dkPbedITFvx2' ... 'Exb8dkPbedITFvp2U9AAAAAAAA+P8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y3'},\n",
- " {'hovertemplate': ('variable=ThermalStorage(Charge' ... '}
value=%{y}'),\n",
- " 'legendgroup': 'ThermalStorage(Charge)',\n",
- " 'marker': {'color': '#00CC96', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'ThermalStorage(Charge)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-01T00:00:00.000000000', '2024-01-01T01:00:00.000000000',\n",
- " '2024-01-01T02:00:00.000000000', '2024-01-01T03:00:00.000000000',\n",
- " '2024-01-01T04:00:00.000000000', '2024-01-01T05:00:00.000000000',\n",
- " '2024-01-01T06:00:00.000000000', '2024-01-01T07:00:00.000000000',\n",
- " '2024-01-01T08:00:00.000000000', '2024-01-01T09:00:00.000000000',\n",
- " '2024-01-01T10:00:00.000000000', '2024-01-01T11:00:00.000000000',\n",
- " '2024-01-01T12:00:00.000000000', '2024-01-01T13:00:00.000000000',\n",
- " '2024-01-01T14:00:00.000000000', '2024-01-01T15:00:00.000000000',\n",
- " '2024-01-01T16:00:00.000000000', '2024-01-01T17:00:00.000000000',\n",
- " '2024-01-01T18:00:00.000000000', '2024-01-01T19:00:00.000000000',\n",
- " '2024-01-01T20:00:00.000000000', '2024-01-01T21:00:00.000000000',\n",
- " '2024-01-01T22:00:00.000000000', '2024-01-01T23:00:00.000000000',\n",
- " '2024-01-02T00:00:00.000000000', '2024-01-02T01:00:00.000000000',\n",
- " '2024-01-02T02:00:00.000000000', '2024-01-02T03:00:00.000000000',\n",
- " '2024-01-02T04:00:00.000000000', '2024-01-02T05:00:00.000000000',\n",
- " '2024-01-02T06:00:00.000000000', '2024-01-02T07:00:00.000000000',\n",
- " '2024-01-02T08:00:00.000000000', '2024-01-02T09:00:00.000000000',\n",
- " '2024-01-02T10:00:00.000000000', '2024-01-02T11:00:00.000000000',\n",
- " '2024-01-02T12:00:00.000000000', '2024-01-02T13:00:00.000000000',\n",
- " '2024-01-02T14:00:00.000000000', '2024-01-02T15:00:00.000000000',\n",
- " '2024-01-02T16:00:00.000000000', '2024-01-02T17:00:00.000000000',\n",
- " '2024-01-02T18:00:00.000000000', '2024-01-02T19:00:00.000000000',\n",
- " '2024-01-02T20:00:00.000000000', '2024-01-02T21:00:00.000000000',\n",
- " '2024-01-02T22:00:00.000000000', '2024-01-02T23:00:00.000000000',\n",
- " '2024-01-03T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x4',\n",
- " 'y': {'bdata': ('iAK1fqVASb1j/UqBWr9ovQo++OCDT2' ... 'jgg49ivWP9SoFav2m9AAAAAAAA+H8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y4'},\n",
- " {'hovertemplate': ('variable=ThermalStorage(Charge' ... '}
value=%{y}'),\n",
- " 'legendgroup': 'ThermalStorage(Charge)',\n",
- " 'marker': {'color': '#00CC96', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'ThermalStorage(Charge)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': False,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-01T00:00:00.000000000', '2024-01-01T01:00:00.000000000',\n",
- " '2024-01-01T02:00:00.000000000', '2024-01-01T03:00:00.000000000',\n",
- " '2024-01-01T04:00:00.000000000', '2024-01-01T05:00:00.000000000',\n",
- " '2024-01-01T06:00:00.000000000', '2024-01-01T07:00:00.000000000',\n",
- " '2024-01-01T08:00:00.000000000', '2024-01-01T09:00:00.000000000',\n",
- " '2024-01-01T10:00:00.000000000', '2024-01-01T11:00:00.000000000',\n",
- " '2024-01-01T12:00:00.000000000', '2024-01-01T13:00:00.000000000',\n",
- " '2024-01-01T14:00:00.000000000', '2024-01-01T15:00:00.000000000',\n",
- " '2024-01-01T16:00:00.000000000', '2024-01-01T17:00:00.000000000',\n",
- " '2024-01-01T18:00:00.000000000', '2024-01-01T19:00:00.000000000',\n",
- " '2024-01-01T20:00:00.000000000', '2024-01-01T21:00:00.000000000',\n",
- " '2024-01-01T22:00:00.000000000', '2024-01-01T23:00:00.000000000',\n",
- " '2024-01-02T00:00:00.000000000', '2024-01-02T01:00:00.000000000',\n",
- " '2024-01-02T02:00:00.000000000', '2024-01-02T03:00:00.000000000',\n",
- " '2024-01-02T04:00:00.000000000', '2024-01-02T05:00:00.000000000',\n",
- " '2024-01-02T06:00:00.000000000', '2024-01-02T07:00:00.000000000',\n",
- " '2024-01-02T08:00:00.000000000', '2024-01-02T09:00:00.000000000',\n",
- " '2024-01-02T10:00:00.000000000', '2024-01-02T11:00:00.000000000',\n",
- " '2024-01-02T12:00:00.000000000', '2024-01-02T13:00:00.000000000',\n",
- " '2024-01-02T14:00:00.000000000', '2024-01-02T15:00:00.000000000',\n",
- " '2024-01-02T16:00:00.000000000', '2024-01-02T17:00:00.000000000',\n",
- " '2024-01-02T18:00:00.000000000', '2024-01-02T19:00:00.000000000',\n",
- " '2024-01-02T20:00:00.000000000', '2024-01-02T21:00:00.000000000',\n",
- " '2024-01-02T22:00:00.000000000', '2024-01-02T23:00:00.000000000',\n",
- " '2024-01-03T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x5',\n",
- " 'y': {'bdata': ('iAK1fqVASb1j/UqBWr9ovQo++OCDT2' ... 'qBWr9pvWP9SoFav2m9AAAAAAAA+H8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y5'},\n",
- " {'hovertemplate': ('variable=ThermalStorage(Charge' ... '}
value=%{y}'),\n",
- " 'legendgroup': 'ThermalStorage(Charge)',\n",
- " 'marker': {'color': '#00CC96', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'ThermalStorage(Charge)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': False,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-01T00:00:00.000000000', '2024-01-01T01:00:00.000000000',\n",
- " '2024-01-01T02:00:00.000000000', '2024-01-01T03:00:00.000000000',\n",
- " '2024-01-01T04:00:00.000000000', '2024-01-01T05:00:00.000000000',\n",
- " '2024-01-01T06:00:00.000000000', '2024-01-01T07:00:00.000000000',\n",
- " '2024-01-01T08:00:00.000000000', '2024-01-01T09:00:00.000000000',\n",
- " '2024-01-01T10:00:00.000000000', '2024-01-01T11:00:00.000000000',\n",
- " '2024-01-01T12:00:00.000000000', '2024-01-01T13:00:00.000000000',\n",
- " '2024-01-01T14:00:00.000000000', '2024-01-01T15:00:00.000000000',\n",
- " '2024-01-01T16:00:00.000000000', '2024-01-01T17:00:00.000000000',\n",
- " '2024-01-01T18:00:00.000000000', '2024-01-01T19:00:00.000000000',\n",
- " '2024-01-01T20:00:00.000000000', '2024-01-01T21:00:00.000000000',\n",
- " '2024-01-01T22:00:00.000000000', '2024-01-01T23:00:00.000000000',\n",
- " '2024-01-02T00:00:00.000000000', '2024-01-02T01:00:00.000000000',\n",
- " '2024-01-02T02:00:00.000000000', '2024-01-02T03:00:00.000000000',\n",
- " '2024-01-02T04:00:00.000000000', '2024-01-02T05:00:00.000000000',\n",
- " '2024-01-02T06:00:00.000000000', '2024-01-02T07:00:00.000000000',\n",
- " '2024-01-02T08:00:00.000000000', '2024-01-02T09:00:00.000000000',\n",
- " '2024-01-02T10:00:00.000000000', '2024-01-02T11:00:00.000000000',\n",
- " '2024-01-02T12:00:00.000000000', '2024-01-02T13:00:00.000000000',\n",
- " '2024-01-02T14:00:00.000000000', '2024-01-02T15:00:00.000000000',\n",
- " '2024-01-02T16:00:00.000000000', '2024-01-02T17:00:00.000000000',\n",
- " '2024-01-02T18:00:00.000000000', '2024-01-02T19:00:00.000000000',\n",
- " '2024-01-02T20:00:00.000000000', '2024-01-02T21:00:00.000000000',\n",
- " '2024-01-02T22:00:00.000000000', '2024-01-02T23:00:00.000000000',\n",
- " '2024-01-03T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x6',\n",
- " 'y': {'bdata': ('iAK1fqVASb1j/UqBWr9pvby8nSEx72' ... 'qBWr9pvQo++OCDj2K9AAAAAAAA+H8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y6'},\n",
- " {'hovertemplate': ('variable=ThermalStorage(Charge' ... '}
value=%{y}'),\n",
- " 'legendgroup': 'ThermalStorage(Charge)',\n",
- " 'marker': {'color': '#00CC96', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'ThermalStorage(Charge)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': False,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-01T00:00:00.000000000', '2024-01-01T01:00:00.000000000',\n",
- " '2024-01-01T02:00:00.000000000', '2024-01-01T03:00:00.000000000',\n",
- " '2024-01-01T04:00:00.000000000', '2024-01-01T05:00:00.000000000',\n",
- " '2024-01-01T06:00:00.000000000', '2024-01-01T07:00:00.000000000',\n",
- " '2024-01-01T08:00:00.000000000', '2024-01-01T09:00:00.000000000',\n",
- " '2024-01-01T10:00:00.000000000', '2024-01-01T11:00:00.000000000',\n",
- " '2024-01-01T12:00:00.000000000', '2024-01-01T13:00:00.000000000',\n",
- " '2024-01-01T14:00:00.000000000', '2024-01-01T15:00:00.000000000',\n",
- " '2024-01-01T16:00:00.000000000', '2024-01-01T17:00:00.000000000',\n",
- " '2024-01-01T18:00:00.000000000', '2024-01-01T19:00:00.000000000',\n",
- " '2024-01-01T20:00:00.000000000', '2024-01-01T21:00:00.000000000',\n",
- " '2024-01-01T22:00:00.000000000', '2024-01-01T23:00:00.000000000',\n",
- " '2024-01-02T00:00:00.000000000', '2024-01-02T01:00:00.000000000',\n",
- " '2024-01-02T02:00:00.000000000', '2024-01-02T03:00:00.000000000',\n",
- " '2024-01-02T04:00:00.000000000', '2024-01-02T05:00:00.000000000',\n",
- " '2024-01-02T06:00:00.000000000', '2024-01-02T07:00:00.000000000',\n",
- " '2024-01-02T08:00:00.000000000', '2024-01-02T09:00:00.000000000',\n",
- " '2024-01-02T10:00:00.000000000', '2024-01-02T11:00:00.000000000',\n",
- " '2024-01-02T12:00:00.000000000', '2024-01-02T13:00:00.000000000',\n",
- " '2024-01-02T14:00:00.000000000', '2024-01-02T15:00:00.000000000',\n",
- " '2024-01-02T16:00:00.000000000', '2024-01-02T17:00:00.000000000',\n",
- " '2024-01-02T18:00:00.000000000', '2024-01-02T19:00:00.000000000',\n",
- " '2024-01-02T20:00:00.000000000', '2024-01-02T21:00:00.000000000',\n",
- " '2024-01-02T22:00:00.000000000', '2024-01-02T23:00:00.000000000',\n",
- " '2024-01-03T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('AAAAAAAAAAC3nSExb6dlvbedITFvp2' ... 'Exb6dlvbedITFvp2W9AAAAAAAA+H8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': ('variable=ThermalStorage(Charge' ... '}
value=%{y}'),\n",
- " 'legendgroup': 'ThermalStorage(Charge)',\n",
- " 'marker': {'color': '#00CC96', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'ThermalStorage(Charge)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': False,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-01T00:00:00.000000000', '2024-01-01T01:00:00.000000000',\n",
- " '2024-01-01T02:00:00.000000000', '2024-01-01T03:00:00.000000000',\n",
- " '2024-01-01T04:00:00.000000000', '2024-01-01T05:00:00.000000000',\n",
- " '2024-01-01T06:00:00.000000000', '2024-01-01T07:00:00.000000000',\n",
- " '2024-01-01T08:00:00.000000000', '2024-01-01T09:00:00.000000000',\n",
- " '2024-01-01T10:00:00.000000000', '2024-01-01T11:00:00.000000000',\n",
- " '2024-01-01T12:00:00.000000000', '2024-01-01T13:00:00.000000000',\n",
- " '2024-01-01T14:00:00.000000000', '2024-01-01T15:00:00.000000000',\n",
- " '2024-01-01T16:00:00.000000000', '2024-01-01T17:00:00.000000000',\n",
- " '2024-01-01T18:00:00.000000000', '2024-01-01T19:00:00.000000000',\n",
- " '2024-01-01T20:00:00.000000000', '2024-01-01T21:00:00.000000000',\n",
- " '2024-01-01T22:00:00.000000000', '2024-01-01T23:00:00.000000000',\n",
- " '2024-01-02T00:00:00.000000000', '2024-01-02T01:00:00.000000000',\n",
- " '2024-01-02T02:00:00.000000000', '2024-01-02T03:00:00.000000000',\n",
- " '2024-01-02T04:00:00.000000000', '2024-01-02T05:00:00.000000000',\n",
- " '2024-01-02T06:00:00.000000000', '2024-01-02T07:00:00.000000000',\n",
- " '2024-01-02T08:00:00.000000000', '2024-01-02T09:00:00.000000000',\n",
- " '2024-01-02T10:00:00.000000000', '2024-01-02T11:00:00.000000000',\n",
- " '2024-01-02T12:00:00.000000000', '2024-01-02T13:00:00.000000000',\n",
- " '2024-01-02T14:00:00.000000000', '2024-01-02T15:00:00.000000000',\n",
- " '2024-01-02T16:00:00.000000000', '2024-01-02T17:00:00.000000000',\n",
- " '2024-01-02T18:00:00.000000000', '2024-01-02T19:00:00.000000000',\n",
- " '2024-01-02T20:00:00.000000000', '2024-01-02T21:00:00.000000000',\n",
- " '2024-01-02T22:00:00.000000000', '2024-01-02T23:00:00.000000000',\n",
- " '2024-01-03T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x2',\n",
- " 'y': {'bdata': ('AAAAAAAAAAC3nSExb6dlvbedITFvp2' ... 'Exb6dlvbedITFvp2W9AAAAAAAA+H8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y2'},\n",
- " {'hovertemplate': ('variable=ThermalStorage(Charge' ... '}
value=%{y}'),\n",
- " 'legendgroup': 'ThermalStorage(Charge)',\n",
- " 'marker': {'color': '#00CC96', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'ThermalStorage(Charge)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': False,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-01T00:00:00.000000000', '2024-01-01T01:00:00.000000000',\n",
- " '2024-01-01T02:00:00.000000000', '2024-01-01T03:00:00.000000000',\n",
- " '2024-01-01T04:00:00.000000000', '2024-01-01T05:00:00.000000000',\n",
- " '2024-01-01T06:00:00.000000000', '2024-01-01T07:00:00.000000000',\n",
- " '2024-01-01T08:00:00.000000000', '2024-01-01T09:00:00.000000000',\n",
- " '2024-01-01T10:00:00.000000000', '2024-01-01T11:00:00.000000000',\n",
- " '2024-01-01T12:00:00.000000000', '2024-01-01T13:00:00.000000000',\n",
- " '2024-01-01T14:00:00.000000000', '2024-01-01T15:00:00.000000000',\n",
- " '2024-01-01T16:00:00.000000000', '2024-01-01T17:00:00.000000000',\n",
- " '2024-01-01T18:00:00.000000000', '2024-01-01T19:00:00.000000000',\n",
- " '2024-01-01T20:00:00.000000000', '2024-01-01T21:00:00.000000000',\n",
- " '2024-01-01T22:00:00.000000000', '2024-01-01T23:00:00.000000000',\n",
- " '2024-01-02T00:00:00.000000000', '2024-01-02T01:00:00.000000000',\n",
- " '2024-01-02T02:00:00.000000000', '2024-01-02T03:00:00.000000000',\n",
- " '2024-01-02T04:00:00.000000000', '2024-01-02T05:00:00.000000000',\n",
- " '2024-01-02T06:00:00.000000000', '2024-01-02T07:00:00.000000000',\n",
- " '2024-01-02T08:00:00.000000000', '2024-01-02T09:00:00.000000000',\n",
- " '2024-01-02T10:00:00.000000000', '2024-01-02T11:00:00.000000000',\n",
- " '2024-01-02T12:00:00.000000000', '2024-01-02T13:00:00.000000000',\n",
- " '2024-01-02T14:00:00.000000000', '2024-01-02T15:00:00.000000000',\n",
- " '2024-01-02T16:00:00.000000000', '2024-01-02T17:00:00.000000000',\n",
- " '2024-01-02T18:00:00.000000000', '2024-01-02T19:00:00.000000000',\n",
- " '2024-01-02T20:00:00.000000000', '2024-01-02T21:00:00.000000000',\n",
- " '2024-01-02T22:00:00.000000000', '2024-01-02T23:00:00.000000000',\n",
- " '2024-01-03T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x3',\n",
- " 'y': {'bdata': ('AAAAAAAAAAC3nSExb6dlvbedITFvp2' ... 'Exb6dlvbedITFvh2a9AAAAAAAA+H8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y3'},\n",
- " {'hovertemplate': ('variable=Building(Heat)
sce' ... '}
value=%{y}'),\n",
- " 'legendgroup': 'Building(Heat)',\n",
- " 'marker': {'color': '#AB63FA', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'Building(Heat)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-01T00:00:00.000000000', '2024-01-01T01:00:00.000000000',\n",
- " '2024-01-01T02:00:00.000000000', '2024-01-01T03:00:00.000000000',\n",
- " '2024-01-01T04:00:00.000000000', '2024-01-01T05:00:00.000000000',\n",
- " '2024-01-01T06:00:00.000000000', '2024-01-01T07:00:00.000000000',\n",
- " '2024-01-01T08:00:00.000000000', '2024-01-01T09:00:00.000000000',\n",
- " '2024-01-01T10:00:00.000000000', '2024-01-01T11:00:00.000000000',\n",
- " '2024-01-01T12:00:00.000000000', '2024-01-01T13:00:00.000000000',\n",
- " '2024-01-01T14:00:00.000000000', '2024-01-01T15:00:00.000000000',\n",
- " '2024-01-01T16:00:00.000000000', '2024-01-01T17:00:00.000000000',\n",
- " '2024-01-01T18:00:00.000000000', '2024-01-01T19:00:00.000000000',\n",
- " '2024-01-01T20:00:00.000000000', '2024-01-01T21:00:00.000000000',\n",
- " '2024-01-01T22:00:00.000000000', '2024-01-01T23:00:00.000000000',\n",
- " '2024-01-02T00:00:00.000000000', '2024-01-02T01:00:00.000000000',\n",
- " '2024-01-02T02:00:00.000000000', '2024-01-02T03:00:00.000000000',\n",
- " '2024-01-02T04:00:00.000000000', '2024-01-02T05:00:00.000000000',\n",
- " '2024-01-02T06:00:00.000000000', '2024-01-02T07:00:00.000000000',\n",
- " '2024-01-02T08:00:00.000000000', '2024-01-02T09:00:00.000000000',\n",
- " '2024-01-02T10:00:00.000000000', '2024-01-02T11:00:00.000000000',\n",
- " '2024-01-02T12:00:00.000000000', '2024-01-02T13:00:00.000000000',\n",
- " '2024-01-02T14:00:00.000000000', '2024-01-02T15:00:00.000000000',\n",
- " '2024-01-02T16:00:00.000000000', '2024-01-02T17:00:00.000000000',\n",
- " '2024-01-02T18:00:00.000000000', '2024-01-02T19:00:00.000000000',\n",
- " '2024-01-02T20:00:00.000000000', '2024-01-02T21:00:00.000000000',\n",
- " '2024-01-02T22:00:00.000000000', '2024-01-02T23:00:00.000000000',\n",
- " '2024-01-03T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x4',\n",
- " 'y': {'bdata': ('5ZuWpeU9RkDmqeLGgqdEQGDXQkqFnk' ... 'rxMNlDQF+20eeOpEdAAAAAAAAA+H8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y4'},\n",
- " {'hovertemplate': ('variable=Building(Heat)
sce' ... '}
value=%{y}'),\n",
- " 'legendgroup': 'Building(Heat)',\n",
- " 'marker': {'color': '#AB63FA', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'Building(Heat)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': False,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-01T00:00:00.000000000', '2024-01-01T01:00:00.000000000',\n",
- " '2024-01-01T02:00:00.000000000', '2024-01-01T03:00:00.000000000',\n",
- " '2024-01-01T04:00:00.000000000', '2024-01-01T05:00:00.000000000',\n",
- " '2024-01-01T06:00:00.000000000', '2024-01-01T07:00:00.000000000',\n",
- " '2024-01-01T08:00:00.000000000', '2024-01-01T09:00:00.000000000',\n",
- " '2024-01-01T10:00:00.000000000', '2024-01-01T11:00:00.000000000',\n",
- " '2024-01-01T12:00:00.000000000', '2024-01-01T13:00:00.000000000',\n",
- " '2024-01-01T14:00:00.000000000', '2024-01-01T15:00:00.000000000',\n",
- " '2024-01-01T16:00:00.000000000', '2024-01-01T17:00:00.000000000',\n",
- " '2024-01-01T18:00:00.000000000', '2024-01-01T19:00:00.000000000',\n",
- " '2024-01-01T20:00:00.000000000', '2024-01-01T21:00:00.000000000',\n",
- " '2024-01-01T22:00:00.000000000', '2024-01-01T23:00:00.000000000',\n",
- " '2024-01-02T00:00:00.000000000', '2024-01-02T01:00:00.000000000',\n",
- " '2024-01-02T02:00:00.000000000', '2024-01-02T03:00:00.000000000',\n",
- " '2024-01-02T04:00:00.000000000', '2024-01-02T05:00:00.000000000',\n",
- " '2024-01-02T06:00:00.000000000', '2024-01-02T07:00:00.000000000',\n",
- " '2024-01-02T08:00:00.000000000', '2024-01-02T09:00:00.000000000',\n",
- " '2024-01-02T10:00:00.000000000', '2024-01-02T11:00:00.000000000',\n",
- " '2024-01-02T12:00:00.000000000', '2024-01-02T13:00:00.000000000',\n",
- " '2024-01-02T14:00:00.000000000', '2024-01-02T15:00:00.000000000',\n",
- " '2024-01-02T16:00:00.000000000', '2024-01-02T17:00:00.000000000',\n",
- " '2024-01-02T18:00:00.000000000', '2024-01-02T19:00:00.000000000',\n",
- " '2024-01-02T20:00:00.000000000', '2024-01-02T21:00:00.000000000',\n",
- " '2024-01-02T22:00:00.000000000', '2024-01-02T23:00:00.000000000',\n",
- " '2024-01-03T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x5',\n",
- " 'y': {'bdata': ('5ZuWpeU9RkDmqeLGgqdEQGDXQkqFnk' ... 'rxMNlDQF+20eeOpEdAAAAAAAAA+H8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y5'},\n",
- " {'hovertemplate': ('variable=Building(Heat)
sce' ... '}
value=%{y}'),\n",
- " 'legendgroup': 'Building(Heat)',\n",
- " 'marker': {'color': '#AB63FA', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'Building(Heat)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': False,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-01T00:00:00.000000000', '2024-01-01T01:00:00.000000000',\n",
- " '2024-01-01T02:00:00.000000000', '2024-01-01T03:00:00.000000000',\n",
- " '2024-01-01T04:00:00.000000000', '2024-01-01T05:00:00.000000000',\n",
- " '2024-01-01T06:00:00.000000000', '2024-01-01T07:00:00.000000000',\n",
- " '2024-01-01T08:00:00.000000000', '2024-01-01T09:00:00.000000000',\n",
- " '2024-01-01T10:00:00.000000000', '2024-01-01T11:00:00.000000000',\n",
- " '2024-01-01T12:00:00.000000000', '2024-01-01T13:00:00.000000000',\n",
- " '2024-01-01T14:00:00.000000000', '2024-01-01T15:00:00.000000000',\n",
- " '2024-01-01T16:00:00.000000000', '2024-01-01T17:00:00.000000000',\n",
- " '2024-01-01T18:00:00.000000000', '2024-01-01T19:00:00.000000000',\n",
- " '2024-01-01T20:00:00.000000000', '2024-01-01T21:00:00.000000000',\n",
- " '2024-01-01T22:00:00.000000000', '2024-01-01T23:00:00.000000000',\n",
- " '2024-01-02T00:00:00.000000000', '2024-01-02T01:00:00.000000000',\n",
- " '2024-01-02T02:00:00.000000000', '2024-01-02T03:00:00.000000000',\n",
- " '2024-01-02T04:00:00.000000000', '2024-01-02T05:00:00.000000000',\n",
- " '2024-01-02T06:00:00.000000000', '2024-01-02T07:00:00.000000000',\n",
- " '2024-01-02T08:00:00.000000000', '2024-01-02T09:00:00.000000000',\n",
- " '2024-01-02T10:00:00.000000000', '2024-01-02T11:00:00.000000000',\n",
- " '2024-01-02T12:00:00.000000000', '2024-01-02T13:00:00.000000000',\n",
- " '2024-01-02T14:00:00.000000000', '2024-01-02T15:00:00.000000000',\n",
- " '2024-01-02T16:00:00.000000000', '2024-01-02T17:00:00.000000000',\n",
- " '2024-01-02T18:00:00.000000000', '2024-01-02T19:00:00.000000000',\n",
- " '2024-01-02T20:00:00.000000000', '2024-01-02T21:00:00.000000000',\n",
- " '2024-01-02T22:00:00.000000000', '2024-01-02T23:00:00.000000000',\n",
- " '2024-01-03T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x6',\n",
- " 'y': {'bdata': ('5ZuWpeU9RkDmqeLGgqdEQGDXQkqFnk' ... 'rxMNlDQF+20eeOpEdAAAAAAAAA+H8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y6'},\n",
- " {'hovertemplate': ('variable=Building(Heat)
sce' ... '}
value=%{y}'),\n",
- " 'legendgroup': 'Building(Heat)',\n",
- " 'marker': {'color': '#AB63FA', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'Building(Heat)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': False,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-01T00:00:00.000000000', '2024-01-01T01:00:00.000000000',\n",
- " '2024-01-01T02:00:00.000000000', '2024-01-01T03:00:00.000000000',\n",
- " '2024-01-01T04:00:00.000000000', '2024-01-01T05:00:00.000000000',\n",
- " '2024-01-01T06:00:00.000000000', '2024-01-01T07:00:00.000000000',\n",
- " '2024-01-01T08:00:00.000000000', '2024-01-01T09:00:00.000000000',\n",
- " '2024-01-01T10:00:00.000000000', '2024-01-01T11:00:00.000000000',\n",
- " '2024-01-01T12:00:00.000000000', '2024-01-01T13:00:00.000000000',\n",
- " '2024-01-01T14:00:00.000000000', '2024-01-01T15:00:00.000000000',\n",
- " '2024-01-01T16:00:00.000000000', '2024-01-01T17:00:00.000000000',\n",
- " '2024-01-01T18:00:00.000000000', '2024-01-01T19:00:00.000000000',\n",
- " '2024-01-01T20:00:00.000000000', '2024-01-01T21:00:00.000000000',\n",
- " '2024-01-01T22:00:00.000000000', '2024-01-01T23:00:00.000000000',\n",
- " '2024-01-02T00:00:00.000000000', '2024-01-02T01:00:00.000000000',\n",
- " '2024-01-02T02:00:00.000000000', '2024-01-02T03:00:00.000000000',\n",
- " '2024-01-02T04:00:00.000000000', '2024-01-02T05:00:00.000000000',\n",
- " '2024-01-02T06:00:00.000000000', '2024-01-02T07:00:00.000000000',\n",
- " '2024-01-02T08:00:00.000000000', '2024-01-02T09:00:00.000000000',\n",
- " '2024-01-02T10:00:00.000000000', '2024-01-02T11:00:00.000000000',\n",
- " '2024-01-02T12:00:00.000000000', '2024-01-02T13:00:00.000000000',\n",
- " '2024-01-02T14:00:00.000000000', '2024-01-02T15:00:00.000000000',\n",
- " '2024-01-02T16:00:00.000000000', '2024-01-02T17:00:00.000000000',\n",
- " '2024-01-02T18:00:00.000000000', '2024-01-02T19:00:00.000000000',\n",
- " '2024-01-02T20:00:00.000000000', '2024-01-02T21:00:00.000000000',\n",
- " '2024-01-02T22:00:00.000000000', '2024-01-02T23:00:00.000000000',\n",
- " '2024-01-03T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('EgPMGubHPkACjH0z/HU4QCMgRYDluD' ... 'Vm3JI8QD2yyUAFXDlAAAAAAAAA+H8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': ('variable=Building(Heat)
sce' ... '}
value=%{y}'),\n",
- " 'legendgroup': 'Building(Heat)',\n",
- " 'marker': {'color': '#AB63FA', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'Building(Heat)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': False,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-01T00:00:00.000000000', '2024-01-01T01:00:00.000000000',\n",
- " '2024-01-01T02:00:00.000000000', '2024-01-01T03:00:00.000000000',\n",
- " '2024-01-01T04:00:00.000000000', '2024-01-01T05:00:00.000000000',\n",
- " '2024-01-01T06:00:00.000000000', '2024-01-01T07:00:00.000000000',\n",
- " '2024-01-01T08:00:00.000000000', '2024-01-01T09:00:00.000000000',\n",
- " '2024-01-01T10:00:00.000000000', '2024-01-01T11:00:00.000000000',\n",
- " '2024-01-01T12:00:00.000000000', '2024-01-01T13:00:00.000000000',\n",
- " '2024-01-01T14:00:00.000000000', '2024-01-01T15:00:00.000000000',\n",
- " '2024-01-01T16:00:00.000000000', '2024-01-01T17:00:00.000000000',\n",
- " '2024-01-01T18:00:00.000000000', '2024-01-01T19:00:00.000000000',\n",
- " '2024-01-01T20:00:00.000000000', '2024-01-01T21:00:00.000000000',\n",
- " '2024-01-01T22:00:00.000000000', '2024-01-01T23:00:00.000000000',\n",
- " '2024-01-02T00:00:00.000000000', '2024-01-02T01:00:00.000000000',\n",
- " '2024-01-02T02:00:00.000000000', '2024-01-02T03:00:00.000000000',\n",
- " '2024-01-02T04:00:00.000000000', '2024-01-02T05:00:00.000000000',\n",
- " '2024-01-02T06:00:00.000000000', '2024-01-02T07:00:00.000000000',\n",
- " '2024-01-02T08:00:00.000000000', '2024-01-02T09:00:00.000000000',\n",
- " '2024-01-02T10:00:00.000000000', '2024-01-02T11:00:00.000000000',\n",
- " '2024-01-02T12:00:00.000000000', '2024-01-02T13:00:00.000000000',\n",
- " '2024-01-02T14:00:00.000000000', '2024-01-02T15:00:00.000000000',\n",
- " '2024-01-02T16:00:00.000000000', '2024-01-02T17:00:00.000000000',\n",
- " '2024-01-02T18:00:00.000000000', '2024-01-02T19:00:00.000000000',\n",
- " '2024-01-02T20:00:00.000000000', '2024-01-02T21:00:00.000000000',\n",
- " '2024-01-02T22:00:00.000000000', '2024-01-02T23:00:00.000000000',\n",
- " '2024-01-03T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x2',\n",
- " 'y': {'bdata': ('EgPMGubHPkACjH0z/HU4QCMgRYDluD' ... 'Vm3JI8QD2yyUAFXDlAAAAAAAAA+H8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y2'},\n",
- " {'hovertemplate': ('variable=Building(Heat)
sce' ... '}
value=%{y}'),\n",
- " 'legendgroup': 'Building(Heat)',\n",
- " 'marker': {'color': '#AB63FA', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'Building(Heat)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': False,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-01T00:00:00.000000000', '2024-01-01T01:00:00.000000000',\n",
- " '2024-01-01T02:00:00.000000000', '2024-01-01T03:00:00.000000000',\n",
- " '2024-01-01T04:00:00.000000000', '2024-01-01T05:00:00.000000000',\n",
- " '2024-01-01T06:00:00.000000000', '2024-01-01T07:00:00.000000000',\n",
- " '2024-01-01T08:00:00.000000000', '2024-01-01T09:00:00.000000000',\n",
- " '2024-01-01T10:00:00.000000000', '2024-01-01T11:00:00.000000000',\n",
- " '2024-01-01T12:00:00.000000000', '2024-01-01T13:00:00.000000000',\n",
- " '2024-01-01T14:00:00.000000000', '2024-01-01T15:00:00.000000000',\n",
- " '2024-01-01T16:00:00.000000000', '2024-01-01T17:00:00.000000000',\n",
- " '2024-01-01T18:00:00.000000000', '2024-01-01T19:00:00.000000000',\n",
- " '2024-01-01T20:00:00.000000000', '2024-01-01T21:00:00.000000000',\n",
- " '2024-01-01T22:00:00.000000000', '2024-01-01T23:00:00.000000000',\n",
- " '2024-01-02T00:00:00.000000000', '2024-01-02T01:00:00.000000000',\n",
- " '2024-01-02T02:00:00.000000000', '2024-01-02T03:00:00.000000000',\n",
- " '2024-01-02T04:00:00.000000000', '2024-01-02T05:00:00.000000000',\n",
- " '2024-01-02T06:00:00.000000000', '2024-01-02T07:00:00.000000000',\n",
- " '2024-01-02T08:00:00.000000000', '2024-01-02T09:00:00.000000000',\n",
- " '2024-01-02T10:00:00.000000000', '2024-01-02T11:00:00.000000000',\n",
- " '2024-01-02T12:00:00.000000000', '2024-01-02T13:00:00.000000000',\n",
- " '2024-01-02T14:00:00.000000000', '2024-01-02T15:00:00.000000000',\n",
- " '2024-01-02T16:00:00.000000000', '2024-01-02T17:00:00.000000000',\n",
- " '2024-01-02T18:00:00.000000000', '2024-01-02T19:00:00.000000000',\n",
- " '2024-01-02T20:00:00.000000000', '2024-01-02T21:00:00.000000000',\n",
- " '2024-01-02T22:00:00.000000000', '2024-01-02T23:00:00.000000000',\n",
- " '2024-01-03T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x3',\n",
- " 'y': {'bdata': ('EgPMGubHPkACjH0z/HU4QCMgRYDluD' ... 'Vm3JI8QD2yyUAFXDlAAAAAAAAA+H8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y3'}],\n",
- " 'layout': {'annotations': [{'font': {},\n",
- " 'showarrow': False,\n",
- " 'text': 'period=2024',\n",
- " 'x': 0.15666666666666665,\n",
- " 'xanchor': 'center',\n",
- " 'xref': 'paper',\n",
- " 'y': 1.0,\n",
- " 'yanchor': 'bottom',\n",
- " 'yref': 'paper'},\n",
- " {'font': {},\n",
- " 'showarrow': False,\n",
- " 'text': 'period=2025',\n",
- " 'x': 0.49,\n",
- " 'xanchor': 'center',\n",
- " 'xref': 'paper',\n",
- " 'y': 1.0,\n",
- " 'yanchor': 'bottom',\n",
- " 'yref': 'paper'},\n",
- " {'font': {},\n",
- " 'showarrow': False,\n",
- " 'text': 'period=2026',\n",
- " 'x': 0.8233333333333333,\n",
- " 'xanchor': 'center',\n",
- " 'xref': 'paper',\n",
- " 'y': 1.0,\n",
- " 'yanchor': 'bottom',\n",
- " 'yref': 'paper'},\n",
- " {'font': {},\n",
- " 'showarrow': False,\n",
- " 'text': 'scenario=low_demand',\n",
- " 'textangle': 90,\n",
- " 'x': 0.98,\n",
- " 'xanchor': 'left',\n",
- " 'xref': 'paper',\n",
- " 'y': 0.2425,\n",
- " 'yanchor': 'middle',\n",
- " 'yref': 'paper'},\n",
- " {'font': {},\n",
- " 'showarrow': False,\n",
- " 'text': 'scenario=high_demand',\n",
- " 'textangle': 90,\n",
- " 'x': 0.98,\n",
- " 'xanchor': 'left',\n",
- " 'xref': 'paper',\n",
- " 'y': 0.7575000000000001,\n",
- " 'yanchor': 'middle',\n",
- " 'yref': 'paper'}],\n",
- " 'bargap': 0,\n",
- " 'bargroupgap': 0,\n",
- " 'barmode': 'relative',\n",
- " 'legend': {'title': {'text': 'variable'}, 'tracegroupgap': 0},\n",
- " 'template': '...',\n",
- " 'title': {'text': 'Heat (flow_rate)'},\n",
- " 'xaxis': {'anchor': 'y', 'domain': [0.0, 0.3133333333333333], 'title': {'text': 'time'}},\n",
- " 'xaxis2': {'anchor': 'y2',\n",
- " 'domain': [0.3333333333333333, 0.6466666666666666],\n",
- " 'matches': 'x',\n",
- " 'title': {'text': 'time'}},\n",
- " 'xaxis3': {'anchor': 'y3', 'domain': [0.6666666666666666, 0.98], 'matches': 'x', 'title': {'text': 'time'}},\n",
- " 'xaxis4': {'anchor': 'y4', 'domain': [0.0, 0.3133333333333333], 'matches': 'x', 'showticklabels': False},\n",
- " 'xaxis5': {'anchor': 'y5',\n",
- " 'domain': [0.3333333333333333, 0.6466666666666666],\n",
- " 'matches': 'x',\n",
- " 'showticklabels': False},\n",
- " 'xaxis6': {'anchor': 'y6', 'domain': [0.6666666666666666, 0.98], 'matches': 'x', 'showticklabels': False},\n",
- " 'yaxis': {'anchor': 'x', 'domain': [0.0, 0.485], 'title': {'text': 'value'}},\n",
- " 'yaxis2': {'anchor': 'x2', 'domain': [0.0, 0.485], 'matches': 'y', 'showticklabels': False},\n",
- " 'yaxis3': {'anchor': 'x3', 'domain': [0.0, 0.485], 'matches': 'y', 'showticklabels': False},\n",
- " 'yaxis4': {'anchor': 'x4', 'domain': [0.515, 1.0], 'matches': 'y', 'title': {'text': 'value'}},\n",
- " 'yaxis5': {'anchor': 'x5', 'domain': [0.515, 1.0], 'matches': 'y', 'showticklabels': False},\n",
- " 'yaxis6': {'anchor': 'x6', 'domain': [0.515, 1.0], 'matches': 'y', 'showticklabels': False}}\n",
- "}))"
- ],
- "text/html": [
- ""
- ]
- },
- "execution_count": 34,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "execution_count": 34
+ ]
},
{
"cell_type": "code",
- "id": "72",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T14:13:18.395048Z",
- "start_time": "2025-12-13T14:13:18.341709Z"
- }
- },
+ "execution_count": null,
+ "id": "62",
+ "metadata": {},
+ "outputs": [],
"source": [
"# Filter to specific scenario/period\n",
"multiperiod.statistics.plot.balance('Heat', select={'scenario': 'high_demand', 'period': 2024})"
- ],
- "outputs": [
- {
- "data": {
- "text/plain": [
- "PlotResult(data= Size: 2kB\n",
- "Dimensions: (time: 49)\n",
- "Coordinates:\n",
- " * time (time) datetime64[ns] 392B 2024-01-01 ... 2024...\n",
- "Data variables:\n",
- " Boiler(Heat) (time) float64 392B -44.48 -41.31 ... -47.29 nan\n",
- " ThermalStorage(Discharge) (time) float64 392B 1.723e-13 6.749e-13 ... nan\n",
- " ThermalStorage(Charge) (time) float64 392B -1.794e-13 -7.034e-13 ... nan\n",
- " Building(Heat) (time) float64 392B 44.48 41.31 ... 47.29 nan, figure=Figure({\n",
- " 'data': [{'hovertemplate': 'variable=Boiler(Heat)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'Boiler(Heat)',\n",
- " 'marker': {'color': '#EF553B', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'Boiler(Heat)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-01T00:00:00.000000000', '2024-01-01T01:00:00.000000000',\n",
- " '2024-01-01T02:00:00.000000000', '2024-01-01T03:00:00.000000000',\n",
- " '2024-01-01T04:00:00.000000000', '2024-01-01T05:00:00.000000000',\n",
- " '2024-01-01T06:00:00.000000000', '2024-01-01T07:00:00.000000000',\n",
- " '2024-01-01T08:00:00.000000000', '2024-01-01T09:00:00.000000000',\n",
- " '2024-01-01T10:00:00.000000000', '2024-01-01T11:00:00.000000000',\n",
- " '2024-01-01T12:00:00.000000000', '2024-01-01T13:00:00.000000000',\n",
- " '2024-01-01T14:00:00.000000000', '2024-01-01T15:00:00.000000000',\n",
- " '2024-01-01T16:00:00.000000000', '2024-01-01T17:00:00.000000000',\n",
- " '2024-01-01T18:00:00.000000000', '2024-01-01T19:00:00.000000000',\n",
- " '2024-01-01T20:00:00.000000000', '2024-01-01T21:00:00.000000000',\n",
- " '2024-01-01T22:00:00.000000000', '2024-01-01T23:00:00.000000000',\n",
- " '2024-01-02T00:00:00.000000000', '2024-01-02T01:00:00.000000000',\n",
- " '2024-01-02T02:00:00.000000000', '2024-01-02T03:00:00.000000000',\n",
- " '2024-01-02T04:00:00.000000000', '2024-01-02T05:00:00.000000000',\n",
- " '2024-01-02T06:00:00.000000000', '2024-01-02T07:00:00.000000000',\n",
- " '2024-01-02T08:00:00.000000000', '2024-01-02T09:00:00.000000000',\n",
- " '2024-01-02T10:00:00.000000000', '2024-01-02T11:00:00.000000000',\n",
- " '2024-01-02T12:00:00.000000000', '2024-01-02T13:00:00.000000000',\n",
- " '2024-01-02T14:00:00.000000000', '2024-01-02T15:00:00.000000000',\n",
- " '2024-01-02T16:00:00.000000000', '2024-01-02T17:00:00.000000000',\n",
- " '2024-01-02T18:00:00.000000000', '2024-01-02T19:00:00.000000000',\n",
- " '2024-01-02T20:00:00.000000000', '2024-01-02T21:00:00.000000000',\n",
- " '2024-01-02T22:00:00.000000000', '2024-01-02T23:00:00.000000000',\n",
- " '2024-01-03T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('5JuWpeU9RsDiqeLGgqdEwF3XQkqFnk' ... 'rxMNlDwFu20eeOpEfAAAAAAAAA+P8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'variable=ThermalStorage(Discharge)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'ThermalStorage(Discharge)',\n",
- " 'marker': {'color': '#00CC96', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'ThermalStorage(Discharge)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-01T00:00:00.000000000', '2024-01-01T01:00:00.000000000',\n",
- " '2024-01-01T02:00:00.000000000', '2024-01-01T03:00:00.000000000',\n",
- " '2024-01-01T04:00:00.000000000', '2024-01-01T05:00:00.000000000',\n",
- " '2024-01-01T06:00:00.000000000', '2024-01-01T07:00:00.000000000',\n",
- " '2024-01-01T08:00:00.000000000', '2024-01-01T09:00:00.000000000',\n",
- " '2024-01-01T10:00:00.000000000', '2024-01-01T11:00:00.000000000',\n",
- " '2024-01-01T12:00:00.000000000', '2024-01-01T13:00:00.000000000',\n",
- " '2024-01-01T14:00:00.000000000', '2024-01-01T15:00:00.000000000',\n",
- " '2024-01-01T16:00:00.000000000', '2024-01-01T17:00:00.000000000',\n",
- " '2024-01-01T18:00:00.000000000', '2024-01-01T19:00:00.000000000',\n",
- " '2024-01-01T20:00:00.000000000', '2024-01-01T21:00:00.000000000',\n",
- " '2024-01-01T22:00:00.000000000', '2024-01-01T23:00:00.000000000',\n",
- " '2024-01-02T00:00:00.000000000', '2024-01-02T01:00:00.000000000',\n",
- " '2024-01-02T02:00:00.000000000', '2024-01-02T03:00:00.000000000',\n",
- " '2024-01-02T04:00:00.000000000', '2024-01-02T05:00:00.000000000',\n",
- " '2024-01-02T06:00:00.000000000', '2024-01-02T07:00:00.000000000',\n",
- " '2024-01-02T08:00:00.000000000', '2024-01-02T09:00:00.000000000',\n",
- " '2024-01-02T10:00:00.000000000', '2024-01-02T11:00:00.000000000',\n",
- " '2024-01-02T12:00:00.000000000', '2024-01-02T13:00:00.000000000',\n",
- " '2024-01-02T14:00:00.000000000', '2024-01-02T15:00:00.000000000',\n",
- " '2024-01-02T16:00:00.000000000', '2024-01-02T17:00:00.000000000',\n",
- " '2024-01-02T18:00:00.000000000', '2024-01-02T19:00:00.000000000',\n",
- " '2024-01-02T20:00:00.000000000', '2024-01-02T21:00:00.000000000',\n",
- " '2024-01-02T22:00:00.000000000', '2024-01-02T23:00:00.000000000',\n",
- " '2024-01-03T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('iAK1fqVASD1j/UqBWr9nPQo++OCDj2' ... 'jgg89hPWP9SoFav2g9AAAAAAAA+P8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'variable=ThermalStorage(Charge)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'ThermalStorage(Charge)',\n",
- " 'marker': {'color': '#00CC96', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'ThermalStorage(Charge)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-01T00:00:00.000000000', '2024-01-01T01:00:00.000000000',\n",
- " '2024-01-01T02:00:00.000000000', '2024-01-01T03:00:00.000000000',\n",
- " '2024-01-01T04:00:00.000000000', '2024-01-01T05:00:00.000000000',\n",
- " '2024-01-01T06:00:00.000000000', '2024-01-01T07:00:00.000000000',\n",
- " '2024-01-01T08:00:00.000000000', '2024-01-01T09:00:00.000000000',\n",
- " '2024-01-01T10:00:00.000000000', '2024-01-01T11:00:00.000000000',\n",
- " '2024-01-01T12:00:00.000000000', '2024-01-01T13:00:00.000000000',\n",
- " '2024-01-01T14:00:00.000000000', '2024-01-01T15:00:00.000000000',\n",
- " '2024-01-01T16:00:00.000000000', '2024-01-01T17:00:00.000000000',\n",
- " '2024-01-01T18:00:00.000000000', '2024-01-01T19:00:00.000000000',\n",
- " '2024-01-01T20:00:00.000000000', '2024-01-01T21:00:00.000000000',\n",
- " '2024-01-01T22:00:00.000000000', '2024-01-01T23:00:00.000000000',\n",
- " '2024-01-02T00:00:00.000000000', '2024-01-02T01:00:00.000000000',\n",
- " '2024-01-02T02:00:00.000000000', '2024-01-02T03:00:00.000000000',\n",
- " '2024-01-02T04:00:00.000000000', '2024-01-02T05:00:00.000000000',\n",
- " '2024-01-02T06:00:00.000000000', '2024-01-02T07:00:00.000000000',\n",
- " '2024-01-02T08:00:00.000000000', '2024-01-02T09:00:00.000000000',\n",
- " '2024-01-02T10:00:00.000000000', '2024-01-02T11:00:00.000000000',\n",
- " '2024-01-02T12:00:00.000000000', '2024-01-02T13:00:00.000000000',\n",
- " '2024-01-02T14:00:00.000000000', '2024-01-02T15:00:00.000000000',\n",
- " '2024-01-02T16:00:00.000000000', '2024-01-02T17:00:00.000000000',\n",
- " '2024-01-02T18:00:00.000000000', '2024-01-02T19:00:00.000000000',\n",
- " '2024-01-02T20:00:00.000000000', '2024-01-02T21:00:00.000000000',\n",
- " '2024-01-02T22:00:00.000000000', '2024-01-02T23:00:00.000000000',\n",
- " '2024-01-03T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('iAK1fqVASb1j/UqBWr9ovQo++OCDT2' ... 'jgg49ivWP9SoFav2m9AAAAAAAA+H8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'variable=Building(Heat)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'Building(Heat)',\n",
- " 'marker': {'color': '#AB63FA', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'Building(Heat)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-01T00:00:00.000000000', '2024-01-01T01:00:00.000000000',\n",
- " '2024-01-01T02:00:00.000000000', '2024-01-01T03:00:00.000000000',\n",
- " '2024-01-01T04:00:00.000000000', '2024-01-01T05:00:00.000000000',\n",
- " '2024-01-01T06:00:00.000000000', '2024-01-01T07:00:00.000000000',\n",
- " '2024-01-01T08:00:00.000000000', '2024-01-01T09:00:00.000000000',\n",
- " '2024-01-01T10:00:00.000000000', '2024-01-01T11:00:00.000000000',\n",
- " '2024-01-01T12:00:00.000000000', '2024-01-01T13:00:00.000000000',\n",
- " '2024-01-01T14:00:00.000000000', '2024-01-01T15:00:00.000000000',\n",
- " '2024-01-01T16:00:00.000000000', '2024-01-01T17:00:00.000000000',\n",
- " '2024-01-01T18:00:00.000000000', '2024-01-01T19:00:00.000000000',\n",
- " '2024-01-01T20:00:00.000000000', '2024-01-01T21:00:00.000000000',\n",
- " '2024-01-01T22:00:00.000000000', '2024-01-01T23:00:00.000000000',\n",
- " '2024-01-02T00:00:00.000000000', '2024-01-02T01:00:00.000000000',\n",
- " '2024-01-02T02:00:00.000000000', '2024-01-02T03:00:00.000000000',\n",
- " '2024-01-02T04:00:00.000000000', '2024-01-02T05:00:00.000000000',\n",
- " '2024-01-02T06:00:00.000000000', '2024-01-02T07:00:00.000000000',\n",
- " '2024-01-02T08:00:00.000000000', '2024-01-02T09:00:00.000000000',\n",
- " '2024-01-02T10:00:00.000000000', '2024-01-02T11:00:00.000000000',\n",
- " '2024-01-02T12:00:00.000000000', '2024-01-02T13:00:00.000000000',\n",
- " '2024-01-02T14:00:00.000000000', '2024-01-02T15:00:00.000000000',\n",
- " '2024-01-02T16:00:00.000000000', '2024-01-02T17:00:00.000000000',\n",
- " '2024-01-02T18:00:00.000000000', '2024-01-02T19:00:00.000000000',\n",
- " '2024-01-02T20:00:00.000000000', '2024-01-02T21:00:00.000000000',\n",
- " '2024-01-02T22:00:00.000000000', '2024-01-02T23:00:00.000000000',\n",
- " '2024-01-03T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('5ZuWpeU9RkDmqeLGgqdEQGDXQkqFnk' ... 'rxMNlDQF+20eeOpEdAAAAAAAAA+H8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'}],\n",
- " 'layout': {'bargap': 0,\n",
- " 'bargroupgap': 0,\n",
- " 'barmode': 'relative',\n",
- " 'legend': {'title': {'text': 'variable'}, 'tracegroupgap': 0},\n",
- " 'template': '...',\n",
- " 'title': {'text': 'Heat (flow_rate)'},\n",
- " 'xaxis': {'anchor': 'y', 'domain': [0.0, 1.0], 'title': {'text': 'time'}},\n",
- " 'yaxis': {'anchor': 'x', 'domain': [0.0, 1.0], 'title': {'text': 'value'}}}\n",
- "}))"
- ],
- "text/html": [
- ""
- ]
- },
- "execution_count": 35,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "execution_count": 35
+ ]
},
{
"cell_type": "code",
- "id": "73",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T14:13:18.481894Z",
- "start_time": "2025-12-13T14:13:18.459661Z"
- }
- },
+ "execution_count": null,
+ "id": "63",
+ "metadata": {},
+ "outputs": [],
"source": [
"# Sankey aggregates across all dimensions by default\n",
"multiperiod.statistics.plot.sankey.flows()"
- ],
- "outputs": [
- {
- "data": {
- "text/plain": [
- "PlotResult(data= Size: 592B\n",
- "Dimensions: (link: 4)\n",
- "Coordinates:\n",
- " * link (link) int64 32B 0 1 2 3\n",
- " source (link) \n",
- " "
- ]
- },
- "execution_count": 36,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "execution_count": 36
+ ]
},
{
"cell_type": "markdown",
- "id": "74",
+ "id": "64",
"metadata": {},
"source": [
"## 9. Color Customization\n",
@@ -6229,885 +708,32 @@
},
{
"cell_type": "code",
- "id": "75",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T14:13:18.553613Z",
- "start_time": "2025-12-13T14:13:18.488703Z"
- }
- },
+ "execution_count": null,
+ "id": "65",
+ "metadata": {},
+ "outputs": [],
"source": [
"# Using a colorscale name\n",
"simple.statistics.plot.balance('Heat', colors='Set2')"
- ],
- "outputs": [
- {
- "data": {
- "text/plain": [
- "PlotResult(data= Size: 7kB\n",
- "Dimensions: (time: 169)\n",
- "Coordinates:\n",
- " * time (time) datetime64[ns] 1kB 2024-01-15 ... 2024-...\n",
- "Data variables:\n",
- " Boiler(Heat) (time) float64 1kB -32.48 -29.31 ... -124.5 nan\n",
- " ThermalStorage(Discharge) (time) float64 1kB -0.0 5.275e-13 ... nan\n",
- " ThermalStorage(Charge) (time) float64 1kB 0.0 -3.748e-13 ... 100.0 nan\n",
- " Office(Heat) (time) float64 1kB 32.48 29.31 ... 24.48 nan, figure=Figure({\n",
- " 'data': [{'hovertemplate': 'variable=Boiler(Heat)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'Boiler(Heat)',\n",
- " 'marker': {'color': '#66c2a5', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'Boiler(Heat)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-15T00:00:00.000000000', '2024-01-15T01:00:00.000000000',\n",
- " '2024-01-15T02:00:00.000000000', '2024-01-15T03:00:00.000000000',\n",
- " '2024-01-15T04:00:00.000000000', '2024-01-15T05:00:00.000000000',\n",
- " '2024-01-15T06:00:00.000000000', '2024-01-15T07:00:00.000000000',\n",
- " '2024-01-15T08:00:00.000000000', '2024-01-15T09:00:00.000000000',\n",
- " '2024-01-15T10:00:00.000000000', '2024-01-15T11:00:00.000000000',\n",
- " '2024-01-15T12:00:00.000000000', '2024-01-15T13:00:00.000000000',\n",
- " '2024-01-15T14:00:00.000000000', '2024-01-15T15:00:00.000000000',\n",
- " '2024-01-15T16:00:00.000000000', '2024-01-15T17:00:00.000000000',\n",
- " '2024-01-15T18:00:00.000000000', '2024-01-15T19:00:00.000000000',\n",
- " '2024-01-15T20:00:00.000000000', '2024-01-15T21:00:00.000000000',\n",
- " '2024-01-15T22:00:00.000000000', '2024-01-15T23:00:00.000000000',\n",
- " '2024-01-16T00:00:00.000000000', '2024-01-16T01:00:00.000000000',\n",
- " '2024-01-16T02:00:00.000000000', '2024-01-16T03:00:00.000000000',\n",
- " '2024-01-16T04:00:00.000000000', '2024-01-16T05:00:00.000000000',\n",
- " '2024-01-16T06:00:00.000000000', '2024-01-16T07:00:00.000000000',\n",
- " '2024-01-16T08:00:00.000000000', '2024-01-16T09:00:00.000000000',\n",
- " '2024-01-16T10:00:00.000000000', '2024-01-16T11:00:00.000000000',\n",
- " '2024-01-16T12:00:00.000000000', '2024-01-16T13:00:00.000000000',\n",
- " '2024-01-16T14:00:00.000000000', '2024-01-16T15:00:00.000000000',\n",
- " '2024-01-16T16:00:00.000000000', '2024-01-16T17:00:00.000000000',\n",
- " '2024-01-16T18:00:00.000000000', '2024-01-16T19:00:00.000000000',\n",
- " '2024-01-16T20:00:00.000000000', '2024-01-16T21:00:00.000000000',\n",
- " '2024-01-16T22:00:00.000000000', '2024-01-16T23:00:00.000000000',\n",
- " '2024-01-17T00:00:00.000000000', '2024-01-17T01:00:00.000000000',\n",
- " '2024-01-17T02:00:00.000000000', '2024-01-17T03:00:00.000000000',\n",
- " '2024-01-17T04:00:00.000000000', '2024-01-17T05:00:00.000000000',\n",
- " '2024-01-17T06:00:00.000000000', '2024-01-17T07:00:00.000000000',\n",
- " '2024-01-17T08:00:00.000000000', '2024-01-17T09:00:00.000000000',\n",
- " '2024-01-17T10:00:00.000000000', '2024-01-17T11:00:00.000000000',\n",
- " '2024-01-17T12:00:00.000000000', '2024-01-17T13:00:00.000000000',\n",
- " '2024-01-17T14:00:00.000000000', '2024-01-17T15:00:00.000000000',\n",
- " '2024-01-17T16:00:00.000000000', '2024-01-17T17:00:00.000000000',\n",
- " '2024-01-17T18:00:00.000000000', '2024-01-17T19:00:00.000000000',\n",
- " '2024-01-17T20:00:00.000000000', '2024-01-17T21:00:00.000000000',\n",
- " '2024-01-17T22:00:00.000000000', '2024-01-17T23:00:00.000000000',\n",
- " '2024-01-18T00:00:00.000000000', '2024-01-18T01:00:00.000000000',\n",
- " '2024-01-18T02:00:00.000000000', '2024-01-18T03:00:00.000000000',\n",
- " '2024-01-18T04:00:00.000000000', '2024-01-18T05:00:00.000000000',\n",
- " '2024-01-18T06:00:00.000000000', '2024-01-18T07:00:00.000000000',\n",
- " '2024-01-18T08:00:00.000000000', '2024-01-18T09:00:00.000000000',\n",
- " '2024-01-18T10:00:00.000000000', '2024-01-18T11:00:00.000000000',\n",
- " '2024-01-18T12:00:00.000000000', '2024-01-18T13:00:00.000000000',\n",
- " '2024-01-18T14:00:00.000000000', '2024-01-18T15:00:00.000000000',\n",
- " '2024-01-18T16:00:00.000000000', '2024-01-18T17:00:00.000000000',\n",
- " '2024-01-18T18:00:00.000000000', '2024-01-18T19:00:00.000000000',\n",
- " '2024-01-18T20:00:00.000000000', '2024-01-18T21:00:00.000000000',\n",
- " '2024-01-18T22:00:00.000000000', '2024-01-18T23:00:00.000000000',\n",
- " '2024-01-19T00:00:00.000000000', '2024-01-19T01:00:00.000000000',\n",
- " '2024-01-19T02:00:00.000000000', '2024-01-19T03:00:00.000000000',\n",
- " '2024-01-19T04:00:00.000000000', '2024-01-19T05:00:00.000000000',\n",
- " '2024-01-19T06:00:00.000000000', '2024-01-19T07:00:00.000000000',\n",
- " '2024-01-19T08:00:00.000000000', '2024-01-19T09:00:00.000000000',\n",
- " '2024-01-19T10:00:00.000000000', '2024-01-19T11:00:00.000000000',\n",
- " '2024-01-19T12:00:00.000000000', '2024-01-19T13:00:00.000000000',\n",
- " '2024-01-19T14:00:00.000000000', '2024-01-19T15:00:00.000000000',\n",
- " '2024-01-19T16:00:00.000000000', '2024-01-19T17:00:00.000000000',\n",
- " '2024-01-19T18:00:00.000000000', '2024-01-19T19:00:00.000000000',\n",
- " '2024-01-19T20:00:00.000000000', '2024-01-19T21:00:00.000000000',\n",
- " '2024-01-19T22:00:00.000000000', '2024-01-19T23:00:00.000000000',\n",
- " '2024-01-20T00:00:00.000000000', '2024-01-20T01:00:00.000000000',\n",
- " '2024-01-20T02:00:00.000000000', '2024-01-20T03:00:00.000000000',\n",
- " '2024-01-20T04:00:00.000000000', '2024-01-20T05:00:00.000000000',\n",
- " '2024-01-20T06:00:00.000000000', '2024-01-20T07:00:00.000000000',\n",
- " '2024-01-20T08:00:00.000000000', '2024-01-20T09:00:00.000000000',\n",
- " '2024-01-20T10:00:00.000000000', '2024-01-20T11:00:00.000000000',\n",
- " '2024-01-20T12:00:00.000000000', '2024-01-20T13:00:00.000000000',\n",
- " '2024-01-20T14:00:00.000000000', '2024-01-20T15:00:00.000000000',\n",
- " '2024-01-20T16:00:00.000000000', '2024-01-20T17:00:00.000000000',\n",
- " '2024-01-20T18:00:00.000000000', '2024-01-20T19:00:00.000000000',\n",
- " '2024-01-20T20:00:00.000000000', '2024-01-20T21:00:00.000000000',\n",
- " '2024-01-20T22:00:00.000000000', '2024-01-20T23:00:00.000000000',\n",
- " '2024-01-21T00:00:00.000000000', '2024-01-21T01:00:00.000000000',\n",
- " '2024-01-21T02:00:00.000000000', '2024-01-21T03:00:00.000000000',\n",
- " '2024-01-21T04:00:00.000000000', '2024-01-21T05:00:00.000000000',\n",
- " '2024-01-21T06:00:00.000000000', '2024-01-21T07:00:00.000000000',\n",
- " '2024-01-21T08:00:00.000000000', '2024-01-21T09:00:00.000000000',\n",
- " '2024-01-21T10:00:00.000000000', '2024-01-21T11:00:00.000000000',\n",
- " '2024-01-21T12:00:00.000000000', '2024-01-21T13:00:00.000000000',\n",
- " '2024-01-21T14:00:00.000000000', '2024-01-21T15:00:00.000000000',\n",
- " '2024-01-21T16:00:00.000000000', '2024-01-21T17:00:00.000000000',\n",
- " '2024-01-21T18:00:00.000000000', '2024-01-21T19:00:00.000000000',\n",
- " '2024-01-21T20:00:00.000000000', '2024-01-21T21:00:00.000000000',\n",
- " '2024-01-21T22:00:00.000000000', '2024-01-21T23:00:00.000000000',\n",
- " '2024-01-22T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('5ZuWpeU9QMD3U8WNBU89wHjXQkqFnk' ... '////8zwPW5+Ef5Hl/AAAAAAAAA+P8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'variable=ThermalStorage(Discharge)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'ThermalStorage(Discharge)',\n",
- " 'marker': {'color': '#fc8d62', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'ThermalStorage(Discharge)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-15T00:00:00.000000000', '2024-01-15T01:00:00.000000000',\n",
- " '2024-01-15T02:00:00.000000000', '2024-01-15T03:00:00.000000000',\n",
- " '2024-01-15T04:00:00.000000000', '2024-01-15T05:00:00.000000000',\n",
- " '2024-01-15T06:00:00.000000000', '2024-01-15T07:00:00.000000000',\n",
- " '2024-01-15T08:00:00.000000000', '2024-01-15T09:00:00.000000000',\n",
- " '2024-01-15T10:00:00.000000000', '2024-01-15T11:00:00.000000000',\n",
- " '2024-01-15T12:00:00.000000000', '2024-01-15T13:00:00.000000000',\n",
- " '2024-01-15T14:00:00.000000000', '2024-01-15T15:00:00.000000000',\n",
- " '2024-01-15T16:00:00.000000000', '2024-01-15T17:00:00.000000000',\n",
- " '2024-01-15T18:00:00.000000000', '2024-01-15T19:00:00.000000000',\n",
- " '2024-01-15T20:00:00.000000000', '2024-01-15T21:00:00.000000000',\n",
- " '2024-01-15T22:00:00.000000000', '2024-01-15T23:00:00.000000000',\n",
- " '2024-01-16T00:00:00.000000000', '2024-01-16T01:00:00.000000000',\n",
- " '2024-01-16T02:00:00.000000000', '2024-01-16T03:00:00.000000000',\n",
- " '2024-01-16T04:00:00.000000000', '2024-01-16T05:00:00.000000000',\n",
- " '2024-01-16T06:00:00.000000000', '2024-01-16T07:00:00.000000000',\n",
- " '2024-01-16T08:00:00.000000000', '2024-01-16T09:00:00.000000000',\n",
- " '2024-01-16T10:00:00.000000000', '2024-01-16T11:00:00.000000000',\n",
- " '2024-01-16T12:00:00.000000000', '2024-01-16T13:00:00.000000000',\n",
- " '2024-01-16T14:00:00.000000000', '2024-01-16T15:00:00.000000000',\n",
- " '2024-01-16T16:00:00.000000000', '2024-01-16T17:00:00.000000000',\n",
- " '2024-01-16T18:00:00.000000000', '2024-01-16T19:00:00.000000000',\n",
- " '2024-01-16T20:00:00.000000000', '2024-01-16T21:00:00.000000000',\n",
- " '2024-01-16T22:00:00.000000000', '2024-01-16T23:00:00.000000000',\n",
- " '2024-01-17T00:00:00.000000000', '2024-01-17T01:00:00.000000000',\n",
- " '2024-01-17T02:00:00.000000000', '2024-01-17T03:00:00.000000000',\n",
- " '2024-01-17T04:00:00.000000000', '2024-01-17T05:00:00.000000000',\n",
- " '2024-01-17T06:00:00.000000000', '2024-01-17T07:00:00.000000000',\n",
- " '2024-01-17T08:00:00.000000000', '2024-01-17T09:00:00.000000000',\n",
- " '2024-01-17T10:00:00.000000000', '2024-01-17T11:00:00.000000000',\n",
- " '2024-01-17T12:00:00.000000000', '2024-01-17T13:00:00.000000000',\n",
- " '2024-01-17T14:00:00.000000000', '2024-01-17T15:00:00.000000000',\n",
- " '2024-01-17T16:00:00.000000000', '2024-01-17T17:00:00.000000000',\n",
- " '2024-01-17T18:00:00.000000000', '2024-01-17T19:00:00.000000000',\n",
- " '2024-01-17T20:00:00.000000000', '2024-01-17T21:00:00.000000000',\n",
- " '2024-01-17T22:00:00.000000000', '2024-01-17T23:00:00.000000000',\n",
- " '2024-01-18T00:00:00.000000000', '2024-01-18T01:00:00.000000000',\n",
- " '2024-01-18T02:00:00.000000000', '2024-01-18T03:00:00.000000000',\n",
- " '2024-01-18T04:00:00.000000000', '2024-01-18T05:00:00.000000000',\n",
- " '2024-01-18T06:00:00.000000000', '2024-01-18T07:00:00.000000000',\n",
- " '2024-01-18T08:00:00.000000000', '2024-01-18T09:00:00.000000000',\n",
- " '2024-01-18T10:00:00.000000000', '2024-01-18T11:00:00.000000000',\n",
- " '2024-01-18T12:00:00.000000000', '2024-01-18T13:00:00.000000000',\n",
- " '2024-01-18T14:00:00.000000000', '2024-01-18T15:00:00.000000000',\n",
- " '2024-01-18T16:00:00.000000000', '2024-01-18T17:00:00.000000000',\n",
- " '2024-01-18T18:00:00.000000000', '2024-01-18T19:00:00.000000000',\n",
- " '2024-01-18T20:00:00.000000000', '2024-01-18T21:00:00.000000000',\n",
- " '2024-01-18T22:00:00.000000000', '2024-01-18T23:00:00.000000000',\n",
- " '2024-01-19T00:00:00.000000000', '2024-01-19T01:00:00.000000000',\n",
- " '2024-01-19T02:00:00.000000000', '2024-01-19T03:00:00.000000000',\n",
- " '2024-01-19T04:00:00.000000000', '2024-01-19T05:00:00.000000000',\n",
- " '2024-01-19T06:00:00.000000000', '2024-01-19T07:00:00.000000000',\n",
- " '2024-01-19T08:00:00.000000000', '2024-01-19T09:00:00.000000000',\n",
- " '2024-01-19T10:00:00.000000000', '2024-01-19T11:00:00.000000000',\n",
- " '2024-01-19T12:00:00.000000000', '2024-01-19T13:00:00.000000000',\n",
- " '2024-01-19T14:00:00.000000000', '2024-01-19T15:00:00.000000000',\n",
- " '2024-01-19T16:00:00.000000000', '2024-01-19T17:00:00.000000000',\n",
- " '2024-01-19T18:00:00.000000000', '2024-01-19T19:00:00.000000000',\n",
- " '2024-01-19T20:00:00.000000000', '2024-01-19T21:00:00.000000000',\n",
- " '2024-01-19T22:00:00.000000000', '2024-01-19T23:00:00.000000000',\n",
- " '2024-01-20T00:00:00.000000000', '2024-01-20T01:00:00.000000000',\n",
- " '2024-01-20T02:00:00.000000000', '2024-01-20T03:00:00.000000000',\n",
- " '2024-01-20T04:00:00.000000000', '2024-01-20T05:00:00.000000000',\n",
- " '2024-01-20T06:00:00.000000000', '2024-01-20T07:00:00.000000000',\n",
- " '2024-01-20T08:00:00.000000000', '2024-01-20T09:00:00.000000000',\n",
- " '2024-01-20T10:00:00.000000000', '2024-01-20T11:00:00.000000000',\n",
- " '2024-01-20T12:00:00.000000000', '2024-01-20T13:00:00.000000000',\n",
- " '2024-01-20T14:00:00.000000000', '2024-01-20T15:00:00.000000000',\n",
- " '2024-01-20T16:00:00.000000000', '2024-01-20T17:00:00.000000000',\n",
- " '2024-01-20T18:00:00.000000000', '2024-01-20T19:00:00.000000000',\n",
- " '2024-01-20T20:00:00.000000000', '2024-01-20T21:00:00.000000000',\n",
- " '2024-01-20T22:00:00.000000000', '2024-01-20T23:00:00.000000000',\n",
- " '2024-01-21T00:00:00.000000000', '2024-01-21T01:00:00.000000000',\n",
- " '2024-01-21T02:00:00.000000000', '2024-01-21T03:00:00.000000000',\n",
- " '2024-01-21T04:00:00.000000000', '2024-01-21T05:00:00.000000000',\n",
- " '2024-01-21T06:00:00.000000000', '2024-01-21T07:00:00.000000000',\n",
- " '2024-01-21T08:00:00.000000000', '2024-01-21T09:00:00.000000000',\n",
- " '2024-01-21T10:00:00.000000000', '2024-01-21T11:00:00.000000000',\n",
- " '2024-01-21T12:00:00.000000000', '2024-01-21T13:00:00.000000000',\n",
- " '2024-01-21T14:00:00.000000000', '2024-01-21T15:00:00.000000000',\n",
- " '2024-01-21T16:00:00.000000000', '2024-01-21T17:00:00.000000000',\n",
- " '2024-01-21T18:00:00.000000000', '2024-01-21T19:00:00.000000000',\n",
- " '2024-01-21T20:00:00.000000000', '2024-01-21T21:00:00.000000000',\n",
- " '2024-01-21T22:00:00.000000000', '2024-01-21T23:00:00.000000000',\n",
- " '2024-01-22T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('AAAAAAAAAIAKPvjgg49iPby8nSEx72' ... 'AAAAAgvWP9SoFav2g9AAAAAAAA+P8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'variable=ThermalStorage(Charge)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'ThermalStorage(Charge)',\n",
- " 'marker': {'color': '#8da0cb', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'ThermalStorage(Charge)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-15T00:00:00.000000000', '2024-01-15T01:00:00.000000000',\n",
- " '2024-01-15T02:00:00.000000000', '2024-01-15T03:00:00.000000000',\n",
- " '2024-01-15T04:00:00.000000000', '2024-01-15T05:00:00.000000000',\n",
- " '2024-01-15T06:00:00.000000000', '2024-01-15T07:00:00.000000000',\n",
- " '2024-01-15T08:00:00.000000000', '2024-01-15T09:00:00.000000000',\n",
- " '2024-01-15T10:00:00.000000000', '2024-01-15T11:00:00.000000000',\n",
- " '2024-01-15T12:00:00.000000000', '2024-01-15T13:00:00.000000000',\n",
- " '2024-01-15T14:00:00.000000000', '2024-01-15T15:00:00.000000000',\n",
- " '2024-01-15T16:00:00.000000000', '2024-01-15T17:00:00.000000000',\n",
- " '2024-01-15T18:00:00.000000000', '2024-01-15T19:00:00.000000000',\n",
- " '2024-01-15T20:00:00.000000000', '2024-01-15T21:00:00.000000000',\n",
- " '2024-01-15T22:00:00.000000000', '2024-01-15T23:00:00.000000000',\n",
- " '2024-01-16T00:00:00.000000000', '2024-01-16T01:00:00.000000000',\n",
- " '2024-01-16T02:00:00.000000000', '2024-01-16T03:00:00.000000000',\n",
- " '2024-01-16T04:00:00.000000000', '2024-01-16T05:00:00.000000000',\n",
- " '2024-01-16T06:00:00.000000000', '2024-01-16T07:00:00.000000000',\n",
- " '2024-01-16T08:00:00.000000000', '2024-01-16T09:00:00.000000000',\n",
- " '2024-01-16T10:00:00.000000000', '2024-01-16T11:00:00.000000000',\n",
- " '2024-01-16T12:00:00.000000000', '2024-01-16T13:00:00.000000000',\n",
- " '2024-01-16T14:00:00.000000000', '2024-01-16T15:00:00.000000000',\n",
- " '2024-01-16T16:00:00.000000000', '2024-01-16T17:00:00.000000000',\n",
- " '2024-01-16T18:00:00.000000000', '2024-01-16T19:00:00.000000000',\n",
- " '2024-01-16T20:00:00.000000000', '2024-01-16T21:00:00.000000000',\n",
- " '2024-01-16T22:00:00.000000000', '2024-01-16T23:00:00.000000000',\n",
- " '2024-01-17T00:00:00.000000000', '2024-01-17T01:00:00.000000000',\n",
- " '2024-01-17T02:00:00.000000000', '2024-01-17T03:00:00.000000000',\n",
- " '2024-01-17T04:00:00.000000000', '2024-01-17T05:00:00.000000000',\n",
- " '2024-01-17T06:00:00.000000000', '2024-01-17T07:00:00.000000000',\n",
- " '2024-01-17T08:00:00.000000000', '2024-01-17T09:00:00.000000000',\n",
- " '2024-01-17T10:00:00.000000000', '2024-01-17T11:00:00.000000000',\n",
- " '2024-01-17T12:00:00.000000000', '2024-01-17T13:00:00.000000000',\n",
- " '2024-01-17T14:00:00.000000000', '2024-01-17T15:00:00.000000000',\n",
- " '2024-01-17T16:00:00.000000000', '2024-01-17T17:00:00.000000000',\n",
- " '2024-01-17T18:00:00.000000000', '2024-01-17T19:00:00.000000000',\n",
- " '2024-01-17T20:00:00.000000000', '2024-01-17T21:00:00.000000000',\n",
- " '2024-01-17T22:00:00.000000000', '2024-01-17T23:00:00.000000000',\n",
- " '2024-01-18T00:00:00.000000000', '2024-01-18T01:00:00.000000000',\n",
- " '2024-01-18T02:00:00.000000000', '2024-01-18T03:00:00.000000000',\n",
- " '2024-01-18T04:00:00.000000000', '2024-01-18T05:00:00.000000000',\n",
- " '2024-01-18T06:00:00.000000000', '2024-01-18T07:00:00.000000000',\n",
- " '2024-01-18T08:00:00.000000000', '2024-01-18T09:00:00.000000000',\n",
- " '2024-01-18T10:00:00.000000000', '2024-01-18T11:00:00.000000000',\n",
- " '2024-01-18T12:00:00.000000000', '2024-01-18T13:00:00.000000000',\n",
- " '2024-01-18T14:00:00.000000000', '2024-01-18T15:00:00.000000000',\n",
- " '2024-01-18T16:00:00.000000000', '2024-01-18T17:00:00.000000000',\n",
- " '2024-01-18T18:00:00.000000000', '2024-01-18T19:00:00.000000000',\n",
- " '2024-01-18T20:00:00.000000000', '2024-01-18T21:00:00.000000000',\n",
- " '2024-01-18T22:00:00.000000000', '2024-01-18T23:00:00.000000000',\n",
- " '2024-01-19T00:00:00.000000000', '2024-01-19T01:00:00.000000000',\n",
- " '2024-01-19T02:00:00.000000000', '2024-01-19T03:00:00.000000000',\n",
- " '2024-01-19T04:00:00.000000000', '2024-01-19T05:00:00.000000000',\n",
- " '2024-01-19T06:00:00.000000000', '2024-01-19T07:00:00.000000000',\n",
- " '2024-01-19T08:00:00.000000000', '2024-01-19T09:00:00.000000000',\n",
- " '2024-01-19T10:00:00.000000000', '2024-01-19T11:00:00.000000000',\n",
- " '2024-01-19T12:00:00.000000000', '2024-01-19T13:00:00.000000000',\n",
- " '2024-01-19T14:00:00.000000000', '2024-01-19T15:00:00.000000000',\n",
- " '2024-01-19T16:00:00.000000000', '2024-01-19T17:00:00.000000000',\n",
- " '2024-01-19T18:00:00.000000000', '2024-01-19T19:00:00.000000000',\n",
- " '2024-01-19T20:00:00.000000000', '2024-01-19T21:00:00.000000000',\n",
- " '2024-01-19T22:00:00.000000000', '2024-01-19T23:00:00.000000000',\n",
- " '2024-01-20T00:00:00.000000000', '2024-01-20T01:00:00.000000000',\n",
- " '2024-01-20T02:00:00.000000000', '2024-01-20T03:00:00.000000000',\n",
- " '2024-01-20T04:00:00.000000000', '2024-01-20T05:00:00.000000000',\n",
- " '2024-01-20T06:00:00.000000000', '2024-01-20T07:00:00.000000000',\n",
- " '2024-01-20T08:00:00.000000000', '2024-01-20T09:00:00.000000000',\n",
- " '2024-01-20T10:00:00.000000000', '2024-01-20T11:00:00.000000000',\n",
- " '2024-01-20T12:00:00.000000000', '2024-01-20T13:00:00.000000000',\n",
- " '2024-01-20T14:00:00.000000000', '2024-01-20T15:00:00.000000000',\n",
- " '2024-01-20T16:00:00.000000000', '2024-01-20T17:00:00.000000000',\n",
- " '2024-01-20T18:00:00.000000000', '2024-01-20T19:00:00.000000000',\n",
- " '2024-01-20T20:00:00.000000000', '2024-01-20T21:00:00.000000000',\n",
- " '2024-01-20T22:00:00.000000000', '2024-01-20T23:00:00.000000000',\n",
- " '2024-01-21T00:00:00.000000000', '2024-01-21T01:00:00.000000000',\n",
- " '2024-01-21T02:00:00.000000000', '2024-01-21T03:00:00.000000000',\n",
- " '2024-01-21T04:00:00.000000000', '2024-01-21T05:00:00.000000000',\n",
- " '2024-01-21T06:00:00.000000000', '2024-01-21T07:00:00.000000000',\n",
- " '2024-01-21T08:00:00.000000000', '2024-01-21T09:00:00.000000000',\n",
- " '2024-01-21T10:00:00.000000000', '2024-01-21T11:00:00.000000000',\n",
- " '2024-01-21T12:00:00.000000000', '2024-01-21T13:00:00.000000000',\n",
- " '2024-01-21T14:00:00.000000000', '2024-01-21T15:00:00.000000000',\n",
- " '2024-01-21T16:00:00.000000000', '2024-01-21T17:00:00.000000000',\n",
- " '2024-01-21T18:00:00.000000000', '2024-01-21T19:00:00.000000000',\n",
- " '2024-01-21T20:00:00.000000000', '2024-01-21T21:00:00.000000000',\n",
- " '2024-01-21T22:00:00.000000000', '2024-01-21T23:00:00.000000000',\n",
- " '2024-01-22T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('AAAAAAAAAAAUfPDBB19avby8nSEx72' ... 'AAAAAAANj//////1hAAAAAAAAA+H8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'variable=Office(Heat)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'Office(Heat)',\n",
- " 'marker': {'color': '#e78ac3', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'Office(Heat)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-15T00:00:00.000000000', '2024-01-15T01:00:00.000000000',\n",
- " '2024-01-15T02:00:00.000000000', '2024-01-15T03:00:00.000000000',\n",
- " '2024-01-15T04:00:00.000000000', '2024-01-15T05:00:00.000000000',\n",
- " '2024-01-15T06:00:00.000000000', '2024-01-15T07:00:00.000000000',\n",
- " '2024-01-15T08:00:00.000000000', '2024-01-15T09:00:00.000000000',\n",
- " '2024-01-15T10:00:00.000000000', '2024-01-15T11:00:00.000000000',\n",
- " '2024-01-15T12:00:00.000000000', '2024-01-15T13:00:00.000000000',\n",
- " '2024-01-15T14:00:00.000000000', '2024-01-15T15:00:00.000000000',\n",
- " '2024-01-15T16:00:00.000000000', '2024-01-15T17:00:00.000000000',\n",
- " '2024-01-15T18:00:00.000000000', '2024-01-15T19:00:00.000000000',\n",
- " '2024-01-15T20:00:00.000000000', '2024-01-15T21:00:00.000000000',\n",
- " '2024-01-15T22:00:00.000000000', '2024-01-15T23:00:00.000000000',\n",
- " '2024-01-16T00:00:00.000000000', '2024-01-16T01:00:00.000000000',\n",
- " '2024-01-16T02:00:00.000000000', '2024-01-16T03:00:00.000000000',\n",
- " '2024-01-16T04:00:00.000000000', '2024-01-16T05:00:00.000000000',\n",
- " '2024-01-16T06:00:00.000000000', '2024-01-16T07:00:00.000000000',\n",
- " '2024-01-16T08:00:00.000000000', '2024-01-16T09:00:00.000000000',\n",
- " '2024-01-16T10:00:00.000000000', '2024-01-16T11:00:00.000000000',\n",
- " '2024-01-16T12:00:00.000000000', '2024-01-16T13:00:00.000000000',\n",
- " '2024-01-16T14:00:00.000000000', '2024-01-16T15:00:00.000000000',\n",
- " '2024-01-16T16:00:00.000000000', '2024-01-16T17:00:00.000000000',\n",
- " '2024-01-16T18:00:00.000000000', '2024-01-16T19:00:00.000000000',\n",
- " '2024-01-16T20:00:00.000000000', '2024-01-16T21:00:00.000000000',\n",
- " '2024-01-16T22:00:00.000000000', '2024-01-16T23:00:00.000000000',\n",
- " '2024-01-17T00:00:00.000000000', '2024-01-17T01:00:00.000000000',\n",
- " '2024-01-17T02:00:00.000000000', '2024-01-17T03:00:00.000000000',\n",
- " '2024-01-17T04:00:00.000000000', '2024-01-17T05:00:00.000000000',\n",
- " '2024-01-17T06:00:00.000000000', '2024-01-17T07:00:00.000000000',\n",
- " '2024-01-17T08:00:00.000000000', '2024-01-17T09:00:00.000000000',\n",
- " '2024-01-17T10:00:00.000000000', '2024-01-17T11:00:00.000000000',\n",
- " '2024-01-17T12:00:00.000000000', '2024-01-17T13:00:00.000000000',\n",
- " '2024-01-17T14:00:00.000000000', '2024-01-17T15:00:00.000000000',\n",
- " '2024-01-17T16:00:00.000000000', '2024-01-17T17:00:00.000000000',\n",
- " '2024-01-17T18:00:00.000000000', '2024-01-17T19:00:00.000000000',\n",
- " '2024-01-17T20:00:00.000000000', '2024-01-17T21:00:00.000000000',\n",
- " '2024-01-17T22:00:00.000000000', '2024-01-17T23:00:00.000000000',\n",
- " '2024-01-18T00:00:00.000000000', '2024-01-18T01:00:00.000000000',\n",
- " '2024-01-18T02:00:00.000000000', '2024-01-18T03:00:00.000000000',\n",
- " '2024-01-18T04:00:00.000000000', '2024-01-18T05:00:00.000000000',\n",
- " '2024-01-18T06:00:00.000000000', '2024-01-18T07:00:00.000000000',\n",
- " '2024-01-18T08:00:00.000000000', '2024-01-18T09:00:00.000000000',\n",
- " '2024-01-18T10:00:00.000000000', '2024-01-18T11:00:00.000000000',\n",
- " '2024-01-18T12:00:00.000000000', '2024-01-18T13:00:00.000000000',\n",
- " '2024-01-18T14:00:00.000000000', '2024-01-18T15:00:00.000000000',\n",
- " '2024-01-18T16:00:00.000000000', '2024-01-18T17:00:00.000000000',\n",
- " '2024-01-18T18:00:00.000000000', '2024-01-18T19:00:00.000000000',\n",
- " '2024-01-18T20:00:00.000000000', '2024-01-18T21:00:00.000000000',\n",
- " '2024-01-18T22:00:00.000000000', '2024-01-18T23:00:00.000000000',\n",
- " '2024-01-19T00:00:00.000000000', '2024-01-19T01:00:00.000000000',\n",
- " '2024-01-19T02:00:00.000000000', '2024-01-19T03:00:00.000000000',\n",
- " '2024-01-19T04:00:00.000000000', '2024-01-19T05:00:00.000000000',\n",
- " '2024-01-19T06:00:00.000000000', '2024-01-19T07:00:00.000000000',\n",
- " '2024-01-19T08:00:00.000000000', '2024-01-19T09:00:00.000000000',\n",
- " '2024-01-19T10:00:00.000000000', '2024-01-19T11:00:00.000000000',\n",
- " '2024-01-19T12:00:00.000000000', '2024-01-19T13:00:00.000000000',\n",
- " '2024-01-19T14:00:00.000000000', '2024-01-19T15:00:00.000000000',\n",
- " '2024-01-19T16:00:00.000000000', '2024-01-19T17:00:00.000000000',\n",
- " '2024-01-19T18:00:00.000000000', '2024-01-19T19:00:00.000000000',\n",
- " '2024-01-19T20:00:00.000000000', '2024-01-19T21:00:00.000000000',\n",
- " '2024-01-19T22:00:00.000000000', '2024-01-19T23:00:00.000000000',\n",
- " '2024-01-20T00:00:00.000000000', '2024-01-20T01:00:00.000000000',\n",
- " '2024-01-20T02:00:00.000000000', '2024-01-20T03:00:00.000000000',\n",
- " '2024-01-20T04:00:00.000000000', '2024-01-20T05:00:00.000000000',\n",
- " '2024-01-20T06:00:00.000000000', '2024-01-20T07:00:00.000000000',\n",
- " '2024-01-20T08:00:00.000000000', '2024-01-20T09:00:00.000000000',\n",
- " '2024-01-20T10:00:00.000000000', '2024-01-20T11:00:00.000000000',\n",
- " '2024-01-20T12:00:00.000000000', '2024-01-20T13:00:00.000000000',\n",
- " '2024-01-20T14:00:00.000000000', '2024-01-20T15:00:00.000000000',\n",
- " '2024-01-20T16:00:00.000000000', '2024-01-20T17:00:00.000000000',\n",
- " '2024-01-20T18:00:00.000000000', '2024-01-20T19:00:00.000000000',\n",
- " '2024-01-20T20:00:00.000000000', '2024-01-20T21:00:00.000000000',\n",
- " '2024-01-20T22:00:00.000000000', '2024-01-20T23:00:00.000000000',\n",
- " '2024-01-21T00:00:00.000000000', '2024-01-21T01:00:00.000000000',\n",
- " '2024-01-21T02:00:00.000000000', '2024-01-21T03:00:00.000000000',\n",
- " '2024-01-21T04:00:00.000000000', '2024-01-21T05:00:00.000000000',\n",
- " '2024-01-21T06:00:00.000000000', '2024-01-21T07:00:00.000000000',\n",
- " '2024-01-21T08:00:00.000000000', '2024-01-21T09:00:00.000000000',\n",
- " '2024-01-21T10:00:00.000000000', '2024-01-21T11:00:00.000000000',\n",
- " '2024-01-21T12:00:00.000000000', '2024-01-21T13:00:00.000000000',\n",
- " '2024-01-21T14:00:00.000000000', '2024-01-21T15:00:00.000000000',\n",
- " '2024-01-21T16:00:00.000000000', '2024-01-21T17:00:00.000000000',\n",
- " '2024-01-21T18:00:00.000000000', '2024-01-21T19:00:00.000000000',\n",
- " '2024-01-21T20:00:00.000000000', '2024-01-21T21:00:00.000000000',\n",
- " '2024-01-21T22:00:00.000000000', '2024-01-21T23:00:00.000000000',\n",
- " '2024-01-22T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('5ZuWpeU9QEDMU8WNBU89QGDXQkqFnk' ... 'AAAAA0QK7n4h/lezhAAAAAAAAA+H8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'}],\n",
- " 'layout': {'bargap': 0,\n",
- " 'bargroupgap': 0,\n",
- " 'barmode': 'relative',\n",
- " 'legend': {'title': {'text': 'variable'}, 'tracegroupgap': 0},\n",
- " 'template': '...',\n",
- " 'title': {'text': 'Heat (flow_rate)'},\n",
- " 'xaxis': {'anchor': 'y', 'domain': [0.0, 1.0], 'title': {'text': 'time'}},\n",
- " 'yaxis': {'anchor': 'x', 'domain': [0.0, 1.0], 'title': {'text': 'value'}}}\n",
- "}))"
- ],
- "text/html": [
- ""
- ]
- },
- "execution_count": 37,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "execution_count": 37
+ ]
},
{
"cell_type": "code",
- "id": "76",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T14:13:18.619651Z",
- "start_time": "2025-12-13T14:13:18.562286Z"
- }
- },
+ "execution_count": null,
+ "id": "66",
+ "metadata": {},
+ "outputs": [],
"source": [
"# Using a list of colors\n",
"simple.statistics.plot.balance('Heat', colors=['#e41a1c', '#377eb8', '#4daf4a', '#984ea3'])"
- ],
- "outputs": [
- {
- "data": {
- "text/plain": [
- "PlotResult(data= Size: 7kB\n",
- "Dimensions: (time: 169)\n",
- "Coordinates:\n",
- " * time (time) datetime64[ns] 1kB 2024-01-15 ... 2024-...\n",
- "Data variables:\n",
- " Boiler(Heat) (time) float64 1kB -32.48 -29.31 ... -124.5 nan\n",
- " ThermalStorage(Discharge) (time) float64 1kB -0.0 5.275e-13 ... nan\n",
- " ThermalStorage(Charge) (time) float64 1kB 0.0 -3.748e-13 ... 100.0 nan\n",
- " Office(Heat) (time) float64 1kB 32.48 29.31 ... 24.48 nan, figure=Figure({\n",
- " 'data': [{'hovertemplate': 'variable=Boiler(Heat)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'Boiler(Heat)',\n",
- " 'marker': {'color': '#e41a1c', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'Boiler(Heat)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-15T00:00:00.000000000', '2024-01-15T01:00:00.000000000',\n",
- " '2024-01-15T02:00:00.000000000', '2024-01-15T03:00:00.000000000',\n",
- " '2024-01-15T04:00:00.000000000', '2024-01-15T05:00:00.000000000',\n",
- " '2024-01-15T06:00:00.000000000', '2024-01-15T07:00:00.000000000',\n",
- " '2024-01-15T08:00:00.000000000', '2024-01-15T09:00:00.000000000',\n",
- " '2024-01-15T10:00:00.000000000', '2024-01-15T11:00:00.000000000',\n",
- " '2024-01-15T12:00:00.000000000', '2024-01-15T13:00:00.000000000',\n",
- " '2024-01-15T14:00:00.000000000', '2024-01-15T15:00:00.000000000',\n",
- " '2024-01-15T16:00:00.000000000', '2024-01-15T17:00:00.000000000',\n",
- " '2024-01-15T18:00:00.000000000', '2024-01-15T19:00:00.000000000',\n",
- " '2024-01-15T20:00:00.000000000', '2024-01-15T21:00:00.000000000',\n",
- " '2024-01-15T22:00:00.000000000', '2024-01-15T23:00:00.000000000',\n",
- " '2024-01-16T00:00:00.000000000', '2024-01-16T01:00:00.000000000',\n",
- " '2024-01-16T02:00:00.000000000', '2024-01-16T03:00:00.000000000',\n",
- " '2024-01-16T04:00:00.000000000', '2024-01-16T05:00:00.000000000',\n",
- " '2024-01-16T06:00:00.000000000', '2024-01-16T07:00:00.000000000',\n",
- " '2024-01-16T08:00:00.000000000', '2024-01-16T09:00:00.000000000',\n",
- " '2024-01-16T10:00:00.000000000', '2024-01-16T11:00:00.000000000',\n",
- " '2024-01-16T12:00:00.000000000', '2024-01-16T13:00:00.000000000',\n",
- " '2024-01-16T14:00:00.000000000', '2024-01-16T15:00:00.000000000',\n",
- " '2024-01-16T16:00:00.000000000', '2024-01-16T17:00:00.000000000',\n",
- " '2024-01-16T18:00:00.000000000', '2024-01-16T19:00:00.000000000',\n",
- " '2024-01-16T20:00:00.000000000', '2024-01-16T21:00:00.000000000',\n",
- " '2024-01-16T22:00:00.000000000', '2024-01-16T23:00:00.000000000',\n",
- " '2024-01-17T00:00:00.000000000', '2024-01-17T01:00:00.000000000',\n",
- " '2024-01-17T02:00:00.000000000', '2024-01-17T03:00:00.000000000',\n",
- " '2024-01-17T04:00:00.000000000', '2024-01-17T05:00:00.000000000',\n",
- " '2024-01-17T06:00:00.000000000', '2024-01-17T07:00:00.000000000',\n",
- " '2024-01-17T08:00:00.000000000', '2024-01-17T09:00:00.000000000',\n",
- " '2024-01-17T10:00:00.000000000', '2024-01-17T11:00:00.000000000',\n",
- " '2024-01-17T12:00:00.000000000', '2024-01-17T13:00:00.000000000',\n",
- " '2024-01-17T14:00:00.000000000', '2024-01-17T15:00:00.000000000',\n",
- " '2024-01-17T16:00:00.000000000', '2024-01-17T17:00:00.000000000',\n",
- " '2024-01-17T18:00:00.000000000', '2024-01-17T19:00:00.000000000',\n",
- " '2024-01-17T20:00:00.000000000', '2024-01-17T21:00:00.000000000',\n",
- " '2024-01-17T22:00:00.000000000', '2024-01-17T23:00:00.000000000',\n",
- " '2024-01-18T00:00:00.000000000', '2024-01-18T01:00:00.000000000',\n",
- " '2024-01-18T02:00:00.000000000', '2024-01-18T03:00:00.000000000',\n",
- " '2024-01-18T04:00:00.000000000', '2024-01-18T05:00:00.000000000',\n",
- " '2024-01-18T06:00:00.000000000', '2024-01-18T07:00:00.000000000',\n",
- " '2024-01-18T08:00:00.000000000', '2024-01-18T09:00:00.000000000',\n",
- " '2024-01-18T10:00:00.000000000', '2024-01-18T11:00:00.000000000',\n",
- " '2024-01-18T12:00:00.000000000', '2024-01-18T13:00:00.000000000',\n",
- " '2024-01-18T14:00:00.000000000', '2024-01-18T15:00:00.000000000',\n",
- " '2024-01-18T16:00:00.000000000', '2024-01-18T17:00:00.000000000',\n",
- " '2024-01-18T18:00:00.000000000', '2024-01-18T19:00:00.000000000',\n",
- " '2024-01-18T20:00:00.000000000', '2024-01-18T21:00:00.000000000',\n",
- " '2024-01-18T22:00:00.000000000', '2024-01-18T23:00:00.000000000',\n",
- " '2024-01-19T00:00:00.000000000', '2024-01-19T01:00:00.000000000',\n",
- " '2024-01-19T02:00:00.000000000', '2024-01-19T03:00:00.000000000',\n",
- " '2024-01-19T04:00:00.000000000', '2024-01-19T05:00:00.000000000',\n",
- " '2024-01-19T06:00:00.000000000', '2024-01-19T07:00:00.000000000',\n",
- " '2024-01-19T08:00:00.000000000', '2024-01-19T09:00:00.000000000',\n",
- " '2024-01-19T10:00:00.000000000', '2024-01-19T11:00:00.000000000',\n",
- " '2024-01-19T12:00:00.000000000', '2024-01-19T13:00:00.000000000',\n",
- " '2024-01-19T14:00:00.000000000', '2024-01-19T15:00:00.000000000',\n",
- " '2024-01-19T16:00:00.000000000', '2024-01-19T17:00:00.000000000',\n",
- " '2024-01-19T18:00:00.000000000', '2024-01-19T19:00:00.000000000',\n",
- " '2024-01-19T20:00:00.000000000', '2024-01-19T21:00:00.000000000',\n",
- " '2024-01-19T22:00:00.000000000', '2024-01-19T23:00:00.000000000',\n",
- " '2024-01-20T00:00:00.000000000', '2024-01-20T01:00:00.000000000',\n",
- " '2024-01-20T02:00:00.000000000', '2024-01-20T03:00:00.000000000',\n",
- " '2024-01-20T04:00:00.000000000', '2024-01-20T05:00:00.000000000',\n",
- " '2024-01-20T06:00:00.000000000', '2024-01-20T07:00:00.000000000',\n",
- " '2024-01-20T08:00:00.000000000', '2024-01-20T09:00:00.000000000',\n",
- " '2024-01-20T10:00:00.000000000', '2024-01-20T11:00:00.000000000',\n",
- " '2024-01-20T12:00:00.000000000', '2024-01-20T13:00:00.000000000',\n",
- " '2024-01-20T14:00:00.000000000', '2024-01-20T15:00:00.000000000',\n",
- " '2024-01-20T16:00:00.000000000', '2024-01-20T17:00:00.000000000',\n",
- " '2024-01-20T18:00:00.000000000', '2024-01-20T19:00:00.000000000',\n",
- " '2024-01-20T20:00:00.000000000', '2024-01-20T21:00:00.000000000',\n",
- " '2024-01-20T22:00:00.000000000', '2024-01-20T23:00:00.000000000',\n",
- " '2024-01-21T00:00:00.000000000', '2024-01-21T01:00:00.000000000',\n",
- " '2024-01-21T02:00:00.000000000', '2024-01-21T03:00:00.000000000',\n",
- " '2024-01-21T04:00:00.000000000', '2024-01-21T05:00:00.000000000',\n",
- " '2024-01-21T06:00:00.000000000', '2024-01-21T07:00:00.000000000',\n",
- " '2024-01-21T08:00:00.000000000', '2024-01-21T09:00:00.000000000',\n",
- " '2024-01-21T10:00:00.000000000', '2024-01-21T11:00:00.000000000',\n",
- " '2024-01-21T12:00:00.000000000', '2024-01-21T13:00:00.000000000',\n",
- " '2024-01-21T14:00:00.000000000', '2024-01-21T15:00:00.000000000',\n",
- " '2024-01-21T16:00:00.000000000', '2024-01-21T17:00:00.000000000',\n",
- " '2024-01-21T18:00:00.000000000', '2024-01-21T19:00:00.000000000',\n",
- " '2024-01-21T20:00:00.000000000', '2024-01-21T21:00:00.000000000',\n",
- " '2024-01-21T22:00:00.000000000', '2024-01-21T23:00:00.000000000',\n",
- " '2024-01-22T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('5ZuWpeU9QMD3U8WNBU89wHjXQkqFnk' ... '////8zwPW5+Ef5Hl/AAAAAAAAA+P8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'variable=ThermalStorage(Discharge)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'ThermalStorage(Discharge)',\n",
- " 'marker': {'color': '#377eb8', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'ThermalStorage(Discharge)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-15T00:00:00.000000000', '2024-01-15T01:00:00.000000000',\n",
- " '2024-01-15T02:00:00.000000000', '2024-01-15T03:00:00.000000000',\n",
- " '2024-01-15T04:00:00.000000000', '2024-01-15T05:00:00.000000000',\n",
- " '2024-01-15T06:00:00.000000000', '2024-01-15T07:00:00.000000000',\n",
- " '2024-01-15T08:00:00.000000000', '2024-01-15T09:00:00.000000000',\n",
- " '2024-01-15T10:00:00.000000000', '2024-01-15T11:00:00.000000000',\n",
- " '2024-01-15T12:00:00.000000000', '2024-01-15T13:00:00.000000000',\n",
- " '2024-01-15T14:00:00.000000000', '2024-01-15T15:00:00.000000000',\n",
- " '2024-01-15T16:00:00.000000000', '2024-01-15T17:00:00.000000000',\n",
- " '2024-01-15T18:00:00.000000000', '2024-01-15T19:00:00.000000000',\n",
- " '2024-01-15T20:00:00.000000000', '2024-01-15T21:00:00.000000000',\n",
- " '2024-01-15T22:00:00.000000000', '2024-01-15T23:00:00.000000000',\n",
- " '2024-01-16T00:00:00.000000000', '2024-01-16T01:00:00.000000000',\n",
- " '2024-01-16T02:00:00.000000000', '2024-01-16T03:00:00.000000000',\n",
- " '2024-01-16T04:00:00.000000000', '2024-01-16T05:00:00.000000000',\n",
- " '2024-01-16T06:00:00.000000000', '2024-01-16T07:00:00.000000000',\n",
- " '2024-01-16T08:00:00.000000000', '2024-01-16T09:00:00.000000000',\n",
- " '2024-01-16T10:00:00.000000000', '2024-01-16T11:00:00.000000000',\n",
- " '2024-01-16T12:00:00.000000000', '2024-01-16T13:00:00.000000000',\n",
- " '2024-01-16T14:00:00.000000000', '2024-01-16T15:00:00.000000000',\n",
- " '2024-01-16T16:00:00.000000000', '2024-01-16T17:00:00.000000000',\n",
- " '2024-01-16T18:00:00.000000000', '2024-01-16T19:00:00.000000000',\n",
- " '2024-01-16T20:00:00.000000000', '2024-01-16T21:00:00.000000000',\n",
- " '2024-01-16T22:00:00.000000000', '2024-01-16T23:00:00.000000000',\n",
- " '2024-01-17T00:00:00.000000000', '2024-01-17T01:00:00.000000000',\n",
- " '2024-01-17T02:00:00.000000000', '2024-01-17T03:00:00.000000000',\n",
- " '2024-01-17T04:00:00.000000000', '2024-01-17T05:00:00.000000000',\n",
- " '2024-01-17T06:00:00.000000000', '2024-01-17T07:00:00.000000000',\n",
- " '2024-01-17T08:00:00.000000000', '2024-01-17T09:00:00.000000000',\n",
- " '2024-01-17T10:00:00.000000000', '2024-01-17T11:00:00.000000000',\n",
- " '2024-01-17T12:00:00.000000000', '2024-01-17T13:00:00.000000000',\n",
- " '2024-01-17T14:00:00.000000000', '2024-01-17T15:00:00.000000000',\n",
- " '2024-01-17T16:00:00.000000000', '2024-01-17T17:00:00.000000000',\n",
- " '2024-01-17T18:00:00.000000000', '2024-01-17T19:00:00.000000000',\n",
- " '2024-01-17T20:00:00.000000000', '2024-01-17T21:00:00.000000000',\n",
- " '2024-01-17T22:00:00.000000000', '2024-01-17T23:00:00.000000000',\n",
- " '2024-01-18T00:00:00.000000000', '2024-01-18T01:00:00.000000000',\n",
- " '2024-01-18T02:00:00.000000000', '2024-01-18T03:00:00.000000000',\n",
- " '2024-01-18T04:00:00.000000000', '2024-01-18T05:00:00.000000000',\n",
- " '2024-01-18T06:00:00.000000000', '2024-01-18T07:00:00.000000000',\n",
- " '2024-01-18T08:00:00.000000000', '2024-01-18T09:00:00.000000000',\n",
- " '2024-01-18T10:00:00.000000000', '2024-01-18T11:00:00.000000000',\n",
- " '2024-01-18T12:00:00.000000000', '2024-01-18T13:00:00.000000000',\n",
- " '2024-01-18T14:00:00.000000000', '2024-01-18T15:00:00.000000000',\n",
- " '2024-01-18T16:00:00.000000000', '2024-01-18T17:00:00.000000000',\n",
- " '2024-01-18T18:00:00.000000000', '2024-01-18T19:00:00.000000000',\n",
- " '2024-01-18T20:00:00.000000000', '2024-01-18T21:00:00.000000000',\n",
- " '2024-01-18T22:00:00.000000000', '2024-01-18T23:00:00.000000000',\n",
- " '2024-01-19T00:00:00.000000000', '2024-01-19T01:00:00.000000000',\n",
- " '2024-01-19T02:00:00.000000000', '2024-01-19T03:00:00.000000000',\n",
- " '2024-01-19T04:00:00.000000000', '2024-01-19T05:00:00.000000000',\n",
- " '2024-01-19T06:00:00.000000000', '2024-01-19T07:00:00.000000000',\n",
- " '2024-01-19T08:00:00.000000000', '2024-01-19T09:00:00.000000000',\n",
- " '2024-01-19T10:00:00.000000000', '2024-01-19T11:00:00.000000000',\n",
- " '2024-01-19T12:00:00.000000000', '2024-01-19T13:00:00.000000000',\n",
- " '2024-01-19T14:00:00.000000000', '2024-01-19T15:00:00.000000000',\n",
- " '2024-01-19T16:00:00.000000000', '2024-01-19T17:00:00.000000000',\n",
- " '2024-01-19T18:00:00.000000000', '2024-01-19T19:00:00.000000000',\n",
- " '2024-01-19T20:00:00.000000000', '2024-01-19T21:00:00.000000000',\n",
- " '2024-01-19T22:00:00.000000000', '2024-01-19T23:00:00.000000000',\n",
- " '2024-01-20T00:00:00.000000000', '2024-01-20T01:00:00.000000000',\n",
- " '2024-01-20T02:00:00.000000000', '2024-01-20T03:00:00.000000000',\n",
- " '2024-01-20T04:00:00.000000000', '2024-01-20T05:00:00.000000000',\n",
- " '2024-01-20T06:00:00.000000000', '2024-01-20T07:00:00.000000000',\n",
- " '2024-01-20T08:00:00.000000000', '2024-01-20T09:00:00.000000000',\n",
- " '2024-01-20T10:00:00.000000000', '2024-01-20T11:00:00.000000000',\n",
- " '2024-01-20T12:00:00.000000000', '2024-01-20T13:00:00.000000000',\n",
- " '2024-01-20T14:00:00.000000000', '2024-01-20T15:00:00.000000000',\n",
- " '2024-01-20T16:00:00.000000000', '2024-01-20T17:00:00.000000000',\n",
- " '2024-01-20T18:00:00.000000000', '2024-01-20T19:00:00.000000000',\n",
- " '2024-01-20T20:00:00.000000000', '2024-01-20T21:00:00.000000000',\n",
- " '2024-01-20T22:00:00.000000000', '2024-01-20T23:00:00.000000000',\n",
- " '2024-01-21T00:00:00.000000000', '2024-01-21T01:00:00.000000000',\n",
- " '2024-01-21T02:00:00.000000000', '2024-01-21T03:00:00.000000000',\n",
- " '2024-01-21T04:00:00.000000000', '2024-01-21T05:00:00.000000000',\n",
- " '2024-01-21T06:00:00.000000000', '2024-01-21T07:00:00.000000000',\n",
- " '2024-01-21T08:00:00.000000000', '2024-01-21T09:00:00.000000000',\n",
- " '2024-01-21T10:00:00.000000000', '2024-01-21T11:00:00.000000000',\n",
- " '2024-01-21T12:00:00.000000000', '2024-01-21T13:00:00.000000000',\n",
- " '2024-01-21T14:00:00.000000000', '2024-01-21T15:00:00.000000000',\n",
- " '2024-01-21T16:00:00.000000000', '2024-01-21T17:00:00.000000000',\n",
- " '2024-01-21T18:00:00.000000000', '2024-01-21T19:00:00.000000000',\n",
- " '2024-01-21T20:00:00.000000000', '2024-01-21T21:00:00.000000000',\n",
- " '2024-01-21T22:00:00.000000000', '2024-01-21T23:00:00.000000000',\n",
- " '2024-01-22T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('AAAAAAAAAIAKPvjgg49iPby8nSEx72' ... 'AAAAAgvWP9SoFav2g9AAAAAAAA+P8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'variable=ThermalStorage(Charge)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'ThermalStorage(Charge)',\n",
- " 'marker': {'color': '#4daf4a', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'ThermalStorage(Charge)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-15T00:00:00.000000000', '2024-01-15T01:00:00.000000000',\n",
- " '2024-01-15T02:00:00.000000000', '2024-01-15T03:00:00.000000000',\n",
- " '2024-01-15T04:00:00.000000000', '2024-01-15T05:00:00.000000000',\n",
- " '2024-01-15T06:00:00.000000000', '2024-01-15T07:00:00.000000000',\n",
- " '2024-01-15T08:00:00.000000000', '2024-01-15T09:00:00.000000000',\n",
- " '2024-01-15T10:00:00.000000000', '2024-01-15T11:00:00.000000000',\n",
- " '2024-01-15T12:00:00.000000000', '2024-01-15T13:00:00.000000000',\n",
- " '2024-01-15T14:00:00.000000000', '2024-01-15T15:00:00.000000000',\n",
- " '2024-01-15T16:00:00.000000000', '2024-01-15T17:00:00.000000000',\n",
- " '2024-01-15T18:00:00.000000000', '2024-01-15T19:00:00.000000000',\n",
- " '2024-01-15T20:00:00.000000000', '2024-01-15T21:00:00.000000000',\n",
- " '2024-01-15T22:00:00.000000000', '2024-01-15T23:00:00.000000000',\n",
- " '2024-01-16T00:00:00.000000000', '2024-01-16T01:00:00.000000000',\n",
- " '2024-01-16T02:00:00.000000000', '2024-01-16T03:00:00.000000000',\n",
- " '2024-01-16T04:00:00.000000000', '2024-01-16T05:00:00.000000000',\n",
- " '2024-01-16T06:00:00.000000000', '2024-01-16T07:00:00.000000000',\n",
- " '2024-01-16T08:00:00.000000000', '2024-01-16T09:00:00.000000000',\n",
- " '2024-01-16T10:00:00.000000000', '2024-01-16T11:00:00.000000000',\n",
- " '2024-01-16T12:00:00.000000000', '2024-01-16T13:00:00.000000000',\n",
- " '2024-01-16T14:00:00.000000000', '2024-01-16T15:00:00.000000000',\n",
- " '2024-01-16T16:00:00.000000000', '2024-01-16T17:00:00.000000000',\n",
- " '2024-01-16T18:00:00.000000000', '2024-01-16T19:00:00.000000000',\n",
- " '2024-01-16T20:00:00.000000000', '2024-01-16T21:00:00.000000000',\n",
- " '2024-01-16T22:00:00.000000000', '2024-01-16T23:00:00.000000000',\n",
- " '2024-01-17T00:00:00.000000000', '2024-01-17T01:00:00.000000000',\n",
- " '2024-01-17T02:00:00.000000000', '2024-01-17T03:00:00.000000000',\n",
- " '2024-01-17T04:00:00.000000000', '2024-01-17T05:00:00.000000000',\n",
- " '2024-01-17T06:00:00.000000000', '2024-01-17T07:00:00.000000000',\n",
- " '2024-01-17T08:00:00.000000000', '2024-01-17T09:00:00.000000000',\n",
- " '2024-01-17T10:00:00.000000000', '2024-01-17T11:00:00.000000000',\n",
- " '2024-01-17T12:00:00.000000000', '2024-01-17T13:00:00.000000000',\n",
- " '2024-01-17T14:00:00.000000000', '2024-01-17T15:00:00.000000000',\n",
- " '2024-01-17T16:00:00.000000000', '2024-01-17T17:00:00.000000000',\n",
- " '2024-01-17T18:00:00.000000000', '2024-01-17T19:00:00.000000000',\n",
- " '2024-01-17T20:00:00.000000000', '2024-01-17T21:00:00.000000000',\n",
- " '2024-01-17T22:00:00.000000000', '2024-01-17T23:00:00.000000000',\n",
- " '2024-01-18T00:00:00.000000000', '2024-01-18T01:00:00.000000000',\n",
- " '2024-01-18T02:00:00.000000000', '2024-01-18T03:00:00.000000000',\n",
- " '2024-01-18T04:00:00.000000000', '2024-01-18T05:00:00.000000000',\n",
- " '2024-01-18T06:00:00.000000000', '2024-01-18T07:00:00.000000000',\n",
- " '2024-01-18T08:00:00.000000000', '2024-01-18T09:00:00.000000000',\n",
- " '2024-01-18T10:00:00.000000000', '2024-01-18T11:00:00.000000000',\n",
- " '2024-01-18T12:00:00.000000000', '2024-01-18T13:00:00.000000000',\n",
- " '2024-01-18T14:00:00.000000000', '2024-01-18T15:00:00.000000000',\n",
- " '2024-01-18T16:00:00.000000000', '2024-01-18T17:00:00.000000000',\n",
- " '2024-01-18T18:00:00.000000000', '2024-01-18T19:00:00.000000000',\n",
- " '2024-01-18T20:00:00.000000000', '2024-01-18T21:00:00.000000000',\n",
- " '2024-01-18T22:00:00.000000000', '2024-01-18T23:00:00.000000000',\n",
- " '2024-01-19T00:00:00.000000000', '2024-01-19T01:00:00.000000000',\n",
- " '2024-01-19T02:00:00.000000000', '2024-01-19T03:00:00.000000000',\n",
- " '2024-01-19T04:00:00.000000000', '2024-01-19T05:00:00.000000000',\n",
- " '2024-01-19T06:00:00.000000000', '2024-01-19T07:00:00.000000000',\n",
- " '2024-01-19T08:00:00.000000000', '2024-01-19T09:00:00.000000000',\n",
- " '2024-01-19T10:00:00.000000000', '2024-01-19T11:00:00.000000000',\n",
- " '2024-01-19T12:00:00.000000000', '2024-01-19T13:00:00.000000000',\n",
- " '2024-01-19T14:00:00.000000000', '2024-01-19T15:00:00.000000000',\n",
- " '2024-01-19T16:00:00.000000000', '2024-01-19T17:00:00.000000000',\n",
- " '2024-01-19T18:00:00.000000000', '2024-01-19T19:00:00.000000000',\n",
- " '2024-01-19T20:00:00.000000000', '2024-01-19T21:00:00.000000000',\n",
- " '2024-01-19T22:00:00.000000000', '2024-01-19T23:00:00.000000000',\n",
- " '2024-01-20T00:00:00.000000000', '2024-01-20T01:00:00.000000000',\n",
- " '2024-01-20T02:00:00.000000000', '2024-01-20T03:00:00.000000000',\n",
- " '2024-01-20T04:00:00.000000000', '2024-01-20T05:00:00.000000000',\n",
- " '2024-01-20T06:00:00.000000000', '2024-01-20T07:00:00.000000000',\n",
- " '2024-01-20T08:00:00.000000000', '2024-01-20T09:00:00.000000000',\n",
- " '2024-01-20T10:00:00.000000000', '2024-01-20T11:00:00.000000000',\n",
- " '2024-01-20T12:00:00.000000000', '2024-01-20T13:00:00.000000000',\n",
- " '2024-01-20T14:00:00.000000000', '2024-01-20T15:00:00.000000000',\n",
- " '2024-01-20T16:00:00.000000000', '2024-01-20T17:00:00.000000000',\n",
- " '2024-01-20T18:00:00.000000000', '2024-01-20T19:00:00.000000000',\n",
- " '2024-01-20T20:00:00.000000000', '2024-01-20T21:00:00.000000000',\n",
- " '2024-01-20T22:00:00.000000000', '2024-01-20T23:00:00.000000000',\n",
- " '2024-01-21T00:00:00.000000000', '2024-01-21T01:00:00.000000000',\n",
- " '2024-01-21T02:00:00.000000000', '2024-01-21T03:00:00.000000000',\n",
- " '2024-01-21T04:00:00.000000000', '2024-01-21T05:00:00.000000000',\n",
- " '2024-01-21T06:00:00.000000000', '2024-01-21T07:00:00.000000000',\n",
- " '2024-01-21T08:00:00.000000000', '2024-01-21T09:00:00.000000000',\n",
- " '2024-01-21T10:00:00.000000000', '2024-01-21T11:00:00.000000000',\n",
- " '2024-01-21T12:00:00.000000000', '2024-01-21T13:00:00.000000000',\n",
- " '2024-01-21T14:00:00.000000000', '2024-01-21T15:00:00.000000000',\n",
- " '2024-01-21T16:00:00.000000000', '2024-01-21T17:00:00.000000000',\n",
- " '2024-01-21T18:00:00.000000000', '2024-01-21T19:00:00.000000000',\n",
- " '2024-01-21T20:00:00.000000000', '2024-01-21T21:00:00.000000000',\n",
- " '2024-01-21T22:00:00.000000000', '2024-01-21T23:00:00.000000000',\n",
- " '2024-01-22T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('AAAAAAAAAAAUfPDBB19avby8nSEx72' ... 'AAAAAAANj//////1hAAAAAAAAA+H8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'variable=Office(Heat)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'Office(Heat)',\n",
- " 'marker': {'color': '#984ea3', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'Office(Heat)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-15T00:00:00.000000000', '2024-01-15T01:00:00.000000000',\n",
- " '2024-01-15T02:00:00.000000000', '2024-01-15T03:00:00.000000000',\n",
- " '2024-01-15T04:00:00.000000000', '2024-01-15T05:00:00.000000000',\n",
- " '2024-01-15T06:00:00.000000000', '2024-01-15T07:00:00.000000000',\n",
- " '2024-01-15T08:00:00.000000000', '2024-01-15T09:00:00.000000000',\n",
- " '2024-01-15T10:00:00.000000000', '2024-01-15T11:00:00.000000000',\n",
- " '2024-01-15T12:00:00.000000000', '2024-01-15T13:00:00.000000000',\n",
- " '2024-01-15T14:00:00.000000000', '2024-01-15T15:00:00.000000000',\n",
- " '2024-01-15T16:00:00.000000000', '2024-01-15T17:00:00.000000000',\n",
- " '2024-01-15T18:00:00.000000000', '2024-01-15T19:00:00.000000000',\n",
- " '2024-01-15T20:00:00.000000000', '2024-01-15T21:00:00.000000000',\n",
- " '2024-01-15T22:00:00.000000000', '2024-01-15T23:00:00.000000000',\n",
- " '2024-01-16T00:00:00.000000000', '2024-01-16T01:00:00.000000000',\n",
- " '2024-01-16T02:00:00.000000000', '2024-01-16T03:00:00.000000000',\n",
- " '2024-01-16T04:00:00.000000000', '2024-01-16T05:00:00.000000000',\n",
- " '2024-01-16T06:00:00.000000000', '2024-01-16T07:00:00.000000000',\n",
- " '2024-01-16T08:00:00.000000000', '2024-01-16T09:00:00.000000000',\n",
- " '2024-01-16T10:00:00.000000000', '2024-01-16T11:00:00.000000000',\n",
- " '2024-01-16T12:00:00.000000000', '2024-01-16T13:00:00.000000000',\n",
- " '2024-01-16T14:00:00.000000000', '2024-01-16T15:00:00.000000000',\n",
- " '2024-01-16T16:00:00.000000000', '2024-01-16T17:00:00.000000000',\n",
- " '2024-01-16T18:00:00.000000000', '2024-01-16T19:00:00.000000000',\n",
- " '2024-01-16T20:00:00.000000000', '2024-01-16T21:00:00.000000000',\n",
- " '2024-01-16T22:00:00.000000000', '2024-01-16T23:00:00.000000000',\n",
- " '2024-01-17T00:00:00.000000000', '2024-01-17T01:00:00.000000000',\n",
- " '2024-01-17T02:00:00.000000000', '2024-01-17T03:00:00.000000000',\n",
- " '2024-01-17T04:00:00.000000000', '2024-01-17T05:00:00.000000000',\n",
- " '2024-01-17T06:00:00.000000000', '2024-01-17T07:00:00.000000000',\n",
- " '2024-01-17T08:00:00.000000000', '2024-01-17T09:00:00.000000000',\n",
- " '2024-01-17T10:00:00.000000000', '2024-01-17T11:00:00.000000000',\n",
- " '2024-01-17T12:00:00.000000000', '2024-01-17T13:00:00.000000000',\n",
- " '2024-01-17T14:00:00.000000000', '2024-01-17T15:00:00.000000000',\n",
- " '2024-01-17T16:00:00.000000000', '2024-01-17T17:00:00.000000000',\n",
- " '2024-01-17T18:00:00.000000000', '2024-01-17T19:00:00.000000000',\n",
- " '2024-01-17T20:00:00.000000000', '2024-01-17T21:00:00.000000000',\n",
- " '2024-01-17T22:00:00.000000000', '2024-01-17T23:00:00.000000000',\n",
- " '2024-01-18T00:00:00.000000000', '2024-01-18T01:00:00.000000000',\n",
- " '2024-01-18T02:00:00.000000000', '2024-01-18T03:00:00.000000000',\n",
- " '2024-01-18T04:00:00.000000000', '2024-01-18T05:00:00.000000000',\n",
- " '2024-01-18T06:00:00.000000000', '2024-01-18T07:00:00.000000000',\n",
- " '2024-01-18T08:00:00.000000000', '2024-01-18T09:00:00.000000000',\n",
- " '2024-01-18T10:00:00.000000000', '2024-01-18T11:00:00.000000000',\n",
- " '2024-01-18T12:00:00.000000000', '2024-01-18T13:00:00.000000000',\n",
- " '2024-01-18T14:00:00.000000000', '2024-01-18T15:00:00.000000000',\n",
- " '2024-01-18T16:00:00.000000000', '2024-01-18T17:00:00.000000000',\n",
- " '2024-01-18T18:00:00.000000000', '2024-01-18T19:00:00.000000000',\n",
- " '2024-01-18T20:00:00.000000000', '2024-01-18T21:00:00.000000000',\n",
- " '2024-01-18T22:00:00.000000000', '2024-01-18T23:00:00.000000000',\n",
- " '2024-01-19T00:00:00.000000000', '2024-01-19T01:00:00.000000000',\n",
- " '2024-01-19T02:00:00.000000000', '2024-01-19T03:00:00.000000000',\n",
- " '2024-01-19T04:00:00.000000000', '2024-01-19T05:00:00.000000000',\n",
- " '2024-01-19T06:00:00.000000000', '2024-01-19T07:00:00.000000000',\n",
- " '2024-01-19T08:00:00.000000000', '2024-01-19T09:00:00.000000000',\n",
- " '2024-01-19T10:00:00.000000000', '2024-01-19T11:00:00.000000000',\n",
- " '2024-01-19T12:00:00.000000000', '2024-01-19T13:00:00.000000000',\n",
- " '2024-01-19T14:00:00.000000000', '2024-01-19T15:00:00.000000000',\n",
- " '2024-01-19T16:00:00.000000000', '2024-01-19T17:00:00.000000000',\n",
- " '2024-01-19T18:00:00.000000000', '2024-01-19T19:00:00.000000000',\n",
- " '2024-01-19T20:00:00.000000000', '2024-01-19T21:00:00.000000000',\n",
- " '2024-01-19T22:00:00.000000000', '2024-01-19T23:00:00.000000000',\n",
- " '2024-01-20T00:00:00.000000000', '2024-01-20T01:00:00.000000000',\n",
- " '2024-01-20T02:00:00.000000000', '2024-01-20T03:00:00.000000000',\n",
- " '2024-01-20T04:00:00.000000000', '2024-01-20T05:00:00.000000000',\n",
- " '2024-01-20T06:00:00.000000000', '2024-01-20T07:00:00.000000000',\n",
- " '2024-01-20T08:00:00.000000000', '2024-01-20T09:00:00.000000000',\n",
- " '2024-01-20T10:00:00.000000000', '2024-01-20T11:00:00.000000000',\n",
- " '2024-01-20T12:00:00.000000000', '2024-01-20T13:00:00.000000000',\n",
- " '2024-01-20T14:00:00.000000000', '2024-01-20T15:00:00.000000000',\n",
- " '2024-01-20T16:00:00.000000000', '2024-01-20T17:00:00.000000000',\n",
- " '2024-01-20T18:00:00.000000000', '2024-01-20T19:00:00.000000000',\n",
- " '2024-01-20T20:00:00.000000000', '2024-01-20T21:00:00.000000000',\n",
- " '2024-01-20T22:00:00.000000000', '2024-01-20T23:00:00.000000000',\n",
- " '2024-01-21T00:00:00.000000000', '2024-01-21T01:00:00.000000000',\n",
- " '2024-01-21T02:00:00.000000000', '2024-01-21T03:00:00.000000000',\n",
- " '2024-01-21T04:00:00.000000000', '2024-01-21T05:00:00.000000000',\n",
- " '2024-01-21T06:00:00.000000000', '2024-01-21T07:00:00.000000000',\n",
- " '2024-01-21T08:00:00.000000000', '2024-01-21T09:00:00.000000000',\n",
- " '2024-01-21T10:00:00.000000000', '2024-01-21T11:00:00.000000000',\n",
- " '2024-01-21T12:00:00.000000000', '2024-01-21T13:00:00.000000000',\n",
- " '2024-01-21T14:00:00.000000000', '2024-01-21T15:00:00.000000000',\n",
- " '2024-01-21T16:00:00.000000000', '2024-01-21T17:00:00.000000000',\n",
- " '2024-01-21T18:00:00.000000000', '2024-01-21T19:00:00.000000000',\n",
- " '2024-01-21T20:00:00.000000000', '2024-01-21T21:00:00.000000000',\n",
- " '2024-01-21T22:00:00.000000000', '2024-01-21T23:00:00.000000000',\n",
- " '2024-01-22T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('5ZuWpeU9QEDMU8WNBU89QGDXQkqFnk' ... 'AAAAA0QK7n4h/lezhAAAAAAAAA+H8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'}],\n",
- " 'layout': {'bargap': 0,\n",
- " 'bargroupgap': 0,\n",
- " 'barmode': 'relative',\n",
- " 'legend': {'title': {'text': 'variable'}, 'tracegroupgap': 0},\n",
- " 'template': '...',\n",
- " 'title': {'text': 'Heat (flow_rate)'},\n",
- " 'xaxis': {'anchor': 'y', 'domain': [0.0, 1.0], 'title': {'text': 'time'}},\n",
- " 'yaxis': {'anchor': 'x', 'domain': [0.0, 1.0], 'title': {'text': 'value'}}}\n",
- "}))"
- ],
- "text/html": [
- ""
- ]
- },
- "execution_count": 38,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "execution_count": 38
+ ]
},
{
"cell_type": "code",
- "id": "77",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T14:13:18.672843Z",
- "start_time": "2025-12-13T14:13:18.628572Z"
- }
- },
+ "execution_count": null,
+ "id": "67",
+ "metadata": {},
+ "outputs": [],
"source": [
"# Using a dictionary for specific labels\n",
"simple.statistics.plot.balance(\n",
@@ -7119,433 +745,11 @@
" 'Office(Heat)': 'forestgreen',\n",
" },\n",
")"
- ],
- "outputs": [
- {
- "data": {
- "text/plain": [
- "PlotResult(data= Size: 7kB\n",
- "Dimensions: (time: 169)\n",
- "Coordinates:\n",
- " * time (time) datetime64[ns] 1kB 2024-01-15 ... 2024-...\n",
- "Data variables:\n",
- " Boiler(Heat) (time) float64 1kB -32.48 -29.31 ... -124.5 nan\n",
- " ThermalStorage(Discharge) (time) float64 1kB -0.0 5.275e-13 ... nan\n",
- " ThermalStorage(Charge) (time) float64 1kB 0.0 -3.748e-13 ... 100.0 nan\n",
- " Office(Heat) (time) float64 1kB 32.48 29.31 ... 24.48 nan, figure=Figure({\n",
- " 'data': [{'hovertemplate': 'variable=Boiler(Heat)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'Boiler(Heat)',\n",
- " 'marker': {'color': 'orangered', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'Boiler(Heat)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-15T00:00:00.000000000', '2024-01-15T01:00:00.000000000',\n",
- " '2024-01-15T02:00:00.000000000', '2024-01-15T03:00:00.000000000',\n",
- " '2024-01-15T04:00:00.000000000', '2024-01-15T05:00:00.000000000',\n",
- " '2024-01-15T06:00:00.000000000', '2024-01-15T07:00:00.000000000',\n",
- " '2024-01-15T08:00:00.000000000', '2024-01-15T09:00:00.000000000',\n",
- " '2024-01-15T10:00:00.000000000', '2024-01-15T11:00:00.000000000',\n",
- " '2024-01-15T12:00:00.000000000', '2024-01-15T13:00:00.000000000',\n",
- " '2024-01-15T14:00:00.000000000', '2024-01-15T15:00:00.000000000',\n",
- " '2024-01-15T16:00:00.000000000', '2024-01-15T17:00:00.000000000',\n",
- " '2024-01-15T18:00:00.000000000', '2024-01-15T19:00:00.000000000',\n",
- " '2024-01-15T20:00:00.000000000', '2024-01-15T21:00:00.000000000',\n",
- " '2024-01-15T22:00:00.000000000', '2024-01-15T23:00:00.000000000',\n",
- " '2024-01-16T00:00:00.000000000', '2024-01-16T01:00:00.000000000',\n",
- " '2024-01-16T02:00:00.000000000', '2024-01-16T03:00:00.000000000',\n",
- " '2024-01-16T04:00:00.000000000', '2024-01-16T05:00:00.000000000',\n",
- " '2024-01-16T06:00:00.000000000', '2024-01-16T07:00:00.000000000',\n",
- " '2024-01-16T08:00:00.000000000', '2024-01-16T09:00:00.000000000',\n",
- " '2024-01-16T10:00:00.000000000', '2024-01-16T11:00:00.000000000',\n",
- " '2024-01-16T12:00:00.000000000', '2024-01-16T13:00:00.000000000',\n",
- " '2024-01-16T14:00:00.000000000', '2024-01-16T15:00:00.000000000',\n",
- " '2024-01-16T16:00:00.000000000', '2024-01-16T17:00:00.000000000',\n",
- " '2024-01-16T18:00:00.000000000', '2024-01-16T19:00:00.000000000',\n",
- " '2024-01-16T20:00:00.000000000', '2024-01-16T21:00:00.000000000',\n",
- " '2024-01-16T22:00:00.000000000', '2024-01-16T23:00:00.000000000',\n",
- " '2024-01-17T00:00:00.000000000', '2024-01-17T01:00:00.000000000',\n",
- " '2024-01-17T02:00:00.000000000', '2024-01-17T03:00:00.000000000',\n",
- " '2024-01-17T04:00:00.000000000', '2024-01-17T05:00:00.000000000',\n",
- " '2024-01-17T06:00:00.000000000', '2024-01-17T07:00:00.000000000',\n",
- " '2024-01-17T08:00:00.000000000', '2024-01-17T09:00:00.000000000',\n",
- " '2024-01-17T10:00:00.000000000', '2024-01-17T11:00:00.000000000',\n",
- " '2024-01-17T12:00:00.000000000', '2024-01-17T13:00:00.000000000',\n",
- " '2024-01-17T14:00:00.000000000', '2024-01-17T15:00:00.000000000',\n",
- " '2024-01-17T16:00:00.000000000', '2024-01-17T17:00:00.000000000',\n",
- " '2024-01-17T18:00:00.000000000', '2024-01-17T19:00:00.000000000',\n",
- " '2024-01-17T20:00:00.000000000', '2024-01-17T21:00:00.000000000',\n",
- " '2024-01-17T22:00:00.000000000', '2024-01-17T23:00:00.000000000',\n",
- " '2024-01-18T00:00:00.000000000', '2024-01-18T01:00:00.000000000',\n",
- " '2024-01-18T02:00:00.000000000', '2024-01-18T03:00:00.000000000',\n",
- " '2024-01-18T04:00:00.000000000', '2024-01-18T05:00:00.000000000',\n",
- " '2024-01-18T06:00:00.000000000', '2024-01-18T07:00:00.000000000',\n",
- " '2024-01-18T08:00:00.000000000', '2024-01-18T09:00:00.000000000',\n",
- " '2024-01-18T10:00:00.000000000', '2024-01-18T11:00:00.000000000',\n",
- " '2024-01-18T12:00:00.000000000', '2024-01-18T13:00:00.000000000',\n",
- " '2024-01-18T14:00:00.000000000', '2024-01-18T15:00:00.000000000',\n",
- " '2024-01-18T16:00:00.000000000', '2024-01-18T17:00:00.000000000',\n",
- " '2024-01-18T18:00:00.000000000', '2024-01-18T19:00:00.000000000',\n",
- " '2024-01-18T20:00:00.000000000', '2024-01-18T21:00:00.000000000',\n",
- " '2024-01-18T22:00:00.000000000', '2024-01-18T23:00:00.000000000',\n",
- " '2024-01-19T00:00:00.000000000', '2024-01-19T01:00:00.000000000',\n",
- " '2024-01-19T02:00:00.000000000', '2024-01-19T03:00:00.000000000',\n",
- " '2024-01-19T04:00:00.000000000', '2024-01-19T05:00:00.000000000',\n",
- " '2024-01-19T06:00:00.000000000', '2024-01-19T07:00:00.000000000',\n",
- " '2024-01-19T08:00:00.000000000', '2024-01-19T09:00:00.000000000',\n",
- " '2024-01-19T10:00:00.000000000', '2024-01-19T11:00:00.000000000',\n",
- " '2024-01-19T12:00:00.000000000', '2024-01-19T13:00:00.000000000',\n",
- " '2024-01-19T14:00:00.000000000', '2024-01-19T15:00:00.000000000',\n",
- " '2024-01-19T16:00:00.000000000', '2024-01-19T17:00:00.000000000',\n",
- " '2024-01-19T18:00:00.000000000', '2024-01-19T19:00:00.000000000',\n",
- " '2024-01-19T20:00:00.000000000', '2024-01-19T21:00:00.000000000',\n",
- " '2024-01-19T22:00:00.000000000', '2024-01-19T23:00:00.000000000',\n",
- " '2024-01-20T00:00:00.000000000', '2024-01-20T01:00:00.000000000',\n",
- " '2024-01-20T02:00:00.000000000', '2024-01-20T03:00:00.000000000',\n",
- " '2024-01-20T04:00:00.000000000', '2024-01-20T05:00:00.000000000',\n",
- " '2024-01-20T06:00:00.000000000', '2024-01-20T07:00:00.000000000',\n",
- " '2024-01-20T08:00:00.000000000', '2024-01-20T09:00:00.000000000',\n",
- " '2024-01-20T10:00:00.000000000', '2024-01-20T11:00:00.000000000',\n",
- " '2024-01-20T12:00:00.000000000', '2024-01-20T13:00:00.000000000',\n",
- " '2024-01-20T14:00:00.000000000', '2024-01-20T15:00:00.000000000',\n",
- " '2024-01-20T16:00:00.000000000', '2024-01-20T17:00:00.000000000',\n",
- " '2024-01-20T18:00:00.000000000', '2024-01-20T19:00:00.000000000',\n",
- " '2024-01-20T20:00:00.000000000', '2024-01-20T21:00:00.000000000',\n",
- " '2024-01-20T22:00:00.000000000', '2024-01-20T23:00:00.000000000',\n",
- " '2024-01-21T00:00:00.000000000', '2024-01-21T01:00:00.000000000',\n",
- " '2024-01-21T02:00:00.000000000', '2024-01-21T03:00:00.000000000',\n",
- " '2024-01-21T04:00:00.000000000', '2024-01-21T05:00:00.000000000',\n",
- " '2024-01-21T06:00:00.000000000', '2024-01-21T07:00:00.000000000',\n",
- " '2024-01-21T08:00:00.000000000', '2024-01-21T09:00:00.000000000',\n",
- " '2024-01-21T10:00:00.000000000', '2024-01-21T11:00:00.000000000',\n",
- " '2024-01-21T12:00:00.000000000', '2024-01-21T13:00:00.000000000',\n",
- " '2024-01-21T14:00:00.000000000', '2024-01-21T15:00:00.000000000',\n",
- " '2024-01-21T16:00:00.000000000', '2024-01-21T17:00:00.000000000',\n",
- " '2024-01-21T18:00:00.000000000', '2024-01-21T19:00:00.000000000',\n",
- " '2024-01-21T20:00:00.000000000', '2024-01-21T21:00:00.000000000',\n",
- " '2024-01-21T22:00:00.000000000', '2024-01-21T23:00:00.000000000',\n",
- " '2024-01-22T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('5ZuWpeU9QMD3U8WNBU89wHjXQkqFnk' ... '////8zwPW5+Ef5Hl/AAAAAAAAA+P8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'variable=ThermalStorage(Discharge)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'ThermalStorage(Discharge)',\n",
- " 'marker': {'color': 'lightblue', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'ThermalStorage(Discharge)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-15T00:00:00.000000000', '2024-01-15T01:00:00.000000000',\n",
- " '2024-01-15T02:00:00.000000000', '2024-01-15T03:00:00.000000000',\n",
- " '2024-01-15T04:00:00.000000000', '2024-01-15T05:00:00.000000000',\n",
- " '2024-01-15T06:00:00.000000000', '2024-01-15T07:00:00.000000000',\n",
- " '2024-01-15T08:00:00.000000000', '2024-01-15T09:00:00.000000000',\n",
- " '2024-01-15T10:00:00.000000000', '2024-01-15T11:00:00.000000000',\n",
- " '2024-01-15T12:00:00.000000000', '2024-01-15T13:00:00.000000000',\n",
- " '2024-01-15T14:00:00.000000000', '2024-01-15T15:00:00.000000000',\n",
- " '2024-01-15T16:00:00.000000000', '2024-01-15T17:00:00.000000000',\n",
- " '2024-01-15T18:00:00.000000000', '2024-01-15T19:00:00.000000000',\n",
- " '2024-01-15T20:00:00.000000000', '2024-01-15T21:00:00.000000000',\n",
- " '2024-01-15T22:00:00.000000000', '2024-01-15T23:00:00.000000000',\n",
- " '2024-01-16T00:00:00.000000000', '2024-01-16T01:00:00.000000000',\n",
- " '2024-01-16T02:00:00.000000000', '2024-01-16T03:00:00.000000000',\n",
- " '2024-01-16T04:00:00.000000000', '2024-01-16T05:00:00.000000000',\n",
- " '2024-01-16T06:00:00.000000000', '2024-01-16T07:00:00.000000000',\n",
- " '2024-01-16T08:00:00.000000000', '2024-01-16T09:00:00.000000000',\n",
- " '2024-01-16T10:00:00.000000000', '2024-01-16T11:00:00.000000000',\n",
- " '2024-01-16T12:00:00.000000000', '2024-01-16T13:00:00.000000000',\n",
- " '2024-01-16T14:00:00.000000000', '2024-01-16T15:00:00.000000000',\n",
- " '2024-01-16T16:00:00.000000000', '2024-01-16T17:00:00.000000000',\n",
- " '2024-01-16T18:00:00.000000000', '2024-01-16T19:00:00.000000000',\n",
- " '2024-01-16T20:00:00.000000000', '2024-01-16T21:00:00.000000000',\n",
- " '2024-01-16T22:00:00.000000000', '2024-01-16T23:00:00.000000000',\n",
- " '2024-01-17T00:00:00.000000000', '2024-01-17T01:00:00.000000000',\n",
- " '2024-01-17T02:00:00.000000000', '2024-01-17T03:00:00.000000000',\n",
- " '2024-01-17T04:00:00.000000000', '2024-01-17T05:00:00.000000000',\n",
- " '2024-01-17T06:00:00.000000000', '2024-01-17T07:00:00.000000000',\n",
- " '2024-01-17T08:00:00.000000000', '2024-01-17T09:00:00.000000000',\n",
- " '2024-01-17T10:00:00.000000000', '2024-01-17T11:00:00.000000000',\n",
- " '2024-01-17T12:00:00.000000000', '2024-01-17T13:00:00.000000000',\n",
- " '2024-01-17T14:00:00.000000000', '2024-01-17T15:00:00.000000000',\n",
- " '2024-01-17T16:00:00.000000000', '2024-01-17T17:00:00.000000000',\n",
- " '2024-01-17T18:00:00.000000000', '2024-01-17T19:00:00.000000000',\n",
- " '2024-01-17T20:00:00.000000000', '2024-01-17T21:00:00.000000000',\n",
- " '2024-01-17T22:00:00.000000000', '2024-01-17T23:00:00.000000000',\n",
- " '2024-01-18T00:00:00.000000000', '2024-01-18T01:00:00.000000000',\n",
- " '2024-01-18T02:00:00.000000000', '2024-01-18T03:00:00.000000000',\n",
- " '2024-01-18T04:00:00.000000000', '2024-01-18T05:00:00.000000000',\n",
- " '2024-01-18T06:00:00.000000000', '2024-01-18T07:00:00.000000000',\n",
- " '2024-01-18T08:00:00.000000000', '2024-01-18T09:00:00.000000000',\n",
- " '2024-01-18T10:00:00.000000000', '2024-01-18T11:00:00.000000000',\n",
- " '2024-01-18T12:00:00.000000000', '2024-01-18T13:00:00.000000000',\n",
- " '2024-01-18T14:00:00.000000000', '2024-01-18T15:00:00.000000000',\n",
- " '2024-01-18T16:00:00.000000000', '2024-01-18T17:00:00.000000000',\n",
- " '2024-01-18T18:00:00.000000000', '2024-01-18T19:00:00.000000000',\n",
- " '2024-01-18T20:00:00.000000000', '2024-01-18T21:00:00.000000000',\n",
- " '2024-01-18T22:00:00.000000000', '2024-01-18T23:00:00.000000000',\n",
- " '2024-01-19T00:00:00.000000000', '2024-01-19T01:00:00.000000000',\n",
- " '2024-01-19T02:00:00.000000000', '2024-01-19T03:00:00.000000000',\n",
- " '2024-01-19T04:00:00.000000000', '2024-01-19T05:00:00.000000000',\n",
- " '2024-01-19T06:00:00.000000000', '2024-01-19T07:00:00.000000000',\n",
- " '2024-01-19T08:00:00.000000000', '2024-01-19T09:00:00.000000000',\n",
- " '2024-01-19T10:00:00.000000000', '2024-01-19T11:00:00.000000000',\n",
- " '2024-01-19T12:00:00.000000000', '2024-01-19T13:00:00.000000000',\n",
- " '2024-01-19T14:00:00.000000000', '2024-01-19T15:00:00.000000000',\n",
- " '2024-01-19T16:00:00.000000000', '2024-01-19T17:00:00.000000000',\n",
- " '2024-01-19T18:00:00.000000000', '2024-01-19T19:00:00.000000000',\n",
- " '2024-01-19T20:00:00.000000000', '2024-01-19T21:00:00.000000000',\n",
- " '2024-01-19T22:00:00.000000000', '2024-01-19T23:00:00.000000000',\n",
- " '2024-01-20T00:00:00.000000000', '2024-01-20T01:00:00.000000000',\n",
- " '2024-01-20T02:00:00.000000000', '2024-01-20T03:00:00.000000000',\n",
- " '2024-01-20T04:00:00.000000000', '2024-01-20T05:00:00.000000000',\n",
- " '2024-01-20T06:00:00.000000000', '2024-01-20T07:00:00.000000000',\n",
- " '2024-01-20T08:00:00.000000000', '2024-01-20T09:00:00.000000000',\n",
- " '2024-01-20T10:00:00.000000000', '2024-01-20T11:00:00.000000000',\n",
- " '2024-01-20T12:00:00.000000000', '2024-01-20T13:00:00.000000000',\n",
- " '2024-01-20T14:00:00.000000000', '2024-01-20T15:00:00.000000000',\n",
- " '2024-01-20T16:00:00.000000000', '2024-01-20T17:00:00.000000000',\n",
- " '2024-01-20T18:00:00.000000000', '2024-01-20T19:00:00.000000000',\n",
- " '2024-01-20T20:00:00.000000000', '2024-01-20T21:00:00.000000000',\n",
- " '2024-01-20T22:00:00.000000000', '2024-01-20T23:00:00.000000000',\n",
- " '2024-01-21T00:00:00.000000000', '2024-01-21T01:00:00.000000000',\n",
- " '2024-01-21T02:00:00.000000000', '2024-01-21T03:00:00.000000000',\n",
- " '2024-01-21T04:00:00.000000000', '2024-01-21T05:00:00.000000000',\n",
- " '2024-01-21T06:00:00.000000000', '2024-01-21T07:00:00.000000000',\n",
- " '2024-01-21T08:00:00.000000000', '2024-01-21T09:00:00.000000000',\n",
- " '2024-01-21T10:00:00.000000000', '2024-01-21T11:00:00.000000000',\n",
- " '2024-01-21T12:00:00.000000000', '2024-01-21T13:00:00.000000000',\n",
- " '2024-01-21T14:00:00.000000000', '2024-01-21T15:00:00.000000000',\n",
- " '2024-01-21T16:00:00.000000000', '2024-01-21T17:00:00.000000000',\n",
- " '2024-01-21T18:00:00.000000000', '2024-01-21T19:00:00.000000000',\n",
- " '2024-01-21T20:00:00.000000000', '2024-01-21T21:00:00.000000000',\n",
- " '2024-01-21T22:00:00.000000000', '2024-01-21T23:00:00.000000000',\n",
- " '2024-01-22T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('AAAAAAAAAIAKPvjgg49iPby8nSEx72' ... 'AAAAAgvWP9SoFav2g9AAAAAAAA+P8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'variable=ThermalStorage(Charge)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'ThermalStorage(Charge)',\n",
- " 'marker': {'color': 'steelblue', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'ThermalStorage(Charge)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-15T00:00:00.000000000', '2024-01-15T01:00:00.000000000',\n",
- " '2024-01-15T02:00:00.000000000', '2024-01-15T03:00:00.000000000',\n",
- " '2024-01-15T04:00:00.000000000', '2024-01-15T05:00:00.000000000',\n",
- " '2024-01-15T06:00:00.000000000', '2024-01-15T07:00:00.000000000',\n",
- " '2024-01-15T08:00:00.000000000', '2024-01-15T09:00:00.000000000',\n",
- " '2024-01-15T10:00:00.000000000', '2024-01-15T11:00:00.000000000',\n",
- " '2024-01-15T12:00:00.000000000', '2024-01-15T13:00:00.000000000',\n",
- " '2024-01-15T14:00:00.000000000', '2024-01-15T15:00:00.000000000',\n",
- " '2024-01-15T16:00:00.000000000', '2024-01-15T17:00:00.000000000',\n",
- " '2024-01-15T18:00:00.000000000', '2024-01-15T19:00:00.000000000',\n",
- " '2024-01-15T20:00:00.000000000', '2024-01-15T21:00:00.000000000',\n",
- " '2024-01-15T22:00:00.000000000', '2024-01-15T23:00:00.000000000',\n",
- " '2024-01-16T00:00:00.000000000', '2024-01-16T01:00:00.000000000',\n",
- " '2024-01-16T02:00:00.000000000', '2024-01-16T03:00:00.000000000',\n",
- " '2024-01-16T04:00:00.000000000', '2024-01-16T05:00:00.000000000',\n",
- " '2024-01-16T06:00:00.000000000', '2024-01-16T07:00:00.000000000',\n",
- " '2024-01-16T08:00:00.000000000', '2024-01-16T09:00:00.000000000',\n",
- " '2024-01-16T10:00:00.000000000', '2024-01-16T11:00:00.000000000',\n",
- " '2024-01-16T12:00:00.000000000', '2024-01-16T13:00:00.000000000',\n",
- " '2024-01-16T14:00:00.000000000', '2024-01-16T15:00:00.000000000',\n",
- " '2024-01-16T16:00:00.000000000', '2024-01-16T17:00:00.000000000',\n",
- " '2024-01-16T18:00:00.000000000', '2024-01-16T19:00:00.000000000',\n",
- " '2024-01-16T20:00:00.000000000', '2024-01-16T21:00:00.000000000',\n",
- " '2024-01-16T22:00:00.000000000', '2024-01-16T23:00:00.000000000',\n",
- " '2024-01-17T00:00:00.000000000', '2024-01-17T01:00:00.000000000',\n",
- " '2024-01-17T02:00:00.000000000', '2024-01-17T03:00:00.000000000',\n",
- " '2024-01-17T04:00:00.000000000', '2024-01-17T05:00:00.000000000',\n",
- " '2024-01-17T06:00:00.000000000', '2024-01-17T07:00:00.000000000',\n",
- " '2024-01-17T08:00:00.000000000', '2024-01-17T09:00:00.000000000',\n",
- " '2024-01-17T10:00:00.000000000', '2024-01-17T11:00:00.000000000',\n",
- " '2024-01-17T12:00:00.000000000', '2024-01-17T13:00:00.000000000',\n",
- " '2024-01-17T14:00:00.000000000', '2024-01-17T15:00:00.000000000',\n",
- " '2024-01-17T16:00:00.000000000', '2024-01-17T17:00:00.000000000',\n",
- " '2024-01-17T18:00:00.000000000', '2024-01-17T19:00:00.000000000',\n",
- " '2024-01-17T20:00:00.000000000', '2024-01-17T21:00:00.000000000',\n",
- " '2024-01-17T22:00:00.000000000', '2024-01-17T23:00:00.000000000',\n",
- " '2024-01-18T00:00:00.000000000', '2024-01-18T01:00:00.000000000',\n",
- " '2024-01-18T02:00:00.000000000', '2024-01-18T03:00:00.000000000',\n",
- " '2024-01-18T04:00:00.000000000', '2024-01-18T05:00:00.000000000',\n",
- " '2024-01-18T06:00:00.000000000', '2024-01-18T07:00:00.000000000',\n",
- " '2024-01-18T08:00:00.000000000', '2024-01-18T09:00:00.000000000',\n",
- " '2024-01-18T10:00:00.000000000', '2024-01-18T11:00:00.000000000',\n",
- " '2024-01-18T12:00:00.000000000', '2024-01-18T13:00:00.000000000',\n",
- " '2024-01-18T14:00:00.000000000', '2024-01-18T15:00:00.000000000',\n",
- " '2024-01-18T16:00:00.000000000', '2024-01-18T17:00:00.000000000',\n",
- " '2024-01-18T18:00:00.000000000', '2024-01-18T19:00:00.000000000',\n",
- " '2024-01-18T20:00:00.000000000', '2024-01-18T21:00:00.000000000',\n",
- " '2024-01-18T22:00:00.000000000', '2024-01-18T23:00:00.000000000',\n",
- " '2024-01-19T00:00:00.000000000', '2024-01-19T01:00:00.000000000',\n",
- " '2024-01-19T02:00:00.000000000', '2024-01-19T03:00:00.000000000',\n",
- " '2024-01-19T04:00:00.000000000', '2024-01-19T05:00:00.000000000',\n",
- " '2024-01-19T06:00:00.000000000', '2024-01-19T07:00:00.000000000',\n",
- " '2024-01-19T08:00:00.000000000', '2024-01-19T09:00:00.000000000',\n",
- " '2024-01-19T10:00:00.000000000', '2024-01-19T11:00:00.000000000',\n",
- " '2024-01-19T12:00:00.000000000', '2024-01-19T13:00:00.000000000',\n",
- " '2024-01-19T14:00:00.000000000', '2024-01-19T15:00:00.000000000',\n",
- " '2024-01-19T16:00:00.000000000', '2024-01-19T17:00:00.000000000',\n",
- " '2024-01-19T18:00:00.000000000', '2024-01-19T19:00:00.000000000',\n",
- " '2024-01-19T20:00:00.000000000', '2024-01-19T21:00:00.000000000',\n",
- " '2024-01-19T22:00:00.000000000', '2024-01-19T23:00:00.000000000',\n",
- " '2024-01-20T00:00:00.000000000', '2024-01-20T01:00:00.000000000',\n",
- " '2024-01-20T02:00:00.000000000', '2024-01-20T03:00:00.000000000',\n",
- " '2024-01-20T04:00:00.000000000', '2024-01-20T05:00:00.000000000',\n",
- " '2024-01-20T06:00:00.000000000', '2024-01-20T07:00:00.000000000',\n",
- " '2024-01-20T08:00:00.000000000', '2024-01-20T09:00:00.000000000',\n",
- " '2024-01-20T10:00:00.000000000', '2024-01-20T11:00:00.000000000',\n",
- " '2024-01-20T12:00:00.000000000', '2024-01-20T13:00:00.000000000',\n",
- " '2024-01-20T14:00:00.000000000', '2024-01-20T15:00:00.000000000',\n",
- " '2024-01-20T16:00:00.000000000', '2024-01-20T17:00:00.000000000',\n",
- " '2024-01-20T18:00:00.000000000', '2024-01-20T19:00:00.000000000',\n",
- " '2024-01-20T20:00:00.000000000', '2024-01-20T21:00:00.000000000',\n",
- " '2024-01-20T22:00:00.000000000', '2024-01-20T23:00:00.000000000',\n",
- " '2024-01-21T00:00:00.000000000', '2024-01-21T01:00:00.000000000',\n",
- " '2024-01-21T02:00:00.000000000', '2024-01-21T03:00:00.000000000',\n",
- " '2024-01-21T04:00:00.000000000', '2024-01-21T05:00:00.000000000',\n",
- " '2024-01-21T06:00:00.000000000', '2024-01-21T07:00:00.000000000',\n",
- " '2024-01-21T08:00:00.000000000', '2024-01-21T09:00:00.000000000',\n",
- " '2024-01-21T10:00:00.000000000', '2024-01-21T11:00:00.000000000',\n",
- " '2024-01-21T12:00:00.000000000', '2024-01-21T13:00:00.000000000',\n",
- " '2024-01-21T14:00:00.000000000', '2024-01-21T15:00:00.000000000',\n",
- " '2024-01-21T16:00:00.000000000', '2024-01-21T17:00:00.000000000',\n",
- " '2024-01-21T18:00:00.000000000', '2024-01-21T19:00:00.000000000',\n",
- " '2024-01-21T20:00:00.000000000', '2024-01-21T21:00:00.000000000',\n",
- " '2024-01-21T22:00:00.000000000', '2024-01-21T23:00:00.000000000',\n",
- " '2024-01-22T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('AAAAAAAAAAAUfPDBB19avby8nSEx72' ... 'AAAAAAANj//////1hAAAAAAAAA+H8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'},\n",
- " {'hovertemplate': 'variable=Office(Heat)
time=%{x}
value=%{y}',\n",
- " 'legendgroup': 'Office(Heat)',\n",
- " 'marker': {'color': 'forestgreen', 'line': {'width': 0}, 'pattern': {'shape': ''}},\n",
- " 'name': 'Office(Heat)',\n",
- " 'orientation': 'v',\n",
- " 'showlegend': True,\n",
- " 'textposition': 'auto',\n",
- " 'type': 'bar',\n",
- " 'x': array(['2024-01-15T00:00:00.000000000', '2024-01-15T01:00:00.000000000',\n",
- " '2024-01-15T02:00:00.000000000', '2024-01-15T03:00:00.000000000',\n",
- " '2024-01-15T04:00:00.000000000', '2024-01-15T05:00:00.000000000',\n",
- " '2024-01-15T06:00:00.000000000', '2024-01-15T07:00:00.000000000',\n",
- " '2024-01-15T08:00:00.000000000', '2024-01-15T09:00:00.000000000',\n",
- " '2024-01-15T10:00:00.000000000', '2024-01-15T11:00:00.000000000',\n",
- " '2024-01-15T12:00:00.000000000', '2024-01-15T13:00:00.000000000',\n",
- " '2024-01-15T14:00:00.000000000', '2024-01-15T15:00:00.000000000',\n",
- " '2024-01-15T16:00:00.000000000', '2024-01-15T17:00:00.000000000',\n",
- " '2024-01-15T18:00:00.000000000', '2024-01-15T19:00:00.000000000',\n",
- " '2024-01-15T20:00:00.000000000', '2024-01-15T21:00:00.000000000',\n",
- " '2024-01-15T22:00:00.000000000', '2024-01-15T23:00:00.000000000',\n",
- " '2024-01-16T00:00:00.000000000', '2024-01-16T01:00:00.000000000',\n",
- " '2024-01-16T02:00:00.000000000', '2024-01-16T03:00:00.000000000',\n",
- " '2024-01-16T04:00:00.000000000', '2024-01-16T05:00:00.000000000',\n",
- " '2024-01-16T06:00:00.000000000', '2024-01-16T07:00:00.000000000',\n",
- " '2024-01-16T08:00:00.000000000', '2024-01-16T09:00:00.000000000',\n",
- " '2024-01-16T10:00:00.000000000', '2024-01-16T11:00:00.000000000',\n",
- " '2024-01-16T12:00:00.000000000', '2024-01-16T13:00:00.000000000',\n",
- " '2024-01-16T14:00:00.000000000', '2024-01-16T15:00:00.000000000',\n",
- " '2024-01-16T16:00:00.000000000', '2024-01-16T17:00:00.000000000',\n",
- " '2024-01-16T18:00:00.000000000', '2024-01-16T19:00:00.000000000',\n",
- " '2024-01-16T20:00:00.000000000', '2024-01-16T21:00:00.000000000',\n",
- " '2024-01-16T22:00:00.000000000', '2024-01-16T23:00:00.000000000',\n",
- " '2024-01-17T00:00:00.000000000', '2024-01-17T01:00:00.000000000',\n",
- " '2024-01-17T02:00:00.000000000', '2024-01-17T03:00:00.000000000',\n",
- " '2024-01-17T04:00:00.000000000', '2024-01-17T05:00:00.000000000',\n",
- " '2024-01-17T06:00:00.000000000', '2024-01-17T07:00:00.000000000',\n",
- " '2024-01-17T08:00:00.000000000', '2024-01-17T09:00:00.000000000',\n",
- " '2024-01-17T10:00:00.000000000', '2024-01-17T11:00:00.000000000',\n",
- " '2024-01-17T12:00:00.000000000', '2024-01-17T13:00:00.000000000',\n",
- " '2024-01-17T14:00:00.000000000', '2024-01-17T15:00:00.000000000',\n",
- " '2024-01-17T16:00:00.000000000', '2024-01-17T17:00:00.000000000',\n",
- " '2024-01-17T18:00:00.000000000', '2024-01-17T19:00:00.000000000',\n",
- " '2024-01-17T20:00:00.000000000', '2024-01-17T21:00:00.000000000',\n",
- " '2024-01-17T22:00:00.000000000', '2024-01-17T23:00:00.000000000',\n",
- " '2024-01-18T00:00:00.000000000', '2024-01-18T01:00:00.000000000',\n",
- " '2024-01-18T02:00:00.000000000', '2024-01-18T03:00:00.000000000',\n",
- " '2024-01-18T04:00:00.000000000', '2024-01-18T05:00:00.000000000',\n",
- " '2024-01-18T06:00:00.000000000', '2024-01-18T07:00:00.000000000',\n",
- " '2024-01-18T08:00:00.000000000', '2024-01-18T09:00:00.000000000',\n",
- " '2024-01-18T10:00:00.000000000', '2024-01-18T11:00:00.000000000',\n",
- " '2024-01-18T12:00:00.000000000', '2024-01-18T13:00:00.000000000',\n",
- " '2024-01-18T14:00:00.000000000', '2024-01-18T15:00:00.000000000',\n",
- " '2024-01-18T16:00:00.000000000', '2024-01-18T17:00:00.000000000',\n",
- " '2024-01-18T18:00:00.000000000', '2024-01-18T19:00:00.000000000',\n",
- " '2024-01-18T20:00:00.000000000', '2024-01-18T21:00:00.000000000',\n",
- " '2024-01-18T22:00:00.000000000', '2024-01-18T23:00:00.000000000',\n",
- " '2024-01-19T00:00:00.000000000', '2024-01-19T01:00:00.000000000',\n",
- " '2024-01-19T02:00:00.000000000', '2024-01-19T03:00:00.000000000',\n",
- " '2024-01-19T04:00:00.000000000', '2024-01-19T05:00:00.000000000',\n",
- " '2024-01-19T06:00:00.000000000', '2024-01-19T07:00:00.000000000',\n",
- " '2024-01-19T08:00:00.000000000', '2024-01-19T09:00:00.000000000',\n",
- " '2024-01-19T10:00:00.000000000', '2024-01-19T11:00:00.000000000',\n",
- " '2024-01-19T12:00:00.000000000', '2024-01-19T13:00:00.000000000',\n",
- " '2024-01-19T14:00:00.000000000', '2024-01-19T15:00:00.000000000',\n",
- " '2024-01-19T16:00:00.000000000', '2024-01-19T17:00:00.000000000',\n",
- " '2024-01-19T18:00:00.000000000', '2024-01-19T19:00:00.000000000',\n",
- " '2024-01-19T20:00:00.000000000', '2024-01-19T21:00:00.000000000',\n",
- " '2024-01-19T22:00:00.000000000', '2024-01-19T23:00:00.000000000',\n",
- " '2024-01-20T00:00:00.000000000', '2024-01-20T01:00:00.000000000',\n",
- " '2024-01-20T02:00:00.000000000', '2024-01-20T03:00:00.000000000',\n",
- " '2024-01-20T04:00:00.000000000', '2024-01-20T05:00:00.000000000',\n",
- " '2024-01-20T06:00:00.000000000', '2024-01-20T07:00:00.000000000',\n",
- " '2024-01-20T08:00:00.000000000', '2024-01-20T09:00:00.000000000',\n",
- " '2024-01-20T10:00:00.000000000', '2024-01-20T11:00:00.000000000',\n",
- " '2024-01-20T12:00:00.000000000', '2024-01-20T13:00:00.000000000',\n",
- " '2024-01-20T14:00:00.000000000', '2024-01-20T15:00:00.000000000',\n",
- " '2024-01-20T16:00:00.000000000', '2024-01-20T17:00:00.000000000',\n",
- " '2024-01-20T18:00:00.000000000', '2024-01-20T19:00:00.000000000',\n",
- " '2024-01-20T20:00:00.000000000', '2024-01-20T21:00:00.000000000',\n",
- " '2024-01-20T22:00:00.000000000', '2024-01-20T23:00:00.000000000',\n",
- " '2024-01-21T00:00:00.000000000', '2024-01-21T01:00:00.000000000',\n",
- " '2024-01-21T02:00:00.000000000', '2024-01-21T03:00:00.000000000',\n",
- " '2024-01-21T04:00:00.000000000', '2024-01-21T05:00:00.000000000',\n",
- " '2024-01-21T06:00:00.000000000', '2024-01-21T07:00:00.000000000',\n",
- " '2024-01-21T08:00:00.000000000', '2024-01-21T09:00:00.000000000',\n",
- " '2024-01-21T10:00:00.000000000', '2024-01-21T11:00:00.000000000',\n",
- " '2024-01-21T12:00:00.000000000', '2024-01-21T13:00:00.000000000',\n",
- " '2024-01-21T14:00:00.000000000', '2024-01-21T15:00:00.000000000',\n",
- " '2024-01-21T16:00:00.000000000', '2024-01-21T17:00:00.000000000',\n",
- " '2024-01-21T18:00:00.000000000', '2024-01-21T19:00:00.000000000',\n",
- " '2024-01-21T20:00:00.000000000', '2024-01-21T21:00:00.000000000',\n",
- " '2024-01-21T22:00:00.000000000', '2024-01-21T23:00:00.000000000',\n",
- " '2024-01-22T00:00:00.000000000'], dtype='datetime64[ns]'),\n",
- " 'xaxis': 'x',\n",
- " 'y': {'bdata': ('5ZuWpeU9QEDMU8WNBU89QGDXQkqFnk' ... 'AAAAA0QK7n4h/lezhAAAAAAAAA+H8='),\n",
- " 'dtype': 'f8'},\n",
- " 'yaxis': 'y'}],\n",
- " 'layout': {'bargap': 0,\n",
- " 'bargroupgap': 0,\n",
- " 'barmode': 'relative',\n",
- " 'legend': {'title': {'text': 'variable'}, 'tracegroupgap': 0},\n",
- " 'template': '...',\n",
- " 'title': {'text': 'Heat (flow_rate)'},\n",
- " 'xaxis': {'anchor': 'y', 'domain': [0.0, 1.0], 'title': {'text': 'time'}},\n",
- " 'yaxis': {'anchor': 'x', 'domain': [0.0, 1.0], 'title': {'text': 'value'}}}\n",
- "}))"
- ],
- "text/html": [
- ""
- ]
- },
- "execution_count": 39,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "execution_count": 39
+ ]
},
{
"cell_type": "markdown",
- "id": "78",
+ "id": "68",
"metadata": {},
"source": [
"## 10. Exporting Results\n",
@@ -7555,13 +759,10 @@
},
{
"cell_type": "code",
- "id": "79",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T14:13:18.710193Z",
- "start_time": "2025-12-13T14:13:18.681521Z"
- }
- },
+ "execution_count": null,
+ "id": "69",
+ "metadata": {},
+ "outputs": [],
"source": [
"# Get plot result\n",
"result = simple.statistics.plot.balance('Heat')\n",
@@ -7569,156 +770,37 @@
"print('PlotResult contains:')\n",
"print(f' data: {type(result.data).__name__} with vars {list(result.data.data_vars)}')\n",
"print(f' figure: {type(result.figure).__name__}')"
- ],
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "PlotResult contains:\n",
- " data: Dataset with vars ['Boiler(Heat)', 'ThermalStorage(Discharge)', 'ThermalStorage(Charge)', 'Office(Heat)']\n",
- " figure: Figure\n"
- ]
- }
- ],
- "execution_count": 40
+ ]
},
{
"cell_type": "code",
- "id": "80",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T14:13:18.736577Z",
- "start_time": "2025-12-13T14:13:18.723621Z"
- }
- },
+ "execution_count": null,
+ "id": "70",
+ "metadata": {},
+ "outputs": [],
"source": [
"# Export data to pandas DataFrame\n",
"df = result.data.to_dataframe()\n",
"df.head()"
- ],
- "outputs": [
- {
- "data": {
- "text/plain": [
- " Boiler(Heat) ThermalStorage(Discharge) \\\n",
- "time \n",
- "2024-01-15 00:00:00 -32.483571 -0.000000e+00 \n",
- "2024-01-15 01:00:00 -29.308678 5.275242e-13 \n",
- "2024-01-15 02:00:00 -33.238443 -7.086767e-13 \n",
- "2024-01-15 03:00:00 -101.411593 -3.516828e-13 \n",
- "2024-01-15 04:00:00 -128.829233 -5.613288e-13 \n",
- "\n",
- " ThermalStorage(Charge) Office(Heat) \n",
- "time \n",
- "2024-01-15 00:00:00 0.000000e+00 32.483571 \n",
- "2024-01-15 01:00:00 -3.747575e-13 29.308678 \n",
- "2024-01-15 02:00:00 8.792069e-13 33.238443 \n",
- "2024-01-15 03:00:00 6.379644e+01 37.615149 \n",
- "2024-01-15 04:00:00 1.000000e+02 28.829233 "
- ],
- "text/html": [
- "\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " | \n",
- " Boiler(Heat) | \n",
- " ThermalStorage(Discharge) | \n",
- " ThermalStorage(Charge) | \n",
- " Office(Heat) | \n",
- "
\n",
- " \n",
- " | time | \n",
- " | \n",
- " | \n",
- " | \n",
- " | \n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " | 2024-01-15 00:00:00 | \n",
- " -32.483571 | \n",
- " -0.000000e+00 | \n",
- " 0.000000e+00 | \n",
- " 32.483571 | \n",
- "
\n",
- " \n",
- " | 2024-01-15 01:00:00 | \n",
- " -29.308678 | \n",
- " 5.275242e-13 | \n",
- " -3.747575e-13 | \n",
- " 29.308678 | \n",
- "
\n",
- " \n",
- " | 2024-01-15 02:00:00 | \n",
- " -33.238443 | \n",
- " -7.086767e-13 | \n",
- " 8.792069e-13 | \n",
- " 33.238443 | \n",
- "
\n",
- " \n",
- " | 2024-01-15 03:00:00 | \n",
- " -101.411593 | \n",
- " -3.516828e-13 | \n",
- " 6.379644e+01 | \n",
- " 37.615149 | \n",
- "
\n",
- " \n",
- " | 2024-01-15 04:00:00 | \n",
- " -128.829233 | \n",
- " -5.613288e-13 | \n",
- " 1.000000e+02 | \n",
- " 28.829233 | \n",
- "
\n",
- " \n",
- "
\n",
- "
"
- ]
- },
- "execution_count": 41,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "execution_count": 41
+ ]
},
{
"cell_type": "code",
- "id": "81",
- "metadata": {
- "ExecuteTime": {
- "end_time": "2025-12-13T14:13:18.774445Z",
- "start_time": "2025-12-13T14:13:18.771181Z"
- }
- },
+ "execution_count": null,
+ "id": "71",
+ "metadata": {},
+ "outputs": [],
"source": [
"# Export figure to HTML (interactive)\n",
"# result.figure.write_html('balance_plot.html')\n",
"\n",
"# Export figure to image\n",
"# result.figure.write_image('balance_plot.png', scale=2)"
- ],
- "outputs": [],
- "execution_count": 42
+ ]
},
{
"cell_type": "markdown",
- "id": "85",
+ "id": "72",
"metadata": {},
"source": [
"## Summary\n",
diff --git a/docs/notebooks/10-transmission.ipynb b/docs/notebooks/10-transmission.ipynb
index 8c74e4e8c..85d2c53d8 100644
--- a/docs/notebooks/10-transmission.ipynb
+++ b/docs/notebooks/10-transmission.ipynb
@@ -135,7 +135,52 @@
"id": "8",
"metadata": {},
"outputs": [],
- "source": "fs_unidirectional = fx.FlowSystem(timesteps)\nfs_unidirectional.add_carriers(\n fx.Carrier('gas', '#3498db', 'kW'),\n fx.Carrier('electricity', '#f1c40f', 'kW'),\n fx.Carrier('heat', '#e74c3c', 'kW'),\n)\nfs_unidirectional.add_elements(\n # === Buses (one per site) ===\n fx.Bus('Heat_A', carrier='heat'), # Site A heat network\n fx.Bus('Heat_B', carrier='heat'), # Site B heat network\n fx.Bus('Gas', carrier='gas'), # Gas supply network\n fx.Bus('Electricity', carrier='electricity'), # Electricity grid\n # === Effect ===\n fx.Effect('costs', '€', 'Operating Costs', is_standard=True, is_objective=True),\n # === External supplies ===\n fx.Source('GasSupply', outputs=[fx.Flow('Gas', bus='Gas', size=1000, effects_per_flow_hour=0.06)]),\n fx.Source('ElecGrid', outputs=[fx.Flow('Elec', bus='Electricity', size=500, effects_per_flow_hour=0.25)]),\n # === Site A: Large gas boiler (cheap) ===\n fx.LinearConverter(\n 'GasBoiler_A',\n inputs=[fx.Flow('Gas', bus='Gas', size=500)],\n outputs=[fx.Flow('Heat', bus='Heat_A', size=400)],\n conversion_factors=[{'Gas': 1, 'Heat': 0.92}], # 92% efficiency\n ),\n # === Site B: Small electric boiler (expensive but flexible) ===\n fx.LinearConverter(\n 'ElecBoiler_B',\n inputs=[fx.Flow('Elec', bus='Electricity', size=250)],\n outputs=[fx.Flow('Heat', bus='Heat_B', size=250)],\n conversion_factors=[{'Elec': 1, 'Heat': 0.99}], # 99% efficiency\n ),\n # === Transmission: A → B (unidirectional) ===\n fx.Transmission(\n 'Pipe_A_to_B',\n in1=fx.Flow('from_A', bus='Heat_A', size=200), # Input from Site A\n out1=fx.Flow('to_B', bus='Heat_B', size=200), # Output to Site B\n relative_losses=0.05, # 5% heat loss in pipe\n ),\n # === Demands ===\n fx.Sink('Demand_A', inputs=[fx.Flow('Heat', bus='Heat_A', size=1, fixed_relative_profile=demand_a)]),\n fx.Sink('Demand_B', inputs=[fx.Flow('Heat', bus='Heat_B', size=1, fixed_relative_profile=demand_b)]),\n)\n\nfs_unidirectional.optimize(fx.solvers.HighsSolver())"
+ "source": [
+ "fs_unidirectional = fx.FlowSystem(timesteps)\n",
+ "fs_unidirectional.add_carriers(\n",
+ " fx.Carrier('gas', '#3498db', 'kW'),\n",
+ " fx.Carrier('electricity', '#f1c40f', 'kW'),\n",
+ " fx.Carrier('heat', '#e74c3c', 'kW'),\n",
+ ")\n",
+ "fs_unidirectional.add_elements(\n",
+ " # === Buses (one per site) ===\n",
+ " fx.Bus('Heat_A', carrier='heat'), # Site A heat network\n",
+ " fx.Bus('Heat_B', carrier='heat'), # Site B heat network\n",
+ " fx.Bus('Gas', carrier='gas'), # Gas supply network\n",
+ " fx.Bus('Electricity', carrier='electricity'), # Electricity grid\n",
+ " # === Effect ===\n",
+ " fx.Effect('costs', '€', 'Operating Costs', is_standard=True, is_objective=True),\n",
+ " # === External supplies ===\n",
+ " fx.Source('GasSupply', outputs=[fx.Flow('Gas', bus='Gas', size=1000, effects_per_flow_hour=0.06)]),\n",
+ " fx.Source('ElecGrid', outputs=[fx.Flow('Elec', bus='Electricity', size=500, effects_per_flow_hour=0.25)]),\n",
+ " # === Site A: Large gas boiler (cheap) ===\n",
+ " fx.LinearConverter(\n",
+ " 'GasBoiler_A',\n",
+ " inputs=[fx.Flow('Gas', bus='Gas', size=500)],\n",
+ " outputs=[fx.Flow('Heat', bus='Heat_A', size=400)],\n",
+ " conversion_factors=[{'Gas': 1, 'Heat': 0.92}], # 92% efficiency\n",
+ " ),\n",
+ " # === Site B: Small electric boiler (expensive but flexible) ===\n",
+ " fx.LinearConverter(\n",
+ " 'ElecBoiler_B',\n",
+ " inputs=[fx.Flow('Elec', bus='Electricity', size=250)],\n",
+ " outputs=[fx.Flow('Heat', bus='Heat_B', size=250)],\n",
+ " conversion_factors=[{'Elec': 1, 'Heat': 0.99}], # 99% efficiency\n",
+ " ),\n",
+ " # === Transmission: A → B (unidirectional) ===\n",
+ " fx.Transmission(\n",
+ " 'Pipe_A_to_B',\n",
+ " in1=fx.Flow('from_A', bus='Heat_A', size=200), # Input from Site A\n",
+ " out1=fx.Flow('to_B', bus='Heat_B', size=200), # Output to Site B\n",
+ " relative_losses=0.05, # 5% heat loss in pipe\n",
+ " ),\n",
+ " # === Demands ===\n",
+ " fx.Sink('Demand_A', inputs=[fx.Flow('Heat', bus='Heat_A', size=1, fixed_relative_profile=demand_a)]),\n",
+ " fx.Sink('Demand_B', inputs=[fx.Flow('Heat', bus='Heat_B', size=1, fixed_relative_profile=demand_b)]),\n",
+ ")\n",
+ "\n",
+ "fs_unidirectional.optimize(fx.solvers.HighsSolver());"
+ ]
},
{
"cell_type": "code",
@@ -228,7 +273,57 @@
"id": "16",
"metadata": {},
"outputs": [],
- "source": "fs_bidirectional = fx.FlowSystem(timesteps)\nfs_bidirectional.add_carriers(\n fx.Carrier('gas', '#3498db', 'kW'),\n fx.Carrier('electricity', '#f1c40f', 'kW'),\n fx.Carrier('heat', '#e74c3c', 'kW'),\n)\nfs_bidirectional.add_elements(\n # === Buses ===\n fx.Bus('Heat_A', carrier='heat'),\n fx.Bus('Heat_B', carrier='heat'),\n fx.Bus('Gas', carrier='gas'),\n fx.Bus('Electricity', carrier='electricity'),\n # === Effect ===\n fx.Effect('costs', '€', 'Operating Costs', is_standard=True, is_objective=True),\n # === External supplies ===\n fx.Source('GasSupply', outputs=[fx.Flow('Gas', bus='Gas', size=1000, effects_per_flow_hour=0.06)]),\n fx.Source('ElecGrid', outputs=[fx.Flow('Elec', bus='Electricity', size=500, effects_per_flow_hour=elec_price)]),\n # === Site A: Gas boiler ===\n fx.LinearConverter(\n 'GasBoiler_A',\n inputs=[fx.Flow('Gas', bus='Gas', size=500)],\n outputs=[fx.Flow('Heat', bus='Heat_A', size=400)],\n conversion_factors=[{'Gas': 1, 'Heat': 0.92}],\n ),\n # === Site B: Heat pump (efficient with variable electricity price) ===\n fx.LinearConverter(\n 'HeatPump_B',\n inputs=[fx.Flow('Elec', bus='Electricity', size=100)],\n outputs=[fx.Flow('Heat', bus='Heat_B', size=350)],\n conversion_factors=[{'Elec': 1, 'Heat': 3.5}], # COP = 3.5\n ),\n # === BIDIRECTIONAL Transmission ===\n fx.Transmission(\n 'Pipe_AB',\n # Direction 1: A → B\n in1=fx.Flow('from_A', bus='Heat_A', size=200),\n out1=fx.Flow('to_B', bus='Heat_B', size=200),\n # Direction 2: B → A\n in2=fx.Flow('from_B', bus='Heat_B', size=200),\n out2=fx.Flow('to_A', bus='Heat_A', size=200),\n relative_losses=0.05,\n prevent_simultaneous_flows_in_both_directions=True, # Can't flow both ways at once\n ),\n # === Demands ===\n fx.Sink('Demand_A', inputs=[fx.Flow('Heat', bus='Heat_A', size=1, fixed_relative_profile=demand_a)]),\n fx.Sink('Demand_B', inputs=[fx.Flow('Heat', bus='Heat_B', size=1, fixed_relative_profile=demand_b)]),\n)\n\nfs_bidirectional.optimize(fx.solvers.HighsSolver())"
+ "source": [
+ "fs_bidirectional = fx.FlowSystem(timesteps)\n",
+ "fs_bidirectional.add_carriers(\n",
+ " fx.Carrier('gas', '#3498db', 'kW'),\n",
+ " fx.Carrier('electricity', '#f1c40f', 'kW'),\n",
+ " fx.Carrier('heat', '#e74c3c', 'kW'),\n",
+ ")\n",
+ "fs_bidirectional.add_elements(\n",
+ " # === Buses ===\n",
+ " fx.Bus('Heat_A', carrier='heat'),\n",
+ " fx.Bus('Heat_B', carrier='heat'),\n",
+ " fx.Bus('Gas', carrier='gas'),\n",
+ " fx.Bus('Electricity', carrier='electricity'),\n",
+ " # === Effect ===\n",
+ " fx.Effect('costs', '€', 'Operating Costs', is_standard=True, is_objective=True),\n",
+ " # === External supplies ===\n",
+ " fx.Source('GasSupply', outputs=[fx.Flow('Gas', bus='Gas', size=1000, effects_per_flow_hour=0.06)]),\n",
+ " fx.Source('ElecGrid', outputs=[fx.Flow('Elec', bus='Electricity', size=500, effects_per_flow_hour=elec_price)]),\n",
+ " # === Site A: Gas boiler ===\n",
+ " fx.LinearConverter(\n",
+ " 'GasBoiler_A',\n",
+ " inputs=[fx.Flow('Gas', bus='Gas', size=500)],\n",
+ " outputs=[fx.Flow('Heat', bus='Heat_A', size=400)],\n",
+ " conversion_factors=[{'Gas': 1, 'Heat': 0.92}],\n",
+ " ),\n",
+ " # === Site B: Heat pump (efficient with variable electricity price) ===\n",
+ " fx.LinearConverter(\n",
+ " 'HeatPump_B',\n",
+ " inputs=[fx.Flow('Elec', bus='Electricity', size=100)],\n",
+ " outputs=[fx.Flow('Heat', bus='Heat_B', size=350)],\n",
+ " conversion_factors=[{'Elec': 1, 'Heat': 3.5}], # COP = 3.5\n",
+ " ),\n",
+ " # === BIDIRECTIONAL Transmission ===\n",
+ " fx.Transmission(\n",
+ " 'Pipe_AB',\n",
+ " # Direction 1: A → B\n",
+ " in1=fx.Flow('from_A', bus='Heat_A', size=200),\n",
+ " out1=fx.Flow('to_B', bus='Heat_B', size=200),\n",
+ " # Direction 2: B → A\n",
+ " in2=fx.Flow('from_B', bus='Heat_B', size=200),\n",
+ " out2=fx.Flow('to_A', bus='Heat_A', size=200),\n",
+ " relative_losses=0.05,\n",
+ " prevent_simultaneous_flows_in_both_directions=True, # Can't flow both ways at once\n",
+ " ),\n",
+ " # === Demands ===\n",
+ " fx.Sink('Demand_A', inputs=[fx.Flow('Heat', bus='Heat_A', size=1, fixed_relative_profile=demand_a)]),\n",
+ " fx.Sink('Demand_B', inputs=[fx.Flow('Heat', bus='Heat_B', size=1, fixed_relative_profile=demand_b)]),\n",
+ ")\n",
+ "\n",
+ "fs_bidirectional.optimize(fx.solvers.HighsSolver());"
+ ]
},
{
"cell_type": "code",
@@ -319,7 +414,83 @@
"id": "23",
"metadata": {},
"outputs": [],
- "source": "# Daily amortized pipe cost (simplified)\nPIPE_COST_PER_KW = 0.05 # €/kW/day capacity cost\n\nfs_invest = fx.FlowSystem(timesteps)\nfs_invest.add_carriers(\n fx.Carrier('gas', '#3498db', 'kW'),\n fx.Carrier('electricity', '#f1c40f', 'kW'),\n fx.Carrier('heat', '#e74c3c', 'kW'),\n)\nfs_invest.add_elements(\n # === Buses ===\n fx.Bus('Heat_A', carrier='heat'),\n fx.Bus('Heat_B', carrier='heat'),\n fx.Bus('Gas', carrier='gas'),\n fx.Bus('Electricity', carrier='electricity'),\n # === Effect ===\n fx.Effect('costs', '€', 'Operating Costs', is_standard=True, is_objective=True),\n # === External supplies ===\n fx.Source('GasSupply', outputs=[fx.Flow('Gas', bus='Gas', size=1000, effects_per_flow_hour=0.06)]),\n fx.Source('ElecGrid', outputs=[fx.Flow('Elec', bus='Electricity', size=500, effects_per_flow_hour=elec_price)]),\n # === Site A: Gas boiler ===\n fx.LinearConverter(\n 'GasBoiler_A',\n inputs=[fx.Flow('Gas', bus='Gas', size=500)],\n outputs=[fx.Flow('Heat', bus='Heat_A', size=400)],\n conversion_factors=[{'Gas': 1, 'Heat': 0.92}],\n ),\n # === Site B: Heat pump ===\n fx.LinearConverter(\n 'HeatPump_B',\n inputs=[fx.Flow('Elec', bus='Electricity', size=100)],\n outputs=[fx.Flow('Heat', bus='Heat_B', size=350)],\n conversion_factors=[{'Elec': 1, 'Heat': 3.5}],\n ),\n # === Site B: Backup electric boiler ===\n fx.LinearConverter(\n 'ElecBoiler_B',\n inputs=[fx.Flow('Elec', bus='Electricity', size=200)],\n outputs=[fx.Flow('Heat', bus='Heat_B', size=200)],\n conversion_factors=[{'Elec': 1, 'Heat': 0.99}],\n ),\n # === Transmission with INVESTMENT OPTIMIZATION ===\n # Investment parameters are passed via 'size' parameter\n fx.Transmission(\n 'Pipe_AB',\n in1=fx.Flow(\n 'from_A',\n bus='Heat_A',\n size=fx.InvestParameters(\n effects_of_investment_per_size={'costs': PIPE_COST_PER_KW * 7}, # Weekly cost\n minimum_size=0,\n maximum_size=300,\n ),\n ),\n out1=fx.Flow('to_B', bus='Heat_B'),\n in2=fx.Flow(\n 'from_B',\n bus='Heat_B',\n size=fx.InvestParameters(\n effects_of_investment_per_size={'costs': PIPE_COST_PER_KW * 7},\n minimum_size=0,\n maximum_size=300,\n ),\n ),\n out2=fx.Flow('to_A', bus='Heat_A'),\n relative_losses=0.05,\n balanced=True, # Same capacity in both directions\n prevent_simultaneous_flows_in_both_directions=True,\n ),\n # === Demands ===\n fx.Sink('Demand_A', inputs=[fx.Flow('Heat', bus='Heat_A', size=1, fixed_relative_profile=demand_a)]),\n fx.Sink('Demand_B', inputs=[fx.Flow('Heat', bus='Heat_B', size=1, fixed_relative_profile=demand_b)]),\n)\n\nfs_invest.optimize(fx.solvers.HighsSolver())"
+ "source": [
+ "# Daily amortized pipe cost (simplified)\n",
+ "PIPE_COST_PER_KW = 0.05 # €/kW/day capacity cost\n",
+ "\n",
+ "fs_invest = fx.FlowSystem(timesteps)\n",
+ "fs_invest.add_carriers(\n",
+ " fx.Carrier('gas', '#3498db', 'kW'),\n",
+ " fx.Carrier('electricity', '#f1c40f', 'kW'),\n",
+ " fx.Carrier('heat', '#e74c3c', 'kW'),\n",
+ ")\n",
+ "fs_invest.add_elements(\n",
+ " # === Buses ===\n",
+ " fx.Bus('Heat_A', carrier='heat'),\n",
+ " fx.Bus('Heat_B', carrier='heat'),\n",
+ " fx.Bus('Gas', carrier='gas'),\n",
+ " fx.Bus('Electricity', carrier='electricity'),\n",
+ " # === Effect ===\n",
+ " fx.Effect('costs', '€', 'Operating Costs', is_standard=True, is_objective=True),\n",
+ " # === External supplies ===\n",
+ " fx.Source('GasSupply', outputs=[fx.Flow('Gas', bus='Gas', size=1000, effects_per_flow_hour=0.06)]),\n",
+ " fx.Source('ElecGrid', outputs=[fx.Flow('Elec', bus='Electricity', size=500, effects_per_flow_hour=elec_price)]),\n",
+ " # === Site A: Gas boiler ===\n",
+ " fx.LinearConverter(\n",
+ " 'GasBoiler_A',\n",
+ " inputs=[fx.Flow('Gas', bus='Gas', size=500)],\n",
+ " outputs=[fx.Flow('Heat', bus='Heat_A', size=400)],\n",
+ " conversion_factors=[{'Gas': 1, 'Heat': 0.92}],\n",
+ " ),\n",
+ " # === Site B: Heat pump ===\n",
+ " fx.LinearConverter(\n",
+ " 'HeatPump_B',\n",
+ " inputs=[fx.Flow('Elec', bus='Electricity', size=100)],\n",
+ " outputs=[fx.Flow('Heat', bus='Heat_B', size=350)],\n",
+ " conversion_factors=[{'Elec': 1, 'Heat': 3.5}],\n",
+ " ),\n",
+ " # === Site B: Backup electric boiler ===\n",
+ " fx.LinearConverter(\n",
+ " 'ElecBoiler_B',\n",
+ " inputs=[fx.Flow('Elec', bus='Electricity', size=200)],\n",
+ " outputs=[fx.Flow('Heat', bus='Heat_B', size=200)],\n",
+ " conversion_factors=[{'Elec': 1, 'Heat': 0.99}],\n",
+ " ),\n",
+ " # === Transmission with INVESTMENT OPTIMIZATION ===\n",
+ " # Investment parameters are passed via 'size' parameter\n",
+ " fx.Transmission(\n",
+ " 'Pipe_AB',\n",
+ " in1=fx.Flow(\n",
+ " 'from_A',\n",
+ " bus='Heat_A',\n",
+ " size=fx.InvestParameters(\n",
+ " effects_of_investment_per_size={'costs': PIPE_COST_PER_KW * 7}, # Weekly cost\n",
+ " minimum_size=0,\n",
+ " maximum_size=300,\n",
+ " ),\n",
+ " ),\n",
+ " out1=fx.Flow('to_B', bus='Heat_B'),\n",
+ " in2=fx.Flow(\n",
+ " 'from_B',\n",
+ " bus='Heat_B',\n",
+ " size=fx.InvestParameters(\n",
+ " effects_of_investment_per_size={'costs': PIPE_COST_PER_KW * 7},\n",
+ " minimum_size=0,\n",
+ " maximum_size=300,\n",
+ " ),\n",
+ " ),\n",
+ " out2=fx.Flow('to_A', bus='Heat_A'),\n",
+ " relative_losses=0.05,\n",
+ " balanced=True, # Same capacity in both directions\n",
+ " prevent_simultaneous_flows_in_both_directions=True,\n",
+ " ),\n",
+ " # === Demands ===\n",
+ " fx.Sink('Demand_A', inputs=[fx.Flow('Heat', bus='Heat_A', size=1, fixed_relative_profile=demand_a)]),\n",
+ " fx.Sink('Demand_B', inputs=[fx.Flow('Heat', bus='Heat_B', size=1, fixed_relative_profile=demand_b)]),\n",
+ ")\n",
+ "\n",
+ "fs_invest.optimize(fx.solvers.HighsSolver());"
+ ]
},
{
"cell_type": "code",
@@ -362,7 +533,59 @@
"cell_type": "markdown",
"id": "27",
"metadata": {},
- "source": "## Key Concepts\n\n### Transmission Component Structure\n\n```python\nfx.Transmission(\n label='pipe_name',\n # Direction 1: A → B\n in1=fx.Flow('from_A', bus='Bus_A', size=100),\n out1=fx.Flow('to_B', bus='Bus_B', size=100),\n # Direction 2: B → A (optional - omit for unidirectional)\n in2=fx.Flow('from_B', bus='Bus_B', size=100),\n out2=fx.Flow('to_A', bus='Bus_A', size=100),\n # Loss parameters\n relative_losses=0.05, # 5% proportional loss\n absolute_losses=10, # 10 kW fixed loss when active (optional)\n # Operational constraints\n prevent_simultaneous_flows_in_both_directions=True,\n balanced=True, # Same capacity both directions (needs InvestParameters)\n)\n```\n\n### Loss Types\n\n| Loss Type | Formula | Use Case |\n|-----------|---------|----------|\n| **Relative** | `out = in × (1 - loss)` | Heat pipes, electrical lines |\n| **Absolute** | `out = in - loss` (when active) | Pump energy, standby losses |\n\n### Bidirectional vs Unidirectional\n\n| Configuration | Parameters | Use Case |\n|---------------|------------|----------|\n| **Unidirectional** | `in1`, `out1` only | One-way pipelines, conveyors |\n| **Bidirectional** | `in1`, `out1`, `in2`, `out2` | Power lines, reversible pipes |\n\n### Investment Optimization\n\nUse `InvestParameters` as the `size` parameter for capacity optimization:\n\n```python\nin1=fx.Flow(\n 'from_A', \n bus='Bus_A',\n size=fx.InvestParameters( # Pass InvestParameters as size\n effects_of_investment_per_size={'costs': cost_per_kw},\n minimum_size=0,\n maximum_size=500,\n ),\n)\n```"
+ "source": [
+ "## Key Concepts\n",
+ "\n",
+ "### Transmission Component Structure\n",
+ "\n",
+ "```python\n",
+ "fx.Transmission(\n",
+ " label='pipe_name',\n",
+ " # Direction 1: A → B\n",
+ " in1=fx.Flow('from_A', bus='Bus_A', size=100),\n",
+ " out1=fx.Flow('to_B', bus='Bus_B', size=100),\n",
+ " # Direction 2: B → A (optional - omit for unidirectional)\n",
+ " in2=fx.Flow('from_B', bus='Bus_B', size=100),\n",
+ " out2=fx.Flow('to_A', bus='Bus_A', size=100),\n",
+ " # Loss parameters\n",
+ " relative_losses=0.05, # 5% proportional loss\n",
+ " absolute_losses=10, # 10 kW fixed loss when active (optional)\n",
+ " # Operational constraints\n",
+ " prevent_simultaneous_flows_in_both_directions=True,\n",
+ " balanced=True, # Same capacity both directions (needs InvestParameters)\n",
+ ")\n",
+ "```\n",
+ "\n",
+ "### Loss Types\n",
+ "\n",
+ "| Loss Type | Formula | Use Case |\n",
+ "|-----------|---------|----------|\n",
+ "| **Relative** | `out = in × (1 - loss)` | Heat pipes, electrical lines |\n",
+ "| **Absolute** | `out = in - loss` (when active) | Pump energy, standby losses |\n",
+ "\n",
+ "### Bidirectional vs Unidirectional\n",
+ "\n",
+ "| Configuration | Parameters | Use Case |\n",
+ "|---------------|------------|----------|\n",
+ "| **Unidirectional** | `in1`, `out1` only | One-way pipelines, conveyors |\n",
+ "| **Bidirectional** | `in1`, `out1`, `in2`, `out2` | Power lines, reversible pipes |\n",
+ "\n",
+ "### Investment Optimization\n",
+ "\n",
+ "Use `InvestParameters` as the `size` parameter for capacity optimization:\n",
+ "\n",
+ "```python\n",
+ "in1=fx.Flow(\n",
+ " 'from_A', \n",
+ " bus='Bus_A',\n",
+ " size=fx.InvestParameters( # Pass InvestParameters as size\n",
+ " effects_of_investment_per_size={'costs': cost_per_kw},\n",
+ " minimum_size=0,\n",
+ " maximum_size=500,\n",
+ " ),\n",
+ ")\n",
+ "```"
+ ]
},
{
"cell_type": "markdown",
@@ -384,7 +607,23 @@
"cell_type": "markdown",
"id": "29",
"metadata": {},
- "source": "## Summary\n\nYou learned how to:\n\n- Create **unidirectional transmission** between two buses\n- Model **bidirectional transmission** with flow direction constraints\n- Apply **relative and absolute losses** to transmission\n- Optimize **transmission capacity** using InvestParameters\n- Analyze **multi-site energy systems** with interconnections\n\n### Next Steps\n\n- **[07-scenarios-and-periods](07-scenarios-and-periods.ipynb)**: Multi-year planning with uncertainty\n- **[08a-Aggregation](08a-aggregation.ipynb)**: Speed up large problems with time series aggregation\n- **[08b-Rolling Horizon](08b-rolling-horizon.ipynb)**: Decompose large problems into sequential segments"
+ "source": [
+ "## Summary\n",
+ "\n",
+ "You learned how to:\n",
+ "\n",
+ "- Create **unidirectional transmission** between two buses\n",
+ "- Model **bidirectional transmission** with flow direction constraints\n",
+ "- Apply **relative and absolute losses** to transmission\n",
+ "- Optimize **transmission capacity** using InvestParameters\n",
+ "- Analyze **multi-site energy systems** with interconnections\n",
+ "\n",
+ "### Next Steps\n",
+ "\n",
+ "- **[07-scenarios-and-periods](07-scenarios-and-periods.ipynb)**: Multi-year planning with uncertainty\n",
+ "- **[08a-Aggregation](08a-aggregation.ipynb)**: Speed up large problems with time series aggregation\n",
+ "- **[08b-Rolling Horizon](08b-rolling-horizon.ipynb)**: Decompose large problems into sequential segments"
+ ]
}
],
"metadata": {
diff --git a/flixopt/config.py b/flixopt/config.py
index 0280010d8..a29027d65 100644
--- a/flixopt/config.py
+++ b/flixopt/config.py
@@ -793,7 +793,7 @@ def notebook(cls) -> type[CONFIG]:
- Sets plotly renderer to 'notebook' for inline display
- Disables automatic plot.show() calls (notebooks display via _repr_html_)
- Enables SUCCESS-level console logging
- - Enables solver console output and main results logging
+ - Disables solver console output for cleaner notebook cells
Examples:
```python
@@ -818,9 +818,9 @@ def notebook(cls) -> type[CONFIG]:
# Light logging - SUCCESS level without too much noise
cls.Logging.enable_console('SUCCESS')
- # Enable solver console output and main results logging
- cls.Solving.log_to_console = True
- cls.Solving.log_main_results = True
+ # Disable verbose solver output for cleaner notebook cells
+ cls.Solving.log_to_console = False
+ cls.Solving.log_main_results = False
return cls
diff --git a/flixopt/flow_system.py b/flixopt/flow_system.py
index 8f2dba51b..13821b35b 100644
--- a/flixopt/flow_system.py
+++ b/flixopt/flow_system.py
@@ -597,7 +597,7 @@ def to_dataset(self, include_solution: bool = True) -> xr.Dataset:
xr.Dataset: Dataset containing all DataArrays with structure in attributes
"""
if not self.connected_and_transformed:
- logger.warning('FlowSystem is not connected_and_transformed. Connecting and transforming data now.')
+ logger.info('FlowSystem is not connected_and_transformed. Connecting and transforming data now.')
self.connect_and_transform()
ds = super().to_dataset()
@@ -1326,6 +1326,7 @@ def solve(self, solver: _Solver) -> FlowSystem:
self.model.solve(
solver_name=solver.name,
+ progress=CONFIG.Solving.log_to_console,
**solver.options,
)
diff --git a/flixopt/optimization.py b/flixopt/optimization.py
index b4c7eb2a4..b76ceaf03 100644
--- a/flixopt/optimization.py
+++ b/flixopt/optimization.py
@@ -242,6 +242,7 @@ def solve(
self.model.solve(
log_fn=pathlib.Path(log_file) if log_file is not None else self.folder / f'{self.name}.log',
solver_name=solver.name,
+ progress=CONFIG.Solving.log_to_console,
**solver.options,
)
self.durations['solving'] = round(timeit.default_timer() - t_start, 2)