Examples

Python Script Examples

uesgraphs.examples.e1_readme_example

Creating and Visualizing a Simple Heating Network from the readme.md with uesgraphs

uesgraphs.examples.e2_simple_dhc_example

Creating and Visualizing a more sophisticated Network with uesgraphs including heating and cooling

uesgraphs.examples.e3_add_network_example

Extend the e2_simple_dhc model for an electric grid and visualize

uesgraphs.examples.e4_save_uesgraphs_example

""Write example district heating cooling network to JSON file.

uesgraphs.examples.e5_add_street_nodes_example

Usage of street nodes

uesgraphs.examples.e6_additional_building_attributes_example

Demonstration for adding additional attributes to building nodes (only terminal output)

uesgraphs.examples.e7_plot_uesgraphs_example

Creating advanced plots of uesgraphs.

uesgraphs.examples.e8_load_uesgraphs_example

How to load UESGraphs from JSON and OSM files.

uesgraphs.examples.e9_generate_ues_from_osm_example

Generate complex Urban Energy System (UES) Graph from OpenStreetMap (OSM) data.

uesgraphs.examples.e10_networks_example

Example Network Generator for UESGraphs :2: (WARNING/2) Title underline too short. Example Network Generator for UESGraphs =====================================

uesgraphs.examples.e11_model_generation_example

Modelica Model Generation using UESGraphs :2: (WARNING/2) Title underline too short. Modelica Model Generation using UESGraphs =======================================

uesgraphs.examples.e12_template_generation_example

Comprehensive Mako Template Generation for UESGraphs Modelica Components :2: (WARNING/2) Title underline too short. Comprehensive Mako Template Generation for UESGraphs Modelica Components =====================================================================

Example 13: Analysis and Visualization of Simulation Results

This example processes and visualizes simulation results from Dymola for UESGraphs-generated district heating network models. It demonstrates the analysis workflow from loading simulation data to creating network visualizations with key performance indicators.

Prerequisites:

  • Simulation period can be specified (default: one week)

  • Visualization uses time-averaged values for certain properties

  • AixLib version must be specified for correct data mapping

  • All paths are relative to the workspace directory

Location: uesgraphs/examples/e13_analyze_uesgraphs_example.py

GitHub: View on GitHub

Jupyter Notebook Examples

Example 14: Hydronic Sizing Example

This interactive notebook demonstrates demand-based mass flow estimation and hydronic sizing capabilities.

Topics covered:

  • Physically accurate mass flow calculations based on individual demand nodes

  • Automated pipe sizing using manufacturer catalogs

  • Robust network design using maximum flow principles

  • Flexible scenario analysis (peak vs average loads)

Location: uesgraphs/examples/e14_hydronic_sizing_example.ipynb

GitHub: View on GitHub

Example 15: Import from GeoJSON

This interactive notebook demonstrates how to import district heating networks from GeoJSON files.

Topics covered:

  • Importing network topology from GeoJSON files

  • Loading building data and supply points from separate GeoJSON files

  • Automatic network generation and validation

  • Generating visualizations during the import process

Location: uesgraphs/examples/e15_from_geojson_example.ipynb

GitHub: View on GitHub

Interactive Plotting Example

Additional interactive plotting demonstrations using Jupyter notebooks.

Location: uesgraphs/examples/interactive_plotting_example.ipynb

GitHub: View on GitHub