-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
revised unit tests for pretty printing, properly trigger show
- Loading branch information
1 parent
a4afb98
commit 56cd277
Showing
1 changed file
with
39 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,50 @@ | ||
# show solver and report | ||
|
||
using DormandPrince | ||
using Test | ||
|
||
function stiff_fcn(x, y, f) | ||
f[1] = y[1]^2 - y[1]^3 | ||
end | ||
|
||
solver = DP5Solver( | ||
stiff_fcn, | ||
0.0, | ||
[0.0001] | ||
; | ||
maximum_allowed_steps=100 | ||
) | ||
@testset "Successful Options Check with Successful Integration" begin | ||
solver = DP5Solver( | ||
stiff_fcn, | ||
0.0, | ||
[0.0001] | ||
) | ||
|
||
show(solver) | ||
show(stdout, MIME"text/plain"(), solver) | ||
|
||
report = DormandPrince.integrate_core!(solver, 2/0.0001) | ||
report = DormandPrince.integrate_core!(solver, 2/0.0001) | ||
|
||
show(report) | ||
show(stdout, MIME"text/plain"(), report) | ||
|
||
end | ||
|
||
@testset "Successful Options Check with Failed Integration" begin | ||
solver = DP5Solver( | ||
stiff_fcn, | ||
0.0, | ||
[0.0001]; | ||
maximum_allowed_steps=10 # | ||
) | ||
|
||
report = DormandPrince.integrate_core!(solver, 2/0.0001) | ||
|
||
show(stdout, MIME"text/plain"(), report) | ||
end | ||
|
||
@testset "Failed Options Check" begin | ||
solver = DP5Solver( | ||
stiff_fcn, | ||
0.0, | ||
[0.0001]; | ||
uround = 100 | ||
) | ||
|
||
report = DormandPrince.integrate_core!(solver, 2/0.0001) | ||
|
||
show(stdout, MIME"text/plain"(), report) | ||
|
||
end |