Skip to content

Commit

Permalink
Add test for VelocityVerlet
Browse files Browse the repository at this point in the history
  • Loading branch information
YingboMa committed Jun 27, 2017
1 parent b7b606b commit 59675b7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/partitioned_methods_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,20 @@ end
prob = PartitionedODEProblem((f1,f2),(u0,v0),(0.0,5.0))

sol = solve(prob,SymplecticEuler(),dt=1/100)
sol_verlet = solve(prob,VelocityVerlet(),dt=1/100)

interp_time = 0:0.001:5
interp = sol(0.5)
interps = sol(interp_time)

prob = SecondOrderODEProblem(f2,u0,v0,(0.0,5.0))
sol2 = solve(prob,SymplecticEuler(),dt=1/100)
sol2_verlet = solve(prob,VelocityVerlet(),dt=1/100)

@test sol[end][1] == sol2[end][1]
@test sol_verlet[end][1] == sol2_verlet[end][1]
@test sol[end][5] == sol2[end][5]
@test sol_verlet[end][5] == sol2_verlet[end][5]

f = function (t,u,du)
du.x[1] .= u.x[2]
Expand Down

0 comments on commit 59675b7

Please sign in to comment.