pymor.algorithms.scm¶
Module for the successive constraints method.
Module Contents¶
- class pymor.algorithms.scm.LBSuccessiveConstraintsFunctional(operator, constraint_parameters, coercivity_constants, bounds, linprog_method='highs', linprog_options={}, M=None)[source]¶
Bases:
pymor.parameters.functionals.ParameterFunctionalParameterFunctionalproviding the lower bound from the successive constraints method.See [HRSP07].
Parameters
- operator
LincombOperatorfor which to provide a lower bound on the coercivity constant.- constraint_parameters
List of
Parametersused to construct the constraints.- coercivity_constants
A list of coercivity constants for the
constraint_parameters.- bounds
List of tuples containing lower and upper bounds for the design variables, i.e. the unknowns in the linear program.
- linprog_method
Name of the algorithm to use for solving the linear program using
scipy.optimize.linprog.- linprog_options
Dictionary of additional solver options passed to
scipy.optimize.linprog.- M
Number of parameters to use for estimating the coercivity constant. The
Mclosest parameters (with respect to the Euclidean distance) are chosen. IfNone, all parameters fromconstraint_parametersare used.
Methods
Evaluate the functional for given
parameter valuesmu.- evaluate(mu=None)[source]¶
Evaluate the functional for given
parameter valuesmu.
- class pymor.algorithms.scm.SuccessiveConstraintsSurrogate(operator, initial_parameter, bounds, product=None, linprog_method='highs', linprog_options={}, M=None)[source]¶
Bases:
pymor.algorithms.greedy.WeakGreedySurrogateSurrogate for constructing the functionals in a greedy algorithm.
This surrogate is used in a weak greedy algorithm to select the parameters used to compute the constraints for the lower and upper bounds derived by the successive constraints method.
Parameters
- operator
LincombOperatorfor which to provide a bounds on the coercivity constant.- initial_parameter
Parameterused to initialize the surrogate for the greedy algorithm.- bounds
List of tuples containing lower and upper bounds for the design variables, i.e. the unknowns in the linear program.
- product
Product with respect to which the coercivity constant should be estimated.
- linprog_method
Name of the algorithm to use for solving the linear program using
scipy.optimize.linprog.- linprog_options
Dictionary of additional solver options passed to
scipy.optimize.linprog.- M
Number of parameters to use for estimating the coercivity constant. The
Mclosest parameters (with respect to the Euclidean distance) are chosen. IfNone, all parameters are used.
- evaluate(mus, return_all_values=False)[source]¶
Evaluate the surrogate for given parameters.
Parameters
- mus
List of parameters for which to estimate the approximation error. When parallelization is used,
muscan be aRemoteObject.- return_all_values
See below.
Returns
If
return_all_valuesisTrue, anNumPy arrayof the estimated errors. Ifreturn_all_valuesisFalse, the maximum estimated error as first return value and the corresponding parameter as second return value.
- class pymor.algorithms.scm.UBSuccessiveConstraintsFunctional(operator, constraint_parameters, minimizers)[source]¶
Bases:
pymor.parameters.functionals.ParameterFunctionalParameterFunctionalproviding the upper bound from the successive constraints method.See [HRSP07].
Parameters
- operator
LincombOperatorfor which to provide an upper bound on the coercivity constant.- constraint_parameters
List of
Parametersused to construct the constraints.- minimizers
List of minimizers associated to the coercivity constants of the operators in
operator.
Methods
Evaluate the functional for given
parameter valuesmu.- evaluate(mu=None)[source]¶
Evaluate the functional for given
parameter valuesmu.
- pymor.algorithms.scm.construct_scm_functionals(operator, training_set, initial_parameter, atol=None, rtol=None, max_extensions=None, product=None, linprog_method='highs', linprog_options={}, M=None)[source]¶
Method to construct lower and upper bounds using the successive constraints method.
Parameters
- operator
LincombOperatorfor which to provide a bounds on the coercivity constant.- training_set
Parametersused as training set for the greedy algorithm.- initial_parameter
Parameterused to initialize the surrogate for the greedy algorithm.- atol
If not
None, stop the greedy algorithm if the maximum (estimated) error on the training set drops below this value.- rtol
If not
None, stop the greedy algorithm if the maximum (estimated) relative error on the training set drops below this value.- max_extensions
If not
None, stop the greedy algorithm aftermax_extensionsextension steps.- product
Product with respect to which the coercivity constant should be estimated.
- linprog_method
Name of the algorithm to use for solving the linear program using
scipy.optimize.linprog.- linprog_options
Dictionary of additional solver options passed to
scipy.optimize.linprog.- M
Number of parameters to use for estimating the coercivity constant. The
Mclosest parameters (with respect to the Euclidean distance) are chosen. IfNone, all parameters selected in the greedy method are used.
Returns
Functional for a lower bound on the coercivity constant, functional for an upper bound on the coercivity constant, and the results returned by the weak greedy algorithm.