Initialize From Data¶
This Initializer
is intended to initialize a model from a user defined data source. This data source may take the form of a pre-saved json file or a user provided dict-like data structure. This Initializer
loads variable values from the data provided and checks that the resulting values satisfy all constraints in the model.
Note
When initializing from a json format, only the values of unfixed variables will be loaded. Any other information stored in the json format (e.g., whether a variable is fixed or any information regarding constraints) will be ignored.
FromDataInitializer Class¶
- class idaes.core.initialization.initialize_from_data.FromDataInitializer(**kwargs)[source]¶
This is a general purpose Initializer object which attempts to initialize a model from user provided data.
Data can be provided in either json format or as a dict-like structure. The loaded solution is then checked to ensure that it satisfies all constraints in the model.
- Keyword Arguments
constraint_tolerance – Tolerance for checking constraint convergence
output_level – Set output level for logging messages
- initialize(model, initial_guesses=None, json_file=None)¶
Execute full initialization routine.
- Parameters
Note - can only provide one of initial_guesses or json_file.
- precheck(model)¶
Check for satisfied degrees of freedom before running initialization.
- Parameters
model (Block) – Pyomo Block to fix states on.
- Returns
None
- Raises
InitializationError if Degrees of Freedom do not equal 0. –