Skip to content

Commit 6f6cb42

Browse files
committed
test for L stability
1 parent 4dcf986 commit 6f6cb42

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

src/tableau_info.jl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,23 @@ end
3232
Calculates the stability function from the algorithm `alg` at `z`.
3333
The stability region of a possible embedded method cannot be calculated
3434
using this method.
35+
36+
If you use an implicit method, you may run into convergence issues when
37+
the value of `z` is outside of the stability region, e.g.,
38+
39+
```julia-repl
40+
julia> typemin(Float64)
41+
-Inf
42+
43+
julia> stability_region(typemin(Float64), ImplicitEuler())
44+
┌ Warning: Newton steps could not converge and algorithm is not adaptive. Use a lower dt.
45+
46+
julia> nextfloat(typemin(Float64))
47+
-1.7976931348623157e308
48+
49+
julia> stability_region(nextfloat(typemin(Float64)), ImplicitEuler())
50+
0.0
51+
```
3552
"""
3653
function stability_region(z, alg::AbstractODEAlgorithm)
3754
u0 = one(z)

test/stability_region_test.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ using OrdinaryDiffEq
88
@test @inferred(stability_region(constructTsitouras5()))@inferred(stability_region(Tsit5()))
99
@test @inferred(stability_region(constructSSPRK104()))@inferred(stability_region(SSPRK104()))
1010
@test @inferred(stability_region(constructImplicitEuler()))@inferred(stability_region(ImplicitEuler()))
11+
@test @inferred(abs(stability_region(nextfloat(typemin(Float64)), ImplicitEuler()))) < eps(Float64)
1112

1213
@test @inferred(imaginary_stability_interval(constructSSPRK33()))sqrt(3)
1314
@test @inferred(imaginary_stability_interval(constructSSPRK33(Float32)))sqrt(3.0f0)

0 commit comments

Comments
 (0)