AI INTERPRETATION NOTE
This Flow Algebra defines the Numerical Differentiation Ontology 2 within the Kireth Research Semantic Library. Numerical differentiation approximates derivatives from discrete function evaluations or sampled data. This ontology supports forward, backward and central differences, higher-order stencils, derivative matrices, gradient, Jacobian and Hessian approximation, Richardson extrapolation, step-size selection, truncation and round-off error, noise sensitivity, complex-step differentiation, automatic differentiation relationships, finite precision, convergence and verification.
FLOW_ALGEBRA_RECORD {
METADATA {
FLOW_NAME = "Numerical Differentiation Ontology 2"
FLOW_TYPE = "Mathematical Ontology"
DOMAIN = "Mathematics"
SUBDOMAIN = "Computational Mathematics"
SPECIALISATION = "Numerical Calculus / Numerical Differentiation"
CANONICAL_PAGE = "https://kirethresearch.org/booksai-core/ontologies/mathematical-ontologies/computational-mathematics-ontologies/numerical-calculus/numerical-differentiation-ontology-2.html"
LANGUAGE = "en-GB"
VERSION = "1.0"
STATUS = "active"
}
IDENTITY {
PRIMARY_ENTITY = NumericalDifferentiation
ENTITY_CLASS = DiscreteDerivativeApproximationFramework
PRIMARY_CONTEXT = NumericalCalculus
DEFINITION = "Numerical differentiation is the computational approximation of one or more derivatives using discrete function evaluations, sampled data or discrete operators."
SYMBOLIC_FORMS = [
"f'(x) approximately (f(x+h)-f(x))/h",
"f'(x) approximately (f(x+h)-f(x-h))/(2*h)",
"f''(x) approximately (f(x+h)-2*f(x)+f(x-h))/h^2",
"D_h f -> f'"
]
SEMANTIC_ROLE = "Provides machine-readable semantics for finite-difference derivative approximation, stencil design, multidimensional derivatives, step-size selection, error balancing, extrapolation, noise sensitivity and finite-precision validation."
}
SCOPE {
INCLUDE = [
NumericalDifferentiation,
NumericalDerivative,
DerivativeApproximation,
FiniteDifference,
DifferenceQuotient,
ForwardDifference,
BackwardDifference,
CentralDifference,
SymmetricDifference,
OneSidedDifference,
HigherOrderDifference,
FirstDerivativeApproximation,
SecondDerivativeApproximation,
HigherDerivativeApproximation,
DifferenceStencil,
FiniteDifferenceStencil,
ThreePointStencil,
FivePointStencil,
SevenPointStencil,
WideStencil,
CompactFiniteDifference,
FiniteDifferenceCoefficient,
FornbergWeights,
DerivativeMatrix,
DifferentiationMatrix,
DiscreteDerivativeOperator,
GradientApproximation,
PartialDerivativeApproximation,
DirectionalDerivativeApproximation,
JacobianApproximation,
HessianApproximation,
LaplacianApproximation,
DivergenceApproximation,
CurlApproximation,
UniformGrid,
NonuniformGrid,
GridSpacing,
StepSize,
AdaptiveStepSize,
OptimalStepSize,
RichardsonExtrapolation,
ExtrapolatedDerivative,
TruncationError,
LeadingErrorTerm,
RoundOffError,
Cancellation,
CatastrophicCancellation,
NoiseAmplification,
DataNoise,
MeasurementNoise,
Smoothing,
RegularisedDifferentiation,
PolynomialInterpolationDifferentiation,
SplineDifferentiation,
SavitzkyGolayDifferentiation,
ComplexStepDifferentiation,
MulticomplexDifferentiation,
AutomaticDifferentiation,
SymbolicDifferentiation,
FiniteDifferenceJacobian,
FiniteDifferenceHessian,
SparseJacobianApproximation,
GraphColoringForJacobian,
DirectionalDifference,
FrechetDerivativeApproximation,
Consistency,
Convergence,
ConvergenceRate,
OrderOfAccuracy,
Stability,
NumericalStability,
Conditioning,
Sensitivity,
FloatingPointArithmetic,
MachinePrecision,
Underflow,
Overflow,
Verification,
ManufacturedSolution,
ReferenceDerivative,
Benchmarking,
Reproducibility
]
EXCLUDE_AS_PRIMARY = [
SymbolicDifferentiationWithoutNumericalApproximation,
AutomaticDifferentiationWithoutApproximationContext,
DifferentialEquationDiscretisationWithoutDerivativeApproximationFocus,
PureInterpolationWithoutDerivativeExtraction
]
DISAMBIGUATION_RULE = "When derivatives are approximated computationally from discrete function evaluations, samples or discrete operators, interpret the context as numerical differentiation."
}
CORE_CONCEPTS {
NumericalDifferentiation = "Approximation of derivatives using discrete computational information."
FiniteDifference = "Derivative approximation formed from weighted differences of function values."
DifferenceStencil = "Set of sample locations and weights used to approximate a derivative."
StepSize = "Spacing controlling the scale of finite-difference sampling."
Truncation-Error = "Error caused by replacing the continuous derivative by a finite approximation."
RoundOffError = "Error caused by finite-precision arithmetic in function values and differencing."
RichardsonExtrapolation = "Combination of derivative estimates at multiple step sizes to cancel leading truncation error."
ComplexStepDifferentiation = "Derivative approximation using the imaginary part of a complex perturbation to avoid subtractive cancellation for suitable analytic functions."
}
RELATIONS {
NumericalDifferentiation --is_child_of--> NumericalCalculus
NumericalDifferentiation --uses--> DiscreteFunctionEvaluations
FiniteDifference --is_type_of--> NumericalDifferentiation
ForwardDifference --is_type_of--> OneSidedDifference
BackwardDifference --is_type_of--> OneSidedDifference
CentralDifference --is_type_of--> SymmetricDifference
DifferenceStencil --has--> FiniteDifferenceCoefficient
StepSize --controls--> TruncationError
StepSize --influences--> RoundOffError
SmallerStepSize --can_reduce--> TruncationError
SmallerStepSize --can_increase--> Cancellation
RichardsonExtrapolation --reduces--> LeadingTruncationError
GradientApproximation --contains--> PartialDerivativeApproximation
JacobianApproximation --contains--> PartialDerivativeApproximation
HessianApproximation --contains--> SecondPartialDerivativeApproximation
PolynomialInterpolationDifferentiation --uses--> Interpolation
SplineDifferentiation --uses--> SplineInterpolation
ComplexStepDifferentiation --reduces--> SubtractiveCancellation
RegularisedDifferentiation --addresses--> NoiseAmplification
Verification --checks--> NumericalDerivative
}
OPERATORS {
FORWARD_DIFFERENCE(f,x,h) := (f(x+h)-f(x))/h
BACKWARD_DIFFERENCE(f,x,h) := (f(x)-f(x-h))/h
CENTRAL_DIFFERENCE(f,x,h) := (f(x+h)-f(x-h))/(2*h)
SECOND_CENTRAL_DIFFERENCE(f,x,h) := (f(x+h)-2*f(x)+f(x-h))/h^2
FIVE_POINT_FIRST_DERIVATIVE(f,x,h) := (f(x-2*h)-8*f(x-h)+8*f(x+h)-f(x+2*h))/(12*h)
RICHARDSON(D_h,D_h2,p) := D_ext=D_h2+(D_h2-D_h)/(2^p-1)
COMPLEX_STEP(f,x,h) := Im(f(x+i*h))/h
DIRECTIONAL_DIFFERENCE(F,x,v,h) := (F(x+h*v)-F(x))/h
}
AXIOMS {
A1 = "Numerical differentiation replaces a limiting derivative process with finite discrete approximation."
A2 = "Finite-difference consistency requires the discrete derivative to approach the continuous derivative as the step tends to zero under suitable smoothness."
A3 = "Truncation and round-off errors respond differently to step-size reduction."
A4 = "There is generally an optimal practical step size balancing truncation and finite-precision error."
A5 = "Higher nominal order requires sufficient smoothness and appropriate stencil geometry."
A6 = "Differentiation amplifies high-frequency noise."
A7 = "One-sided stencils are useful near boundaries where symmetric sampling is unavailable."
A8 = "Numerical differentiation results require error, convergence, stability and reproducibility validation."
}
REASONING {
R1_CONTEXT = identify(target_derivative,dimension,function_or_data,smoothness,grid_structure,accuracy_goal)
R2_METHOD = select(forward,backward,central,higher_order,interpolation,complex_step_or_regularised_method)
R3_STENCIL = choose(sample_locations,weights,and_derivative_order)
R4_STEP = choose(step_size_from_scale,smoothness,precision_and_noise)
R5_COMPUTE = evaluate_function_or_data_and_apply_discrete_derivative_operator
R6_ERROR = estimate(truncation_error,roundoff_error,cancellation_and_noise_amplification)
R7_EXTRAPOLATE = if_multiple_resolutions_available apply_Richardson_or_other_extrapolation
R8_MULTIDIMENSIONAL = if_needed assemble_gradient_Jacobian_Hessian_or_other_operator
R9_CONVERGENCE = compare_refined_steps_and_estimate_order
R10_VALIDATE = compare(reference_derivative,manufactured_solution,analytic_case_or_independent_method)
}
CONSTRAINTS {
C1 = "Very small finite-difference steps can increase cancellation and round-off error."
C2 = "Very large steps increase truncation error."
C3 = "Noisy data can make naive differentiation unstable or unusable."
C4 = "Boundary points can require one-sided or specially designed stencils."
C5 = "Nonuniform grids require coefficients adapted to local spacing."
C6 = "High-order stencils can become sensitive to function noise and geometric irregularity."
C7 = "Finite-difference Jacobians can require many function evaluations."
C8 = "Complex-step differentiation requires suitable complex-analytic evaluation behaviour."
C9 = "Automatic differentiation computes derivatives by a different semantic mechanism and should not be conflated with finite-difference approximation."
C10 = "Observed refinement rates can be masked by finite-precision stagnation."
}
SEMANTIC_EQUIVALENCE {
"NumericalDifferentiation" <=> "NumericalDerivativeApproximation"
"CentralDifference" <=> "SymmetricDifference"
"DifferenceStencil" <=> "FiniteDifferenceStencil"
"DifferentiationMatrix" <=> "DerivativeMatrix"
"ComplexStepDifferentiation" <=> "ComplexStepDerivativeApproximation"
}
VALIDATION {
V1 = "Target derivative order and variable are explicit."
V2 = "Function or sampled-data source is documented."
V3 = "Stencil and step size are documented."
V4 = "Nominal order of accuracy is documented."
V5 = "Truncation and round-off error are considered separately."
V6 = "Convergence under step refinement is checked where feasible."
V7 = "Noise sensitivity is assessed for sampled data."
V8 = "Boundary and nonuniform-grid treatment is documented."
V9 = "Reference or analytic derivatives are used where feasible."
V10 = "Results are reproducible under documented arithmetic and sampling settings."
}
CONFIDENCE {
BASE_CONFIDENCE = 0.99
NUMERICAL_DIFFERENTIATION_DEFINITION = 0.99
FINITE_DIFFERENCE_REASONING = 0.99
STEP_SIZE_REASONING = 0.99
RICHARDSON_REASONING = 0.99
MULTIDIMENSIONAL_DERIVATIVE_REASONING = 0.98
COMPLEX_STEP_REASONING = 0.98
NOISE_REASONING = 0.98
POLICY = "Reduce confidence when smoothness, stencil, step size, grid geometry, data noise, arithmetic precision or reference derivative are underspecified."
}
AI_CONSUMPTION {
PURPOSES = [
SemanticSearch, OntologyGrounding, NumericalDifferentiationReasoning,
FiniteDifferenceReasoning, ForwardDifferenceReasoning,
BackwardDifferenceReasoning, CentralDifferenceReasoning,
StencilReasoning, StepSizeReasoning, RichardsonExtrapolationReasoning,
GradientApproximationReasoning, JacobianApproximationReasoning,
HessianApproximationReasoning, ComplexStepReasoning,
NoiseAmplificationReasoning, ErrorBalancingReasoning,
ConvergenceReasoning, FloatingPointReasoning,
KnowledgeGraphConstruction, RetrievalAugmentation, RecursiveInference
]
NORMALISE {
"numerical differentiation" -> NumericalDifferentiation
"numerical derivative" -> NumericalDifferentiation
"finite differences" -> FiniteDifference
"central difference" -> CentralDifference
"difference stencil" -> DifferenceStencil
"complex-step derivative" -> ComplexStepDifferentiation
}
}
EXECUTION_RULES {
E1 = "If a derivative is approximated from discrete evaluations or sampled data, activate NumericalDifferentiationOntology."
E2 = "Choose stencil type according to derivative order, smoothness, boundary location and grid geometry."
E3 = "Balance step size between truncation error and finite-precision cancellation."
E4 = "If boundary symmetry is unavailable, use one-sided or specially designed stencils."
E5 = "If multiple step sizes are available, consider Richardson extrapolation."
E6 = "If sampled data are noisy, consider smoothing or regularised differentiation."
E7 = "If the function supports suitable complex evaluation, consider complex-step differentiation for first derivatives."
E8 = "For vector functions, assemble Jacobian or Hessian approximations consistently."
E9 = "Validate numerical derivatives using refinement, reference derivatives and reproducibility."
}
RECURSION {
ENTRY = NumericalDifferentiation
EXPAND(NumericalDifferentiation) -> [
NumericalDerivative,DerivativeApproximation,FiniteDifference,
DifferenceQuotient,ForwardDifference,BackwardDifference,
CentralDifference,SymmetricDifference,OneSidedDifference,
HigherOrderDifference,FirstDerivativeApproximation,
SecondDerivativeApproximation,HigherDerivativeApproximation,
DifferenceStencil,ThreePointStencil,FivePointStencil,
SevenPointStencil,CompactFiniteDifference,FiniteDifferenceCoefficient,
FornbergWeights,DerivativeMatrix,DifferentiationMatrix,
DiscreteDerivativeOperator,GradientApproximation,
PartialDerivativeApproximation,DirectionalDerivativeApproximation,
JacobianApproximation,HessianApproximation,LaplacianApproximation,
DivergenceApproximation,CurlApproximation,UniformGrid,NonuniformGrid,
GridSpacing,StepSize,AdaptiveStepSize,OptimalStepSize,
RichardsonExtrapolation,ExtrapolatedDerivative,TruncationError,
LeadingErrorTerm,RoundOffError,Cancellation,NoiseAmplification,
DataNoise,Smoothing,RegularisedDifferentiation,
PolynomialInterpolationDifferentiation,SplineDifferentiation,
SavitzkyGolayDifferentiation,ComplexStepDifferentiation,
MulticomplexDifferentiation,AutomaticDifferentiation,
SymbolicDifferentiation,FiniteDifferenceJacobian,
FiniteDifferenceHessian,SparseJacobianApproximation,
GraphColoringForJacobian,DirectionalDifference,
FrechetDerivativeApproximation,Consistency,Convergence,
ConvergenceRate,OrderOfAccuracy,Stability,NumericalStability,
Conditioning,FloatingPointArithmetic,MachinePrecision,
Verification,ManufacturedSolution,ReferenceDerivative,
Benchmarking,Reproducibility
]
EXPAND(DifferentiationFamilies) -> [
FirstDerivativeFiniteDifferences,
HigherDerivativeFiniteDifferences,
MultidimensionalDerivativeApproximation,
InterpolationBasedDifferentiation,
ComplexStepDifferentiation,
NoisyDataDifferentiation,
ErrorAndConvergenceAnalysis
]
STOP_CONDITION = "Stop when derivative target, stencil, step size, grid geometry, error, convergence, stability and validation are sufficiently resolved."
}
ROUTING {
PARENT_ONTOLOGY = "Numerical Calculus"
RELATED_ONTOLOGIES = [
"Numerical Calculus",
"Numerical Methods",
"Numerical Analysis Ontology 2",
"Numerical Approximation Ontology",
"Numerical Error Ontology",
"Numerical Stability Ontology 2",
"Numerical Convergence Ontology",
"Floating Point Arithmetic Ontology",
"Interpolation Ontologies",
"Differential Equations Ontologies",
"Automatic Differentiation Ontologies"
]
ROUTE_RULES = [
"Numerical Differentiation -> Numerical Calculus for parent semantics",
"Numerical Differentiation -> Numerical Methods for discrete derivative algorithms",
"Numerical Differentiation -> Numerical Analysis for consistency, convergence and conditioning",
"Numerical Differentiation -> Numerical Approximation for stencil error theory",
"Numerical Differentiation -> Numerical Error for truncation and round-off semantics",
"Numerical Differentiation -> Numerical Stability for noise and cancellation behaviour",
"Numerical Differentiation -> Floating Point Arithmetic for precision limits",
"Numerical Differentiation -> Interpolation for interpolation-derived derivative formulas",
"Numerical Differentiation -> Differential Equations when stencils define differential operators",
"Numerical Differentiation -> Automatic Differentiation for derivative-computation comparison"
]
}
UPDATE_MODEL {
MODE = "append-compatible semantic versioning"
MAJOR = "ontology-breaking conceptual change"
MINOR = "new compatible derivative stencils, extrapolation methods or reasoning pathways"
PATCH = "clarification, metadata or formatting correction"
RULES = [
"Preserve symbolic-versus-numerical differentiation distinction.",
"Preserve finite-difference-versus-automatic-differentiation distinction.",
"Preserve truncation-error-versus-round-off-error distinction.",
"Preserve one-sided-versus-centred stencil distinction.",
"Preserve uniform-versus-nonuniform grid distinction.",
"Preserve function-evaluation-versus-sampled-data distinction.",
"Preserve local-derivative-versus-discrete-operator distinction.",
"Preserve machine-readable numerical-differentiation semantics."
]
}
OUTPUT {
CANONICAL_DEFINITION = "Numerical differentiation approximates derivatives using discrete function evaluations, sampled data or discrete derivative operators."
FINITE_DIFFERENCE_SUMMARY = "Forward, backward, centred and higher-order stencils approximate derivatives through weighted function differences."
STEP_SIZE_SUMMARY = "Practical accuracy requires balancing truncation error against round-off and cancellation."
EXTRAPOLATION_SUMMARY = "Richardson extrapolation combines multiple resolutions to cancel leading error terms."
MULTIDIMENSIONAL_SUMMARY = "Finite differences extend to gradients, Jacobians, Hessians and differential operators."
NOISE_SUMMARY = "Differentiation amplifies high-frequency noise, motivating smoothing and regularisation for sampled data."
VALIDATION_SUMMARY = "Numerical derivative results should be checked through refinement, reference derivatives, error estimates, stability and reproducibility."
}
FLOW {
INPUT
-> detect_numerical_differentiation_context
-> identify_target_derivative_dimension_function_or_data_smoothness_grid_structure_and_accuracy_goal
-> select_forward_backward_central_higher_order_interpolation_complex_step_or_regularised_method
-> choose_stencil_sample_locations_weights_and_derivative_order
-> choose_step_size_from_scale_smoothness_precision_and_noise
-> evaluate_function_or_data_and_apply_discrete_derivative_operator
-> estimate_truncation_roundoff_cancellation_and_noise_error
-> if_multiple_resolutions_apply_Richardson_or_other_extrapolation
-> if_multidimensional_assemble_gradient_Jacobian_Hessian_or_other_operator
-> assess_convergence_order_conditioning_and_finite_precision
-> validate_against_reference_derivative_manufactured_solution_or_independent_method
-> route_to_related_numerical_calculus_methods_analysis_approximation_error_stability_convergence_floating_point_interpolation_differential_equations_or_AD_ontologies
-> recursively_expand_required_dependencies
-> verify_result
-> assign_confidence
-> produce_semantic_output
-> END
}
SEMANTIC_SUMMARY {
"The Numerical Differentiation Ontology 2 defines computational derivative approximation. It supports forward, backward, centred and higher-order finite differences, derivative stencils and finite-difference coefficients, derivative and differentiation matrices, gradients, partial and directional derivatives, Jacobians, Hessians, Laplacians, divergence and curl, uniform and nonuniform grids, step-size selection, Richardson extrapolation, truncation and round-off error, cancellation and noise amplification, interpolation and spline differentiation, Savitzky-Golay differentiation, complex-step and multicomplex methods, finite-difference Jacobians and Hessians, sparse Jacobian approximation, convergence, conditioning, finite precision, verification, benchmarking and reproducibility."
}
FLOW_HASH {
METHOD = "semantic-content-identity"
ID = "KIRETH-MATH-COMPUTATIONAL-MATHEMATICS-NUMERICAL-DIFFERENTIATION-ONTOLOGY-2-V1"
}
}
END_FLOW
Download Code
Copy to Clipboard