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 32
32
Calculates the stability function from the algorithm `alg` at `z`.
33
33
The stability region of a possible embedded method cannot be calculated
34
34
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
+ ```
35
52
"""
36
53
function stability_region (z, alg:: AbstractODEAlgorithm )
37
54
u0 = one (z)
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ using OrdinaryDiffEq
8
8
@test @inferred (stability_region (constructTsitouras5 ()))≈ @inferred (stability_region (Tsit5 ()))
9
9
@test @inferred (stability_region (constructSSPRK104 ()))≈ @inferred (stability_region (SSPRK104 ()))
10
10
@test @inferred (stability_region (constructImplicitEuler ()))≈ @inferred (stability_region (ImplicitEuler ()))
11
+ @test @inferred (abs (stability_region (nextfloat (typemin (Float64)), ImplicitEuler ()))) < eps (Float64)
11
12
12
13
@test @inferred (imaginary_stability_interval (constructSSPRK33 ()))≈ sqrt (3 )
13
14
@test @inferred (imaginary_stability_interval (constructSSPRK33 (Float32)))≈ sqrt (3.0f0 )
You can’t perform that action at this time.
0 commit comments