Error Control Adaptivity
Adaptivity helps ensure the quality of the our numerical solution, and when our solution exhibits significant estimating errors, adaptivity automatically refine the mesh based on the error distribution, and providing a final satisfying solution.
When comes to solving ill-conditioned BVP, for example the singular pertubation problem where the small parameters become extremally small leading to the layers phonemona, the error control adaptivity becomes even more critical, because the minor pertubations can lead to large deviation in the solution. In such cases, adaptivity autimatically figure out where to use refined mesh and where to use coarse mesh to achieve the balance of computational efficiency and accuracy.
BoundaryValuDiffEq.jl support error control adaptivity for collocation methods, and the adaptivity is default as defect control adaptivity when using adaptive collocation solvers:
sol = solve(prob, MIRK4(), dt = 0.01, adaptive = true)
Actually, BoundaryValueDiffEq.jl supports both defect and global error control adaptivity(while the defect control is the default controller) Boisvert et al. [4], to specify different error control metods, we simply need to specify the controller
keyword in solve
:
sol = solve(prob, MIRK4(), dt = 0.01, controller = GlobalErrorControl()) # Use global error control
sol = solve(prob, MIRK4(), dt = 0.01, controller = SequentialErrorControl()) # Use Sequential error control
sol = solve(prob, MIRK4(), dt = 0.01, controller = HybridErrorControl()) # Use Hybrid error control
Error control methods
BoundaryValueDiffEqCore.DefectControl
— TypeDefectControl(; defect_threshold = 0.1)
Defect estimation method with defect defined as
\[defect = \max\frac{S'(x) - f(x,S(x))}{1 + |f(x,S(x))|}\]
Defect controller, with the maximum defect_threshold
as 0.1, when the estimating defect is greater than the defect_threshold
, the mesh will be refined.
BoundaryValueDiffEqCore.GlobalErrorControl
— TypeGlobalErrorControl(; method = HOErorControl())
Global error controller, use high order global error estimation method HOErrorControl
as default.
BoundaryValueDiffEqCore.SequentialErrorControl
— TypeSequentialErrorControl(; defect = DefectControl(), global_error = GlobalErrorControl())
First use the defect controller, if the defect is satisfying, then use global error controller.
BoundaryValueDiffEqCore.HybridErrorControl
— TypeHybridErrorControl(; DE = 1.0, GE = 1.0, defect = DefectControl(), global_error = GlobalErrorControl())
Control both of the defect and global error, where the error norm is the linear combination of the defect and global error.
BoundaryValueDiffEqCore.NoErrorControl
— TypeNoErrorControl()
No error control method.
While we can achieve global error control in different ways, we can use different methods to estimate the global error:
BoundaryValueDiffEqCore.HOErrorControl
— TypeHOErrorControl()
Higher order global error estimation method
Uses a solution from order+2 method on the original mesh and calculate the error with
\[error = \max\frac{u_p - u_{p+2}}{1 + |u_p|}\]
BoundaryValueDiffEqCore.REErrorControl
— TypeREErrorControl()
Richardson extrapolation global error estimation method
Use Richardson extrapolation to calculate the error on the doubled mesh with
\[error = \frac{2^p}{2^p-1} * \max\frac{u_h - u_{h/2}}{1 + |u_h|}\]