Chaos

←Previous

Homework assignment

The following homework assignment will be due on Monday, 30.10..

This homework is about doing some physics with the methods we have developed and coded so far. It consists of two parts:

  1. Movement of a particle in a central potential
    To work on this part, use the skeleton code CentralForce.py, in conjunction with the DEq_Solver.py and Read_Type.py.
    1. You are asked to implement the numerical simulation of a particle of mass $m$ moving under the influence of a central force
      \[ \underline F(r) = -\kappa\frac{\underline e_r}{r^\eta}\,,\]
      where $\underline e_r$ is the unit vector pointing into the direction of $\underline r$, with $\underline r$ being the vector between the centre of the force and the particle. In order to make this accessible to a numerical treatment you should implement the function dx_dt in the class CentralForce, with the array filled as [$x$, $y$, $v_x$, $v_y$].
      The relevant parameters are given by self.kappa_by_m = $\kappa/m$ and by self.exponent = $\eta$.
    2. In a second step, you are asked to check Kepler's second law, stating that the line joining the centre of the force and the particle (the sun and the planet) sweeps out equal areas in equal times. To this end, implement a formula calculating the area between two time steps, yielding $\underline x_1$ and $\underline x_2$, in the function 'area'.
  2. Three-body problem
    To work on this part, use the skeleton code provided in Planet.py, in conjunction with the DEq_Solver.py and Read_Type.py.
    1. Derive the gravitational forces in the three-body system, which we take to consist of sun, earth and jupiter.
    2. Derive the corresponding function dx_dt in the class Planet, using the array as [$x^{(S)}$, $y^{(S)}$, $v_x^{(S)}$, $v_y^{(S)}$, $x^{(E)}$, $y^{(E)}$, $v_x^{(E)}$, $v_y^{(E)}$, $x^{(J)}$, $y^{(J)}$, $v_x^{(J)}$, $v_y^{(J)}$] in obvious notation. Here you can use the Newton constant $G$, provided as parameter self.G, in addition to the masses, all fixed in the __init__-routine of the class Planet.
      For your checks: Please note that we fixed $G$ to work in a system of kg, m, and s for mass, distance and time.
    Note: Inputs for this are provided in the main-function at the end of the Planets.py file. Notice that in the inputs we allow for default parameters, close to astrophysical numbers, accessible by just hitting the "return" button rather than inputting numbers.
    Note: As inputs you fix the distances of earth and jupiter to the sun, oriented solely along the x-axis. You are allowed to give velocities in both x- and y-direction for both. To allow for nicer plotting the velocity of the sun is fixed in the code such that the total momentum for the system is 0, implying that the centre-of-mass remains somewhere along the x-axis between the sun and the planets.


Frank Krauss and Daniel Maitre
Last modified: Tue Oct 3 14:43:58 BST 2017