Skip to content

Commit

Permalink
remove plotting from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Nov 23, 2016
1 parent 007b6f0 commit e176384
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 20 deletions.
2 changes: 1 addition & 1 deletion test/adaptive/sde_autostepsize_test.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using StochasticDiffEq, Plots
using StochasticDiffEq#, Plots
srand(100)
prob = prob_sde_2Dlinear

Expand Down
15 changes: 9 additions & 6 deletions test/adaptive/sde_lorenzattractor_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,40 @@ using StochasticDiffEq, DiffEqProblemLibrary
srand(100)
prob = prob_sde_lorenz

using Plots; gr()
## Solve and plot
println("Solve and Plot")
println("Plot 1")
sol1 =solve(prob,SRI();dt=1/2^(4),abstol=10,reltol=0)
#=
p1 = plot(sol1[:,1],sol1[:,2],sol1[:,3],title="Absolute Tolerance = 10",leg=false,
top_margin=50px,right_margin=50px,xguide="X",yguide="Y",zguide="Z",bottom_margin=50px,
guidefont=font(16),titlefont=font(18),tickfont=font(16))
=#

println("Plot 2")
sol2 =solve(prob,SRI();dt=1/2^(4),abstol=1,reltol=0)
#=
p2 = plot(sol2[:,1],sol2[:,2],sol2[:,3],title="Absolute Tolerance = 10",leg=false,
top_margin=50px,right_margin=50px,xguide="X",yguide="Y",zguide="Z",bottom_margin=50px,
guidefont=font(16),titlefont=font(18),tickfont=font(16))

=#

println("Plot 3")
sol3 =solve(prob,SRI();dt=1/2^(4),abstol=1/10,reltol=0)
#=
p3 = plot(sol3[:,1],sol3[:,2],sol3[:,3],title="Absolute Tolerance = 10",leg=false,
top_margin=50px,right_margin=50px,xguide="X",yguide="Y",zguide="Z",bottom_margin=50px,
guidefont=font(16),titlefont=font(18),tickfont=font(16))

=#

println("Plot 4")
sol4 =solve(prob,SRI();dt=1/2^(4),abstol=1/100,reltol=0)
#=
p4 = plot(sol4[:,1],sol4[:,2],sol4[:,3],title="Absolute Tolerance = 10",leg=false,
top_margin=50px,right_margin=50px,xguide="X",yguide="Y",zguide="Z",bottom_margin=50px,
guidefont=font(16),titlefont=font(18),tickfont=font(16))
=#


plot(p1,p2,p3,p4,size=(1200,800),plot_title="Lorenz Attractors")
#plot(p1,p2,p3,p4,size=(1200,800),plot_title="Lorenz Attractors")
#gui()

true
15 changes: 2 additions & 13 deletions test/adaptive/sde_twodimlinearadaptive_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,25 @@ using StochasticDiffEq
srand(100)
prob = prob_sde_2Dlinear

using Plots; gr()
## Solve and plot
println("Solve and Plot")
sol =solve(prob,SRI(),dt=1/2^(4),abstol=1,reltol=0)
err1 = sol.errors[:final]
p1 = plot(sol,plot_analytic=true,legend=false,title="tol = 1")

println("1e-1")
sol2 =solve(prob,SRI(),dt=1/2^(4),abstol=1e-1,reltol=0)
err2 = sol2.errors[:final]
p2 = plot(sol2,plot_analytic=true,legend=false,title="tol = 1e-1")

println("1e-2")
sol3 =solve(prob,SRI(),dt=1/2^(4),abstol=1e-2,reltol=0)
err3 = sol3.errors[:final]
p3 = plot(sol3,plot_analytic=true,legend=false,title="tol = 1e-2")

@test err3 < err1
println("1e-3")
sol4 =solve(prob,SRI(),dt=1/2^(4),abstol=1e-3,reltol=0)
err4 = sol4.errors[:final]
p4 = plot(sol4,plot_analytic=true,legend=false,title="tol = 1e-3")

plot(p1,p2,p3,p4,title="Solutions to Linear SDE at Different Tolerances",size=(1200,800))
#gui()

@test err4 < err2
println("""
Final error for the solutions were:
$err1
$err2
$err3
$err4""")

err4 < err2 && err3 < err1

0 comments on commit e176384

Please sign in to comment.