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.ParameterFunctional
ParameterFunctional
providing the lower bound from the successive constraints method.See [HRSP07].
- Parameters:
operator –
LincombOperator
for which to provide a lower bound on the coercivity constant.constraint_parameters – List of
Parameters
used 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
M
closest parameters (with respect to the Euclidean distance) are chosen. IfNone
, all parameters fromconstraint_parameters
are used.
Methods
Evaluate the functional for given
parameter values
mu
.- evaluate(mu=None)[source]¶
Evaluate the functional for given
parameter values
mu
.
- class pymor.algorithms.scm.SuccessiveConstraintsSurrogate(operator, initial_parameter, bounds, product=None, linprog_method='highs', linprog_options={}, M=None)[source]¶
Bases:
pymor.algorithms.greedy.WeakGreedySurrogate
Surrogate 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 –
LincombOperator
for which to provide a bounds on the coercivity constant.initial_parameter –
Parameter
used 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
M
closest 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,
mus
can be aRemoteObject
.return_all_values – See below.
- Returns:
If
return_all_values
isTrue
, anNumPy array
of the estimated errors.If
return_all_values
isFalse
, the maximum estimated error as firstreturn value and the corresponding parameter as second return value.
- class pymor.algorithms.scm.UBSuccessiveConstraintsFunctional(operator, constraint_parameters, minimizers)[source]¶
Bases:
pymor.parameters.functionals.ParameterFunctional
ParameterFunctional
providing the upper bound from the successive constraints method.See [HRSP07].
- Parameters:
operator –
LincombOperator
for which to provide an upper bound on the coercivity constant.constraint_parameters – List of
Parameters
used 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 values
mu
.- evaluate(mu=None)[source]¶
Evaluate the functional for given
parameter values
mu
.
- 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 –
LincombOperator
for which to provide a bounds on the coercivity constant.training_set –
Parameters
used as training set for the greedy algorithm.initial_parameter –
Parameter
used 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_extensions
extension 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
M
closest 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.