Skip to content

Objective 2: Orbits

SimTe8 edited this page Apr 28, 2024 · 4 revisions

Objective 2: Orbits

There are three main files associated with objective 2:

  1. orbits_earth.py This is the main file, all functions necessary to calculate the orbits including Earth set in our solar system are defined here
  2. orbits_endor.py This is a very similar file which changes the focus from Earth to Endor which orbits around a big planet (technically also called Endor, but we call it BigBrother=BB) instead of the sun; slight variations
  3. orbits_earth.ipynb This notebook contains the functions from orbits_earth.py and uses them to produce plots. This extra notebook is helpful because a single cell can produce single plots (easier to navigate compared to a standard Python file) and especially because animations made with Moviepy can be directly displayed

Main functions:

  • F_gravity() and F_total() simulate the forces due to Newton's Law of Gravity
  • integrate_orbits() uses Velocity Verlet to integrate the equations of motion
    • when wished the influence of the sun can be switched off in order to just look at the orbits of the Moon and the Death Star around Earth; this allows this part of the code to be used for objective 3 as well
  • omega() and orbit_time() analyze the orbits by looking at the angular velocity and the period of an orbit
  • crash_detect() checks if a celestial object has crashed into another one and is used to stop the simulation in that case, otherwise, F_g can explode it was useful during development and when somebody wanted to experiment with parameters
  • stretch_distance() is supposed to stretch the distance between Earth and its satellites (Moon and DS) in order to make an appealing plot despite the solar- system's scale
Clone this wiki locally