File tree Expand file tree Collapse file tree 4 files changed +21
-0
lines changed Expand file tree Collapse file tree 4 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ RecipesBase 0.1.0
3
3
DiffEqBase 3.0.0
4
4
RecursiveArrayTools 0.4.0
5
5
DiffEqPDEBase 0.4.0
6
+ NLsolve 0.14.1
6
7
DiffEqMonteCarlo
7
8
DiffEqNoiseProcess
8
9
Juno
Original file line number Diff line number Diff line change
1
+ using NLsolve
1
2
"""
2
3
`Base.length(tab::ODERKTableau)`
3
4
@@ -15,3 +16,16 @@ r(z) = \\frac{\\det(I-zA+zeb^T)}{\\det(I-zA)}
15
16
```
16
17
"""
17
18
stability_region (z,tab:: ODERKTableau ) = det (eye (tab. stages)- z* tab. A + z* ones (tab. stages)* tab. α' )/ det (eye (tab. stages)- z* tab. A)
19
+
20
+ """
21
+ `stability_region(tab::ODERKTableau; initial_guess=-3.0)`
22
+
23
+ Calculates the length of the stability region in the real axis.
24
+ """
25
+ function stability_region (tab:: ODERKTableau ; initial_guess= - 3.0 )
26
+ residual! = function (resid, x)
27
+ resid[1 ] = abs (stability_region (x[1 ], tab)) - 1
28
+ end
29
+ sol = nlsolve (residual!, [initial_guess])
30
+ sol. zero[1 ]
31
+ end
Original file line number Diff line number Diff line change @@ -7,3 +7,4 @@ using Base.Test
7
7
@time @testset " Analyticless Convergence Tests" begin include (" analyticless_convergence_tests.jl" ) end
8
8
@time @testset " ODE Tableau Convergence Tests" begin include (" ode_tableau_convergence_tests.jl" ) end # # Windows 32-bit fails on Butcher62 convergence test
9
9
@time @testset " Analyticless Stochastic WP" begin include (" analyticless_stochastic_wp.jl" ) end
10
+ @time @testset " Stability Region Tests" begin include (" stability_region_test.jl" ) end
Original file line number Diff line number Diff line change
1
+ using DiffEqDevTools, Base. Test
2
+
3
+ @test stability_region (constructDormandPrince6 (), initial_guess= - 3.5 ) ≈ - 3.95413 rtol= 1e-3
4
+ @test stability_region (constructTsitourasPapakostas6 (), initial_guess= - 3.5 ) ≈ - 3.95413 rtol= 1e-3
5
+ @test stability_region (constructRadauIIA5 (), initial_guess= 12. ) ≈ 11.84 rtol= 1e-2
You can’t perform that action at this time.
0 commit comments