PyomoImplicitFunctionBase

(class from pyomo.contrib.pynumero.algorithms.solvers.implicit_functions)

class pyomo.contrib.pynumero.algorithms.solvers.implicit_functions.PyomoImplicitFunctionBase(variables, constraints, parameters)[source]

Bases: object

A base class defining an API for implicit functions defined using Pyomo components. In particular, this is the API required by ExternalPyomoModel.

Implicit functions are defined by two lists of Pyomo VarData and one list of Pyomo ConstraintData. The first list of VarData corresponds to “variables” defining the outputs of the implicit function. The list of ConstraintData are equality constraints that are converged to evaluate the implicit function. The second list of VarData are variables to be treated as “parameters” or inputs to the implicit function.

__init__(variables, constraints, parameters)[source]
Parameters:
  • variables (List of VarData) – Variables to be treated as outputs of the implicit function

  • constraints (List of ConstraintData) – Constraints that are converged to evaluate the implicit function

  • parameters (List of VarData) – Variables to be treated as inputs to the implicit function

Methods

__init__(variables, constraints, parameters)

evaluate_outputs()

Returns the values of the variables that are treated as outputs of the implicit function

get_block()

get_constraints()

get_parameters()

get_variables()

set_parameters(values)

Sets the parameters of the system that defines the implicit function.

update_pyomo_model()

Sets values of "parameter variables" and "output variables" to the most recent values set or computed in this implicit function

Member Documentation

evaluate_outputs()[source]

Returns the values of the variables that are treated as outputs of the implicit function

The returned values do not necessarily need to be the values stored in the Pyomo variables, as long as they are consistent with the latest parameters that have been set.

Returns:

Array with values corresponding to the “output variables” in the order they were specified in the constructor

Return type:

NumPy array

set_parameters(values)[source]

Sets the parameters of the system that defines the implicit function.

This method does not necessarily need to update values of the Pyomo variables, as long as the next evaluation of this implicit function is consistent with these inputs.

Parameters:

values (NumPy array) – Array of values to set for the “parameter variables” in the order they were specified in the constructor

update_pyomo_model()[source]

Sets values of “parameter variables” and “output variables” to the most recent values set or computed in this implicit function