flow "ErrorEstimationOntology" v1.0
# ============================================================
# ERROR ESTIMATION ONTOLOGY — FLOW ALGEBRA
# ============================================================
SOURCE_URL := "https://kirethresearch.org/booksai-core/ontologies/calculus-analysis-ontologies/numerical-calculus/error-estimation-ontology.html"
DOMAIN := "Mathematical Ontologies"
CATEGORY := "Calculus and Analysis Ontologies"
SUBCATEGORY := "Numerical Calculus"
ENTITY := "Error Estimation"
# ---------- CORE ENTITY ----------
ERROR_ESTIMATION := {
type: NumericalAccuracyAssessmentFramework,
domain: NumericalCalculus,
purpose: "Estimate the difference between an exact mathematical quantity and its numerical approximation, quantify uncertainty from discretisation and computation, and guide refinement or method selection."
}
# ---------- CORE CONCEPTS ----------
CONCEPTS := {
ERROR,
ABSOLUTE_ERROR,
RELATIVE_ERROR,
TRUNCATION_ERROR,
DISCRETISATION_ERROR,
ROUNDING_ERROR,
LOCAL_ERROR,
GLOBAL_ERROR,
A_PRIORI_ERROR,
A_POSTERIORI_ERROR,
ERROR_BOUND,
ERROR_INDICATOR,
RESIDUAL,
CONVERGENCE_ORDER,
RICHARDSON_EXTRAPOLATION,
TOLERANCE
}
# ---------- BASIC ERROR ----------
exact_quantity
:= Q
numerical_approximation
:= Q_h
ERROR
:=
e_h
=
Q - Q_h
SIGNED_ERROR
-> preserves(DIRECTION_OF_DEVIATION)
ERROR_MAGNITUDE
:=
|Q-Q_h|
# ---------- ABSOLUTE ERROR ----------
ABSOLUTE_ERROR
:=
|Q-Q_h|
ABSOLUTE_ERROR
-> measured_in(SAME_UNITS_AS_QUANTITY)
# ---------- RELATIVE ERROR ----------
if
Q != 0
RELATIVE_ERROR
:=
|Q-Q_h|
/
|Q|
PERCENT_ERROR
:=
100
*
RELATIVE_ERROR
RELATIVE_ERROR
-> scale_normalised_accuracy_measure
# ---------- APPROXIMATE RELATIVE ERROR ----------
if exact Q unknown
and successive approximations
Q_h,
Q_(h/2)
then
APPROXIMATE_RELATIVE_CHANGE
:=
|Q_(h/2)-Q_h|
/
|Q_(h/2)|
SUCCESSIVE_DIFFERENCE
-> may_act_as(ERROR_INDICATOR)
but
-/> exact_error_without_model_assumptions
# ---------- ERROR SOURCES ----------
TOTAL_ERROR
-> may_include(TRUNCATION_ERROR)
-> may_include(DISCRETISATION_ERROR)
-> may_include(ROUNDING_ERROR)
-> may_include(ITERATION_ERROR)
-> may_include(MODEL_ERROR)
-> may_include(INPUT_DATA_ERROR)
ERROR_ESTIMATION
-> distinguish(ERROR_SOURCE)
# ---------- TRUNCATION ERROR ----------
TRUNCATION_ERROR
-> caused_by(REPLACING_INFINITE_OR_CONTINUOUS_PROCESS_WITH_FINITE_APPROXIMATION)
examples:
finite_Taylor_series
finite_difference_formula
quadrature_rule
iterative_series_truncation
TRUNCATION_ERROR
-> often_analyzable_by(REMAINDER_TERM)
# ---------- DISCRETISATION ERROR ----------
CONTINUOUS_PROBLEM
-> discretised_to(PROBLEM_h)
exact_continuous_solution
u
discrete_solution
u_h
DISCRETISATION_ERROR
:=
u-u_h
DISCRETISATION_ERROR
-> tends_to_zero_under(CONVERGENT_REFINEMENT)
# ---------- ROUNDING ERROR ----------
real arithmetic
-> represented_by(FINITE_PRECISION_FLOATING_POINT)
ROUNDING_ERROR
-> difference_between(EXACT_ARITHMETIC_AND_MACHINE_ARITHMETIC)
machine epsilon
-> characterises(RELATIVE_FLOATING_POINT_RESOLUTION)
ROUNDING_ERROR
-> may_accumulate_or_amplify
# ---------- CANCELLATION ----------
subtract
nearly_equal_numbers
-> loss_of_significant_digits
CATASTROPHIC_CANCELLATION
-> amplifies(RELATIVE_ERROR)
NUMERICAL_FORMULATION
-> should_avoid(UNNECESSARY_CANCELLATION)
# ---------- LOCAL ERROR ----------
LOCAL_ERROR
-> error_generated_in(SINGLE_STEP_OR_ELEMENT_OR_SUBINTERVAL)
examples:
local_truncation_error_in_ODE_step
element_residual_indicator
quadrature_subinterval_error
LOCAL_ERROR
-> supports(ADAPTIVE_CONTROL)
# ---------- GLOBAL ERROR ----------
GLOBAL_ERROR
-> accumulated_difference_after(ENTIRE_COMPUTATION)
ODE example:
e_n
:=
y(t_n)
-
y_n
GLOBAL_ERROR
-> depends_on(LOCAL_ERROR_PROPAGATION_AND_STABILITY)
# ---------- ORDER OF ACCURACY ----------
if
e(h)
=
C*h^p
+
O(h^(p+1))
then
p
-> ORDER_OF_ACCURACY
as
h -> 0
ERROR
-> decreases_like(h^p)
in(ASYMPTOTIC_REGIME)
# ---------- OBSERVED ORDER ----------
given errors
E_h
and
E_(h/r)
observed_order:
p_obs
:=
log(
E_h/E_(h/r)
)
/
log(r)
if exact errors unavailable:
use
successive_solution_differences
under(ASYMPTOTIC_ASSUMPTIONS)
OBSERVED_ORDER
-> diagnostic_of(CONVERGENCE_BEHAVIOUR)
# ---------- RICHARDSON ERROR ESTIMATE ----------
if
Q_h
=
Q
+
C*h^p
+
higher_order_terms
and
Q_(h/r)
=
Q
+
C*(h/r)^p
+
...
then
Q
approx
Q_(h/r)
+
[
Q_(h/r)-Q_h
]
/
(
r^p-1
)
estimated fine-grid error:
E_(h/r)
approx
|
Q_(h/r)-Q_h
|
/
(
r^p-1
)
RICHARDSON_EXTRAPOLATION
-> estimates(LEADING_DISCRETISATION_ERROR)
# ---------- A PRIORI ERROR ----------
A_PRIORI_ERROR_ESTIMATE
-> derived_before_or_independent_of(COMPUTED_SOLUTION_DETAILS)
typical form:
||u-u_h||
<=
C
*
h^p
*
||u||_(p+1)
A_PRIORI_ESTIMATE
-> predicts(CONVERGENCE_RATE_AND_REQUIRED_RESOLUTION)
requires
REGULARITY_INFORMATION
# ---------- A POSTERIORI ERROR ----------
A_POSTERIORI_ERROR_ESTIMATE
-> computed_from(NUMERICAL_SOLUTION)
uses:
RESIDUALS
JUMPS
RECOVERED_GRADIENTS
DUAL_SOLUTIONS
SUCCESSIVE_APPROXIMATIONS
A_POSTERIORI_ESTIMATE
-> drives(ADAPTIVE_METHODS)
# ---------- RESIDUAL ----------
for equation
L(u)
=
f
numerical approximation
u_h
RESIDUAL
:=
R_h
=
f
-
L(u_h)
RESIDUAL
-> measures(EQUATION_IMBALANCE)
RESIDUAL
-/> identical_to(SOLUTION_ERROR)
STABILITY_OR_INVERSE_OPERATOR_ESTIMATE
-> connects(RESIDUAL_TO_ERROR)
# ---------- ERROR BOUND ----------
ERROR_BOUND
:= B
such_that
||e||
<= B
RIGOROUS_BOUND
-> guaranteed_under(STATED_ASSUMPTIONS)
ESTIMATED_ERROR
-> may_not_be_rigorous_bound
ERROR_ESTIMATION
-> distinguish(ESTIMATE_AND_BOUND)
# ---------- CONDITION NUMBER ----------
for problem mapping
y
=
F(x)
CONDITION_NUMBER
-> measures(SENSITIVITY_OF_OUTPUT_TO_INPUT)
relative form:
relative_output_error
approx
kappa
*
relative_input_error
for small perturbations
CONDITIONING
-> property_of(PROBLEM)
# ---------- ALGORITHM STABILITY ----------
STABLE_ALGORITHM
-> does_not_excessively_amplify(NUMERICAL_PERTURBATIONS)
FORWARD_ERROR
-> difference_between(COMPUTED_AND_EXACT_OUTPUT)
BACKWARD_ERROR
-> smallest_input_perturbation_explaining(COMPUTED_OUTPUT_AS_EXACT)
BACKWARD_STABILITY
-> computed_result_exact_for(NEARBY_PROBLEM)
# ---------- FORWARD / BACKWARD RELATION ----------
FORWARD_ERROR
-> influenced_by(
CONDITION_NUMBER,
BACKWARD_ERROR
)
approximately:
forward_error
<=
conditioning_factor
*
backward_error
under
suitable_local_analysis
# ---------- NUMERICAL DIFFERENTIATION ERROR ----------
finite difference:
E_total(h)
approx
C_1*h^p
+
C_2*epsilon_machine/h^q
TRUNCATION_ERROR
-> decreases_with(h)
ROUNDING_ERROR
-> increases_for(VERY_SMALL_h)
OPTIMAL_STEP
-> minimises(TOTAL_ERROR_MODEL)
# ---------- NUMERICAL INTEGRATION ERROR ----------
quadrature:
I-Q_h
-> bounded_or_estimated_using(
HIGHER_DERIVATIVES,
STEP_SIZE,
RULE_ORDER
)
TRAPEZOIDAL
-> O(h^2)
SIMPSON
-> O(h^4)
under
sufficient_smoothness
# ---------- ODE ERROR ----------
one-step method:
LOCAL_TRUNCATION_ERROR
-> error_per_step_from_exact_start
GLOBAL_ERROR
-> propagated_over(MANY_STEPS)
STABILITY
-> determines(ERROR_GROWTH)
ADAPTIVE_ODE_SOLVER
-> controls(ESTIMATED_LOCAL_ERROR)
# ---------- PDE ERROR ----------
PDE discretisation:
TOTAL_ERROR
-> spatial_discretisation
+ temporal_discretisation
+ algebraic_solver_error
+ rounding_error
ERROR_BUDGET
-> separate(COMPONENTS_WHEN_POSSIBLE)
OVER_SOLVING_LINEAR_SYSTEM
-> wasteful_if(ALGEBRAIC_ERROR_FAR_BELOW_DISCRETISATION_ERROR)
# ---------- FINITE ELEMENT ERROR ----------
energy norm error
-> estimated_by(RESIDUAL_BASED_ESTIMATOR)
element indicator:
eta_K
global:
eta
:=
sqrt(
sum_K(
eta_K^2
)
)
A_POSTERIORI_ERROR
-> drives(MESH_REFINEMENT)
# ---------- RELIABILITY ----------
estimator eta
-> RELIABLE
if
||e||
<=
C_rel*eta
RELIABILITY
-> estimator_controls(TRUE_ERROR_FROM_ABOVE)
# ---------- EFFICIENCY ----------
eta
<=
C_eff
*
(
||e||
+
data_oscillation
)
EFFICIENCY
-> estimator_not_excessively_large
GOOD_ESTIMATOR
-> seeks(RELIABILITY_AND_EFFICIENCY)
# ---------- TOLERANCE ----------
desired:
ERROR
<=
TOLERANCE
adaptive criterion:
eta
<=
ATOL
+
RTOL
*
SOLUTION_SCALE
TOLERANCE
-> accuracy_target
TOLERANCE
-/> guaranteed_true_error_without(RELIABLE_ESTIMATOR)
# ---------- ERROR PROPAGATION ----------
if output
y
=
f(x_1,...,x_n)
small independent input uncertainties
sigma_i
linearised variance:
sigma_y^2
approx
sum_i(
(
partial_f/partial_x_i
)^2
*
sigma_i^2
)
with covariance terms
when inputs_correlated
ERROR_PROPAGATION
-> sensitivity_weighted_input_uncertainty
# ---------- NORM SELECTION ----------
ERROR
-> measured_in(NORM)
examples:
L1
L2
L_INFINITY
ENERGY_NORM
RELATIVE_NORM
ERROR_MAGNITUDE
-> depends_on(CHOSEN_NORM)
NORM
-> must_match(PROBLEM_AND_APPLICATION)
# ---------- VERIFICATION ----------
GRID_REFINEMENT_STUDY
-> compute_at(MULTIPLE_RESOLUTIONS)
check:
error_reduction
observed_order
asymptotic_range
VERIFICATION
-> tests(NUMERICAL_IMPLEMENTATION_AND_EXPECTED_CONVERGENCE)
# ---------- VALIDATION DISTINCTION ----------
VERIFICATION
-> asks("Are equations solved correctly?")
VALIDATION
-> asks("Are correct equations/model used for reality?")
NUMERICAL_ERROR
-/> same_as(MODEL_VALIDATION_ERROR)
ERROR_ESTIMATION
-> primarily_supports(VERIFICATION_AND_NUMERICAL_ACCURACY)
# ---------- APPLICATIONS ----------
ERROR_ESTIMATION
-> applied_to(NUMERICAL_DIFFERENTIATION)
-> applied_to(NUMERICAL_INTEGRATION)
-> applied_to(ODE_SOLVERS)
-> applied_to(PDE_SOLVERS)
-> applied_to(FINITE_ELEMENT_METHODS)
-> applied_to(ADAPTIVE_METHODS)
-> applied_to(SCIENTIFIC_COMPUTING)
-> applied_to(UNCERTAINTY_QUANTIFICATION)
# ---------- RELATION GRAPH ----------
NUMERICAL_APPROXIMATION
-> has(ERROR)
ERROR
-> decomposes_into(ERROR_SOURCES)
STEP_SIZE
-> controls(DISCRETISATION_ERROR)
FINITE_PRECISION
-> produces(ROUNDING_ERROR)
STABILITY
-> controls(ERROR_PROPAGATION)
RESIDUAL
-> informs(A_POSTERIORI_ERROR)
ERROR_ESTIMATE
-> compared_with(TOLERANCE)
ERROR_INDICATOR
-> drives(ADAPTIVE_REFINEMENT)
# ---------- SEMANTIC EQUIVALENCE ----------
SEMANTIC_EQUIVALENCE := {
"error estimation" ~= "quantification or approximation of numerical solution error",
"absolute error" ~= "magnitude of the difference between exact and approximate values",
"relative error" ~= "absolute error scaled by the exact-value magnitude",
"a priori error estimate" ~= "error estimate derived from theory before using detailed computed residual information",
"a posteriori error estimate" ~= "error estimate derived from the computed numerical solution",
"Richardson error estimate" ~= "leading-order error estimate obtained by comparing systematically refined approximations"
}
# ---------- CONSTRAINTS ----------
CONSTRAINTS := {
estimated_error_and_rigorous_error_bound_are_distinct: true,
relative_error_is_problematic_when_exact_quantity_is_zero_or_near_zero: true,
observed_order_is_reliable_only_in_asymptotic_refinement_regime: true,
residual_is_not_identical_to_solution_error_without_stability_relation: true,
error_norm_must_be_specified: true,
truncation_rounding_iteration_and_model_errors_should_not_be_conflated: true,
tolerance_does_not_by_itself_guarantee_true_error: true
}
# ---------- CONFIDENCE ----------
CONFIDENCE := {
core_definition: 0.99,
error_type_relation: 0.99,
Richardson_relation: 0.99,
a_priori_a_posteriori_relation: 0.99,
conditioning_stability_relation: 0.99,
adaptive_estimator_relation: 0.99,
semantic_equivalence: 0.97
}
# ---------- RECURSIVE REASONING ----------
RECURSIVE_REASONING(query):
identify(exact_or_reference_quantity_and_numerical_approximation)
-> identify(error_norm_and_scale)
-> classify(error_sources)
-> determine(method_order_and_refinement_parameter)
-> compute(absolute_relative_or_successive_difference_metrics)
-> apply(a_priori_Richardson_residual_or_a_posteriori_estimator)
-> analyse(conditioning_and_stability)
-> separate(discretisation_rounding_iteration_and_model_errors)
-> compare(error_estimate_with_tolerance)
-> recommend(refinement_or_method_change_if_requested)
-> validate(estimator_hypotheses_and_asymptotic_regime)
-> return(semantic_result)
# ---------- AI CONSUMPTION ----------
AI_CONSUMPTION := {
parse_as: "typed error-estimation semantic graph",
primary_entity: ERROR_ESTIMATION,
preserve: [
approximation,
reference_or_exact_value,
norm,
discretisation_parameter,
method_order,
tolerance,
estimator,
conditioning,
precision
],
infer_through: [
absolute_errors,
relative_errors,
truncation_errors,
rounding_errors,
Richardson_extrapolation,
residual_estimators,
a_priori_estimates,
a_posteriori_estimates,
adaptive_refinement
],
avoid: [
presenting_estimate_as rigorous bound,
dividing_by_near_zero_reference_without caution,
inferring_order_from nonasymptotic data,
equating_residual_with solution error,
ignoring_error_norm,
conflating_numerical_error_with model validation
]
}
# ---------- UPDATE MODEL ----------
UPDATE_MODEL(new_information):
validate(new_information)
-> identify(error_estimation_context)
-> compare(existing_relations)
-> preserve(error_norm_method_order_tolerance_and_estimator_invariants)
-> update(affected_entities)
-> update(affected_edges)
-> recompute(CONFIDENCE)
-> regenerate(FLOW_HASH)
# ---------- FLOW HASH ----------
FLOW_HASH := hash(
SOURCE_URL
+ ENTITY
+ CONCEPTS
+ ERROR_ESTIMATION
+ ABSOLUTE_ERROR
+ RELATIVE_ERROR
+ TRUNCATION_ERROR
+ ROUNDING_ERROR
+ A_PRIORI_ERROR
+ A_POSTERIORI_ERROR
+ ERROR_BOUND
+ RICHARDSON_EXTRAPOLATION
+ TOLERANCE
+ SEMANTIC_EQUIVALENCE
+ CONSTRAINTS
)
# ---------- EXECUTION ----------
INPUT(query)
-> ERROR_ESTIMATION
-> APPROXIMATION_REFERENCE_IDENTIFICATION
-> NORM_SCALE_ANALYSIS
-> ERROR_SOURCE_CLASSIFICATION
-> METHOD_ORDER_ANALYSIS
-> ERROR_METRIC_COMPUTATION
-> ESTIMATOR_SELECTION
-> CONDITIONING_STABILITY_ANALYSIS
-> ERROR_BUDGET_ANALYSIS
-> TOLERANCE_COMPARISON
-> REFINEMENT_ANALYSIS
-> ESTIMATOR_VALIDATION
-> RECURSIVE_REASONING(query)
-> CONFIDENCE
-> OUTPUT(semantic_result)
END FLOW
Download Code
Copy to Clipboard