Skip to content

Commit

Permalink
Nested works on Tsit5
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Jun 30, 2017
1 parent 79cba75 commit 8fdf44a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/caches.jl
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ function alg_cache(alg::Tsit5,u,rate_prototype,uEltypeNoUnits,tTypeNoUnits,uprev
k6 = zeros(rate_prototype)
k7 = zeros(rate_prototype)
utilde = similar(u,indices(u))
atmp = similar(u,uEltypeNoUnits,indices(u))
atmp = similar(u,eltype(u),indices(u))
tmp = similar(u)
Tsit5Cache(u,uprev,k1,k2,k3,k4,k5,k6,k7,utilde,tmp,atmp,tab)
end
Expand Down
11 changes: 8 additions & 3 deletions test/static_array_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ u0[1] = ones(MVector{2,Float64}) + 1
f = (t,u,du) -> du .= u
ode = ODEProblem(f, u0, (0.,1.))
sol = solve(ode, Euler(), dt=1.e-2)
#sol = solve(ode, Tsit5())
sol = solve(ode, Tsit5())

u0 = zeros(SVector{2,Float64}, 2) + 1
u0 = zeros(SVector{2,Float64},2) + 1
u0[1] = ones(SVector{2,Float64}) + 1
ode = ODEProblem(f, u0, (0.,1.))
sol = solve(ode, Euler(), dt=1.e-2)
#sol = solve(ode, Tsit5())
sol = solve(ode, Tsit5())

sol = solve(ode, SSPRK22(), dt=1.e-2)

Expand All @@ -28,3 +28,8 @@ f = (t,u) -> u
ode = ODEProblem(f, u0, (0.,1.))
sol = solve(ode, Euler(), dt=1.e-2)
sol = solve(ode, Tsit5(), dt=1.e-2)

u0 = zeros(SVector{2,Float64},2) + 1
u0[1] = ones(SVector{2,Float64}) + 1
ode = ODEProblem(f, u0, (0.,1.))
sol = solve(ode, Euler(), dt=1.e-2)

0 comments on commit 8fdf44a

Please sign in to comment.