Swarm-NG
1.1
|
In this tutorial, we write a test to examine if the stop_on_ejection monitor works as expected.
It involves generating a test case that causes some planets to eject and examining the ensemble after the integration.
Source code for this tutorial can be found at py/ejection_tutorial.py
The first step is to import the swarmng module. We also use make_test_case from the Ensemble generation tutorial to generate our test case.
RMAX is the maximum radius of the planetary system. If the planets is farther than RMAX from the origin, we consider it ejected.
Configuratino for the integration, we use CPU version of the PECĀ² Hermite integrator, it is by default checks for ejections when the planets get too far from the origin.
We have to set the destination_time directly on the integrator object and it cannot be included in the Config object.
We create an ensemble with very close orbits. This ensures that the planets will come close at some point and the result would be an ejection.
Same procedure as in Beginner Python Tutorial. Set-up the integrator parameters and call the method integrate.
After the integration finished, we can look into the ensemble to see if in fact the integrator has worked as expected.