@@ -23,67 +23,46 @@ function default_algorithm(prob::DiffEqBase.AbstractODEProblem{uType, tType, inp
23
23
elseif typeof (prob. f) <: DynamicalODEFunction
24
24
if tol_level == :low_tol || tol_level == :med_tol
25
25
alg = Tsit5 ()
26
- elseif tol_level == :high_tol
27
- alg = Vern7 (lazy = ! callbacks)
28
26
else
29
- alg = Vern9 (lazy = ! callbacks)
27
+ alg = Vern7 (lazy = ! callbacks)
30
28
end
31
29
else # Standard ODE
32
- if :nonstiff ∈ alg_hints || length (prob . u0) > 10000
30
+ if :nonstiff ∈ alg_hints
33
31
# Don't default to implicit here because of memory requirements
34
32
# And because the linear system gets unruly
35
33
if (! (uEltype <: Float64 ) && ! (uEltype <: Float32 ) && ! (uEltype <: Complex )) ||
36
- tol_level == :extreme_tol
34
+ tol_level == :extreme_tol || tol_level == :low_tol
37
35
# Most likely higher precision, so use a higher order method
38
- alg = Vern9 (lazy = ! callbacks)
39
- elseif tol_level == :low_tol
40
36
alg = Vern7 (lazy = ! callbacks)
41
- elseif tol_level == :med_tol
37
+ else
42
38
alg = Tsit5 ()
43
- else # tol_level == :high_tol
44
- alg = BS3 ()
45
39
end
46
40
elseif :stiff ∈ alg_hints || mm # The problem is stiff
47
41
if length (prob. u0) > 500
48
42
# Use Krylov method when huge!
49
- if ! mm
50
- alg = CVODE_BDF (linear_solver = :GMRES )
51
- elseif mm
52
- alg = Rodas4 (autodiff = false , linsolve = LinearSolve. KrylovJL_GMRES ())
53
- end
54
- elseif length (prob. u0) > 50
55
- if callbacks && ! mm
56
- alg = CVODE_BDF ()
57
- elseif ! callbacks
58
- alg = QNDF (autodiff = false )
59
- else
60
- alg = Rodas4 (autodiff = false )
61
- end
43
+ alg = FBDF (autodiff = false , linsolve = LinearSolve. KrylovJL_GMRES ())
44
+ elseif length (prob. u0) > 500
45
+ alg = FBDF (autodiff = false )
62
46
elseif tol_level == :high_tol
63
47
alg = Rosenbrock23 (autodiff = false )
64
48
else
65
- alg = Rodas4 (autodiff = false )
49
+ alg = Rodas5P (autodiff = false )
66
50
end
67
51
else # :auto ∈ alg_hints
68
- if (! (uEltype <: Float64 ) && ! (uEltype <: Float32 )) || tol_level == :extreme_tol
52
+ if (! (uEltype <: Float64 ) && ! (uEltype <: Float32 )) || tol_level == :extreme_tol ||
53
+ tol_level == :low_tol
69
54
# Most likely higher precision, so use a higher order method
70
- if length (prob. u0) > 100
71
- alg = AutoVern9 (KenCarp47 (autodiff = false ), lazy = ! callbacks)
72
- else
73
- alg = AutoVern9 (Rodas5P (autodiff = false ), lazy = ! callbacks)
74
- end
75
- elseif tol_level == :low_tol
76
55
if length (prob. u0) > 500
77
- alg = AutoVern7 (Rodas4 (autodiff = false ,
78
- linsolve = LinearSolve. KrylovJL_GMRES ()),
79
- lazy = ! callbacks)
56
+ alg = AutoVern7 (KenCarp47 (autodiff = false , linsolve = LinearSolve. KrylovJL_GMRES ()), lazy = ! callbacks)
80
57
elseif length (prob. u0) > 50
81
- alg = AutoVern7 (TRBDF2 (autodiff = false ), lazy = ! callbacks)
58
+ alg = AutoVern7 (KenCarp47 (autodiff = false ), lazy = ! callbacks)
82
59
else
83
- alg = AutoVern7 (Rodas4 (autodiff = false ), lazy = ! callbacks)
60
+ alg = AutoVern7 (Rodas5P (autodiff = false ), lazy = ! callbacks)
84
61
end
85
62
else # :med or low
86
- if length (prob. u0) > 100
63
+ if length (prob. u0) > 500
64
+ alg = AutoTsit5 (TRBDF2 (autodiff = false , linsolve = LinearSolve. KrylovJL_GMRES ()))
65
+ elseif length (prob. u0) > 50
87
66
alg = AutoTsit5 (TRBDF2 (autodiff = false ))
88
67
else
89
68
alg = AutoTsit5 (Rosenbrock23 (autodiff = false ))
0 commit comments