wattadvisor.optimization_model.components.base

Copyright (c) 2007, Eclipse Foundation, Inc. and its licensors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

Attributes

logger

Classes

Component

Parent base class for all optimization energy components.

Module Contents

wattadvisor.optimization_model.components.base.logger
class wattadvisor.optimization_model.components.base.Component(name: str, interest_rate: None | float = None, parameters: None | dict = None)

Parent base class for all optimization energy components. Contains empty methods which are overidden by child classes.

Parameters:
  • name (str) – Name of the component

  • interest_rate (None | float, optional) – Interest rate to determine annuity factor for investment calculation of the component, by default None

  • parameters (None | dict, optional) –

    Dictionary of techno-economic parameters of the component, by default None. A dict of the following structure is expeceted. At least one key at first level (“scalars” or “tabs”) is required:

    {
        "scalars": {
            "parameter_title": 0
        },
        "tabs": {
            "tab_title": {
                "key_1": 1,
                "key_2": 2
            }
        }
    }
    

Raises:

ValueError – If values of interest_rate and lifespan (from parameters) are None.

name
interest_rate
annuity_factor = None
lifespan = None
bilance_variables
add_to_model(model: pyomo.core.Model, t: pyomo.core.RangeSet) pyomo.core.Model

Calls the appropriate functions to add parameters, variables and constraints to the pyomo model given by model.

Parameters:
  • model (Model) – Pyomo model to which the parameters, variables and constraints will be added.

  • t (RangeSet) – Time set over which time-variant parameters, variables and constraints will be added.

Returns:

Pyomo model with the added parameters, variables and constraints

Return type:

Model