Skip to content
This repository was archived by the owner on May 12, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/DiffEqDevTools.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ export test_convergence, analyticless_test_convergence, appxtrue!, appxtrue
export get_sample_errors

#Tab Functions
export stability_region, residual_order_condition, check_tableau, imaginary_stability_interval
export stability_region, residual_order_condition, check_tableau,
imaginary_stability_interval

#Tableaus
export deduce_Butcher_tableau
Expand Down
2 changes: 2 additions & 0 deletions src/benchmark.jl
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ function Shootout(
effs[i] = 1 / (errors[i] * times[i])
end
for j in 1:N, i in 1:N

effratios[i, j] = effs[i] / effs[j]
end
bestidx = findall((y) -> y == maximum(effs), effs)[1]
Expand Down Expand Up @@ -521,6 +522,7 @@ end
dense_errors = false)

for j in 1:M, k in 1:N

_abstols = get(setups[k], :abstols, abstols)
_reltols = get(setups[k], :reltols, reltols)
_dts = get(setups[k], :dts, zeros(length(_abstols)))
Expand Down
5 changes: 3 additions & 2 deletions src/plotrecipes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,9 @@ end
y = ylims[1]:dy:ylims[2]

if order_star
f = (u, v) -> abs(stability_region(u + v * im, tab; embedded = embedded) /
exp(u + v * im)) < 1
f = (u,
v) -> abs(stability_region(u + v * im, tab; embedded = embedded) /
exp(u + v * im)) < 1
else
f = (u, v) -> abs(stability_region(u + v * im, tab; embedded = embedded)) < 1
end
Expand Down
10 changes: 5 additions & 5 deletions src/tableau_info.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Calculates the length of the stability region in the real axis.
See also [`imaginary_stability_interval`](@ref).
"""
function stability_region(tab_or_alg::Union{ODERKTableau, AbstractODEAlgorithm};
initial_guess = -3.0, kw...)
initial_guess = -3.0, kw...)
residual! = function (resid, x)
resid[1] = abs(stability_region(x[1], tab_or_alg)) - 1
end
Expand All @@ -84,8 +84,8 @@ the size of the stability region on the imaginary axis.
See also [`stability_region`](@ref).
"""
function imaginary_stability_interval(tab::ODERKTableau;
initial_guess = length(tab) - one(eltype(tab.A)),
kw...)
initial_guess = length(tab) - one(eltype(tab.A)),
kw...)
residual! = function (resid, x)
resid[1] = abs(stability_region(im * x[1], tab)) - 1
end
Expand All @@ -102,8 +102,8 @@ the size of the stability region on the imaginary axis.
See also [`stability_region`](@ref).
"""
function imaginary_stability_interval(alg::AbstractODEAlgorithm;
initial_guess = 20.0,
kw...)
initial_guess = 20.0,
kw...)
residual! = function (resid, x)
resid[1] = abs(stability_region(im * x[1], alg)) - 1
end
Expand Down
3 changes: 2 additions & 1 deletion test/stability_region_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ using OrdinaryDiffEq
@test @inferred(stability_region(constructTsitouras5()))≈@inferred(stability_region(Tsit5()))
@test @inferred(stability_region(constructSSPRK104()))≈@inferred(stability_region(SSPRK104()))
@test @inferred(stability_region(constructImplicitEuler()))≈@inferred(stability_region(ImplicitEuler()))
@test @inferred(abs(stability_region(nextfloat(typemin(Float64)), ImplicitEuler()))) < eps(Float64)
@test @inferred(abs(stability_region(nextfloat(typemin(Float64)), ImplicitEuler()))) <
eps(Float64)

@test @inferred(imaginary_stability_interval(constructSSPRK33()))≈sqrt(3)
@test @inferred(imaginary_stability_interval(constructSSPRK33(Float32)))≈sqrt(3.0f0)
Expand Down
Loading