Skip to content

Commit

Permalink
added pericenter test
Browse files Browse the repository at this point in the history
  • Loading branch information
Tiger Lu authored and Tiger Lu committed May 7, 2024
1 parent 07da146 commit efc956f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions rebound/tests/test_trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,27 +442,27 @@ def jacobi(sim):

self.assertLess(dE_trace, 1e-6) # reasonable precision for trace
self.assertLess(time_trace,2.0*time_ias15) # not much slower than ias15
'''

def test_pericenter(self):

sim = pericenter_sim()
sim.integrator = "ias15"
start_ias15=datetime.now()
sim.integrate(3000.)
sim.integrate(10 * 2 * math.pi * 29.4)
time_ias15 = (datetime.now()-start_ias15).total_seconds()

sim = pericenter_sim()
sim.integrator = "trace"
sim.dt = 0.15 * 2 * math.pi
E0 = sim.energy()
start_trace=datetime.now()
sim.integrate(3000.)
sim.integrate(10 * 2 * math.pi * 29.4)
time_trace = (datetime.now()-start_trace).total_seconds()
dE_trace = abs((sim.energy() - E0)/E0)

self.assertLess(dE_trace,1e-3) # reasonable precision for trace
self.assertLess(dE_trace,1e-4) # reasonable precision for trace
self.assertLess(time_trace,time_ias15) # faster than ias15
'''
def test_trace_simulationarchive(self):
sim = chaotic_exchange_sim()
sim.integrator = "trace"
Expand Down

0 comments on commit efc956f

Please sign in to comment.