smash.Model.get_bound_constraints#
- Model.get_bound_constraints(states=False)[source]#
Get the boundary constraints of the Model parameters/states.
- Parameters:
- statesbool, default True
If True, return boundary constraints of the Model states instead of Model parameters.
- Returns:
- problemdict
The boundary constraint problem of the Model parameters/states. The keys are
‘num_vars’: The number of Model parameters/states.
‘names’: The name of Model parameters/states.
‘bounds’: The upper and lower bounds of each Model parameters/states (a sequence of
(min, max)).
Examples
>>> setup, mesh = smash.load_dataset("cance") >>> model = smash.Model(setup, mesh) >>> problem = model.get_bound_constraints() >>> problem { 'num_vars': 4, 'names': ['cp', 'cft', 'exc', 'lr'], 'bounds': [[1e-06, 1000.0], [1e-06, 1000.0], [-50.0, 50.0], [1e-06, 1000.0]] }