scenarioOrbitMultiBody

Overview

This script sets up a 3-DOF spacecraft which is traveling in a multi-gravity environment. The purpose is to illustrate how to attach a multiple gravity model, and compare the output to SPICE generated trajectories.

The script is found in the folder basilisk/examples and executed by using:

python3 scenarioOrbitMultiBody.py

When the simulation completes 2-3 plots are shown for each case. One plot always shows the inertial position vector components, while the third plot shows the inertial differences between the Basilisk simulation trajectory and the SPICE spacecraft trajectory. Read scenarioBasicOrbit to learn how to setup an orbit simulation.

The simulation layout is shown in the following illustration. The SPICE interface object keeps track of the selection celestial objects, and ensures the gravity body object has the correct locations at each time step.

../_images/test_scenarioOrbitMultiBody.svg

Illustration of Simulation Results

The following images illustrate the expected simulation run returns for a range of script configurations.

show_plots = True, scCase = 0

This scenario simulates the Hubble Space Telescope (HST) spacecraft about the Earth in a LEO orbit. The resulting position coordinates and orbit illustration are shown below. A 2000 second simulation is performed, and the Basilisk and SPICE generated orbits match up very well.

../_images/scenarioOrbitMultiBody1Hubble.svg ../_images/scenarioOrbitMultiBody2Hubble.svg ../_images/scenarioOrbitMultiBody3Hubble.svg
show_plots = True, scCase = 1

This case illustrates a simulation of the New Horizons spacecraft. Here the craft is already a very large distance from the sun. The resulting position coordinates and trajectories differences are shown below.

../_images/scenarioOrbitMultiBody1NewHorizons.svg ../_images/scenarioOrbitMultiBody3NewHorizons.svg
scenarioOrbitMultiBody.run(show_plots, scCase)[source]

The scenarios can be run with the followings setups parameters:

Parameters:
  • show_plots (bool) – Determines if the script should display plots

  • scCase (int) –

    Int

    Definition

    0

    Hubble trajectory

    1

    New Horizon trajectory