<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Using the Simulation Archive to restart a simulation
The Simulation Archive (SA) is a binary file that can be used to restart a simulation. This can be useful when running a long simulation. REBOUND can restart simulation exactly (bit by bit) when using a SA. There are some restriction to when a SA can be used. Please read the corresponding paper (Rein & Tamayo 2017) for details. 
We first setup a simulation in the normal way.
Step1:  We then initialize the SA and specify the output filename and output cadence. We can choose the output interval to either correspond to constant intervals in walltime (in seconds) or simulation time. Here, we choose walltime. To choose simulation time instead replace the walltime argument with interval.
Step2:  Now, we can run the simulation forward in time.
Step3:  Depending on how fast your computer is, the above command may take a couple of seconds. Once the simulation is done, we can delete it from memory and load it back in from the SA. You could do this at a later time. Note that this will even work if the SA file was generated on a different computer with a different operating system and even a different version of REBOUND. See Rein & Tamayo (2017) for a full discussion on machine independent code.
Step4:  If we want to integrate the simulation further in time and append snapshots to the same SA, then we need to call the automateSimulationArchive method again (this is fail safe mechanism to avoid accidentally modifying a SA file). Note that we set the deletefile flag to False. Otherwise we would create a new empty SA file. This outputs a warning because the file already exists (which is ok since we want to append that file).
Step5:  Now, let's integrate the simulation further in time.
Step6:  If we repeat the process, one can see that the SA binary file now includes the new snapshots from the restarted simulation.
<ASSISTANT_TASK:>
Python Code:
import rebound
sim = rebound.Simulation()
sim.integrator = "whfast"
sim.dt = 2.*3.1415/365.*6 # 6 days in units where G=1
sim.add(m=1.)
sim.add(m=1e-3,a=1.)
sim.add(m=5e-3,a=2.25)
sim.move_to_com()
Explanation: Using the Simulation Archive to restart a simulation
The Simulation Archive (SA) is a binary file that can be used to restart a simulation. This can be useful when running a long simulation. REBOUND can restart simulation exactly (bit by bit) when using a SA. There are some restriction to when a SA can be used. Please read the corresponding paper (Rein & Tamayo 2017) for details. 
We first setup a simulation in the normal way.
End of explanation
sim.automateSimulationArchive("simulationarchive.bin", walltime=1.,deletefile=True)
Explanation: We then initialize the SA and specify the output filename and output cadence. We can choose the output interval to either correspond to constant intervals in walltime (in seconds) or simulation time. Here, we choose walltime. To choose simulation time instead replace the walltime argument with interval.
End of explanation
sim.integrate(2e5)
Explanation: Now, we can run the simulation forward in time.
End of explanation
sim = None
sim = rebound.Simulation("simulationarchive.bin")
print("Time after loading simulation %.1f" %sim.t)
Explanation: Depending on how fast your computer is, the above command may take a couple of seconds. Once the simulation is done, we can delete it from memory and load it back in from the SA. You could do this at a later time. Note that this will even work if the SA file was generated on a different computer with a different operating system and even a different version of REBOUND. See Rein & Tamayo (2017) for a full discussion on machine independent code.
End of explanation
sim.automateSimulationArchive("simulationarchive.bin", walltime=1.,deletefile=False)
Explanation: If we want to integrate the simulation further in time and append snapshots to the same SA, then we need to call the automateSimulationArchive method again (this is fail safe mechanism to avoid accidentally modifying a SA file). Note that we set the deletefile flag to False. Otherwise we would create a new empty SA file. This outputs a warning because the file already exists (which is ok since we want to append that file).
End of explanation
sim.integrate(sim.t+2e5)
Explanation: Now, let's integrate the simulation further in time.
End of explanation
sim = None
sim = rebound.Simulation("simulationarchive.bin")
print("Time after loading simulation %.1f" %sim.t)
Explanation: If we repeat the process, one can see that the SA binary file now includes the new snapshots from the restarted simulation.
End of explanation
<END_TASK>