dispaset.pyomo package

Submodules

dispaset.pyomo.model module

This worksheet contains the two main functions to solve the DispaSET optimization problem using PYOMO.

Functions: - DispaSolve: Implements the rolling horizon - DispOptim: Performs the optimization for each horizon

@author: ‘Sylvain Quoilin’

dispaset.pyomo.model.DispOptim(sets, parameters, LPFormulation=False)[source]

This is the main optimization function of Dispaset. Two operation are performed: 1. Translation of the dispaset data format into the pyomo format 2. Definition of the Pyomo optimization model as a ConcreteModel

Parameters:
  • sets – Dictionary containing the sets (defined as a list of strings or integegers)
  • parameters – Dictionary containing the parameters of the optimization problem (in the DispaSET 2.1.1 format)
Returns:

The Pyomo optimization model instance

dispaset.pyomo.model.DispaSolve(sets, parameters, LPFormulation=False, path_cplex='')[source]

The DispaSolve function defines the rolling horizon optimization and saves each result variable in a pandas dataframe The definition of the rolling horizon must be included into the DispaSET Config parameter’

Parameters:
  • sets – Dictionary containing the sets (defined as a list of strings or integers)
  • parameters – Dictionary containing the parameters of the optimization problem (in the DispaSET 2.1.1 format)
Returns:

Dictionary of pandas dataframes with the optimization variables

dispaset.pyomo.model.after_solver(results)[source]
dispaset.pyomo.model.run_solver(instance, solver='cplex', solver_manager='serial', options_string='', path_cplex='')[source]
dispaset.pyomo.model.try_solvers(prefered_solver, path_cplex='')[source]

Initialize solver engine, trying different solvers. Faster solvers are tried first

dispaset.pyomo.utils module

dispaset.pyomo.utils.get_set_members(instance, sets)[source]

Get set members relative to a list of sets

Parameters:
  • instance – Pyomo Instance
  • sets – List of strings with the set names
Returns:

A list with the set members

dispaset.pyomo.utils.get_sets(instance, varname)[source]

Get sets that belong to a pyomo Variable or Param

Parameters:
  • instance – Pyomo Instance
  • varname – Name of the Pyomo Variable (string)
Returns:

A list with the sets that belong to this Param

dispaset.pyomo.utils.pyomo_format(sets, param)[source]

Function that flattens the multidimensional dispaset input data into the pyomo format: a dictionnary with a tuple and the parameter value. The tuple contains the strings of the corresponding set values

dispaset.pyomo.utils.pyomo_to_pandas(instance, varname)[source]

Function converting a pyomo variable or parameter into a pandas dataframe. The variable must have one or two dimensions and the sets must be provided as a list of lists

Parameters:
  • instance – Pyomo Instance
  • varname – Name of the Pyomo Variable (string)

Module contents