Initialization Methods¶
The IDAES toolset contains a number of utility functions to assist users with initializing models.
Available Methods¶
This module contains utility functions for initialization of IDAES models.
-
idaes.core.util.initialization.
fix_state_vars
(blk, state_args={})[source]¶ Method for fixing state variables within StateBlocks. Method takes an optional argument of values to use when fixing variables.
Parameters: - blk – An IDAES StateBlock object in which to fix the state variables
- state_args – a dict containing values to use when fixing state variables. Keys must match with names used in the define_state_vars method, and indices of any variables must agree.
Returns: A dict keyed by block index, state variable name (as defined by define_state_variables) and variable index indicating the fixed status of each variable before the fix_state_vars method was applied.
-
idaes.core.util.initialization.
propagate_state
(stream, direction='forward')[source]¶ This method propagates values between Ports along Arcs. Values can be propagated in either direction using the direction argument.
Parameters: - stream – Arc object along which to propagate values
- direction – direction in which to propagate values. Default = ‘forward’ Valid value: ‘forward’, ‘backward’.
Returns: None
-
idaes.core.util.initialization.
revert_state_vars
(blk, flags)[source]¶ Method to revert the fixed state of the state variables within an IDAES StateBlock based on a set of flags of the previous state.
Parameters: - blk – an IDAES StateBlock
- flags – a dict of bools indicating previous state with keys in the form (StateBlock index, state variable name (as defined by define_state_vars), var indices).
Returns: None
-
idaes.core.util.initialization.
solve_indexed_blocks
(solver, blocks, **kwds)[source]¶ This method allows for solving of Indexed Block components as if they were a single Block. A temporary Block object is created which is populated with the contents of the objects in the blocks argument and then solved.
Parameters: - solver – a Pyomo solver object to use when solving the Indexed Block
- blocks – an object which inherits from Block, or a list of Blocks
- kwds – a dict of argumnets to be passed to the solver
Returns: A Pyomo solver results object