pymor.algorithms.error¶
Module Contents¶
Functions¶
Analyze the model reduction error. |
|
- pymor.algorithms.error.reduction_error_analysis(rom, fom, reductor, test_mus, basis_sizes=0, error_estimator=True, condition=False, error_norms=(), error_norm_names=None, error_estimator_norm_index=0, custom=(), plot=False, plot_custom_logarithmic=True, pool=dummy_pool)[source]¶
Analyze the model reduction error.
The maximum model reduction error is estimated by solving the reduced
Modelfor given randomParameters.Parameters
- rom
The reduced
Model.- fom
The high-dimensional
Model.- reductor
The reductor which has created
rom.- test_mus
List of
Parametersto compute the errors for.- basis_sizes
Either a list of reduced basis dimensions to consider, or the number of dimensions (which are then selected equidistantly, always including the maximum reduced space dimension). The dimensions are input for the
dim-Parameter ofreductor.reduce().- error_estimator
If
Trueevaluate the error estimator ofromon the testParameters.- condition
If
True, compute the condition of the reduced system matrix for the given testParameters(can only be specified ifromis an instance ofStationaryModelandrom.operatoris linear).- error_norms
List of norms in which to compute the model reduction error.
- error_norm_names
Names of the norms given by
error_norms. IfNone, thenameattributes of the given norms are used.- error_estimator_norm_index
When
error_estimatorisTrueanderror_normsare specified, this is the index of the norm inerror_normsw.r.t. which to compute the effectivity of the error estimator.- custom
List of custom functions which are evaluated for each test
parameter valuesand basis size. The functions must have the signaturedef custom_value(rom, fom, reductor, mu, dim): pass
- plot
If
True, generate a plot of the computed quantities w.r.t. the basis size.- plot_custom_logarithmic
If
True, use a logarithmic y-axis to plot the computed custom values.- pool
If not
None, theWorkerPoolto use for parallelization.
Returns
Dict with the following fields
- mus
The test
Parameterswhich have been considered.- basis_sizes
The reduced basis dimensions which have been considered.
- norms
NumPy arrayof the norms of the high-dimensional solutions w.r.t. all given testParameters, reduced basis dimensions and norms inerror_norms. (Only present whenerror_normshas been specified.)- max_norms
Maxima of
normsover the given testParameters.- max_norm_mus
Parameterscorresponding tomax_norms.- errors
NumPy arrayof the norms of the model reduction errors w.r.t. all given testParameters, reduced basis dimensions and norms inerror_norms. (Only present whenerror_normshas been specified.)- max_errors
Maxima of
errorsover the given testParameters.- max_error_mus
Parameterscorresponding tomax_errors.- rel_errors
errorsdivided bynorms. (Only present whenerror_normshas been specified.)- max_rel_errors
Maxima of
rel_errorsover the given testParameters.- max_rel_error_mus
Parameterscorresponding tomax_rel_errors.- error_norm_names
Names of the given
error_norms. (Only present whenerror_normshas been specified.)- error_estimates
NumPy arrayof the model reduction error estimates w.r.t. all given testParametersand reduced basis dimensions. (Only present whenerror_estimatorisTrue.)- max_error_estimate
Maxima of
error_estimatesover the given testParameters.- max_error_estimate_mus
Parameterscorresponding tomax_error_estimates.- effectivities
errorsdivided byerror_estimates. (Only present whenerror_estimatorisTrueanderror_normshas been specified.)- min_effectivities
Minima of
effectivitiesover the given testParameters.- min_effectivity_mus
Parameterscorresponding tomin_effectivities.- max_effectivities
Maxima of
effectivitiesover the given testParameters.- max_effectivity_mus
Parameterscorresponding tomax_effectivities.- errors
NumPy arrayof the reduced system matrix conditions w.r.t. all given testParametersand reduced basis dimensions. (Only present whenconditionsisTrue.)- max_conditions
Maxima of
conditionsover the given testParameters.- max_condition_mus
Parameterscorresponding tomax_conditions.- custom_values
NumPy arrayof custom function evaluations w.r.t. all given testParameters, reduced basis dimensions and functions incustom. (Only present whencustomhas been specified.)- max_custom_values
Maxima of
custom_valuesover the given testParameters.- max_custom_values_mus
Parameterscorresponding tomax_custom_values.- time
Time (in seconds) needed for the error analysis.
- summary
String containing a summary of all computed quantities for the largest (last) considered basis size.
- figure
The figure containing the generated plots. (Only present when
plotisTrue.)