File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change 3232Calculates the stability function from the algorithm `alg` at `z`.
3333The stability region of a possible embedded method cannot be calculated
3434using 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"""
3653function stability_region (z, alg:: AbstractODEAlgorithm )
3754 u0 = one (z)
Original file line number Diff line number Diff 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 )
You can’t perform that action at this time.
0 commit comments