Path: blob/master/activities/leapfrog_integration.ipynb
934 views
Task 9
This homework is an activity intended to apply the Euler's scheme for integrating differential equations. Besides, it is introduced a new scheme that conserves the energy of the system, i.e., the Leap-frog scheme.
Due to: Mar 8
Central Force Problem
The classic two-body problem with central force can be considerable simplified if one of the bodies has a mass much greater than the other one. In this case, the position of the most massive body (with mass ) will coincide with the center of mass of the system, and thus it is only interesting to find the position of the less massive body (with mass ) regarding the center of mass. The equation of motion for the body is then:
where is the position of and is a unitary vector pointing toward the origin of the central force. A very special case of this type of problems is the gravitation of a small body around a massive one, e.g. the earth-sun system, the moon-earth system, etc. For this case, is replaced by the gravitational force, yielding:
For a central force problem is always possible to demonstrate that the complete movement will be constrained over a plane, so a suitable choice of coordinates will reduce the position to and the previous equation yields:
where and are unitary vectors of the cartesian system. Note this set of equations does not depend on the mass of the small body.
From the previous figure, and defining the velocities in and we obtain:
to get finally
Leap-frog Integration
The leap-frog scheme is an integration method inteded to solve differential equations associated to physical problems with implicit conservations laws (e.g. mechanical problems where the total energy is conserved). For this, suppose a problem of the form:
The leap-frog scheme gives the approximate solution through the next set of iterative expressions:
where denotes the position in the time , and is the initial time. The solution given by this procedure is less sensible to numerical losses of energy, unlike ordinary methods like Euler.
1. Solve the central force problem using the Euler's method given during class. Use the initial conditions compatible with the system Earth-Sun, i.e.
Integrate during five years using a timestep of 1 day (). If you want, you can use a more convenient coordinate system in for time, for distance and for mass. (Remember you must change also the units of ). Plot the orbit vs .
2. Repeat the same problem but using the leap-frog scheme. Plot the resulting orbit.
3. Calculate the total energy of the system:
for both integrators and compare them plotting vs .
Questions:
What can you conclude about the total energy of the systems when using the integrator schemes.
what scheme deals better this problem?