model module

class model.HeatNetworkModel(*args, **kwds)[source]

Bases: ConcreteModel

Class to represent the core model of the heat network optimization problem. It inherits from ConcreteModel.

export_model_parameters()[source]

This function exports the parameters from a pyomo model to a dictionary of dataframes. Does not depend on the model's structure, all the data is extracted from the model's components.

export_model_variables()[source]

" This function exports the variables from a pyomo model to a dictionary of dataframes. Does not depend on the model's structure, all the data is extracted from the model's components

export_results(case_study_name: str, model_name: str, config: dict)[source]

Perform some ex-post calculations and export the results to csv files.

Parameters:
  • case_study_name (str) -- name of the case study

  • model_name (str) -- name of the scenario / model

  • config (dict) -- configuration dictionary

fill_model_data(input_dict: dict)[source]

Read the model data from the input dictionary and set up the model sets and parameters in Pyomo.

Parameters:

input_dict (dict) -- input data from disk

initialize_constraints()[source]

Initialize the constraints of the model.

initialize_variables()[source]

Initialize the variables of the model.

model_run(config: dict)[source]

Run the model to solve the optimization problem. The solver can be defined here.

model.run_model(case_study_name: str, model_name: str)[source]

Run the complete workflow to load data, fill the model, run the optimization and export the results. This function is the main entry point for running the model.

Parameters:
  • case_study_name (str) -- the name of the case study

  • model_name (str) -- the name of the model