Skip to content

Commit

Permalink
Merge pull request #36 from alopezrivera/delfi-c3-properties-correction
Browse files Browse the repository at this point in the history
Mass, reference area and initial state of Delfi-C3 corrected in all examples
  • Loading branch information
DominicDirkx committed Nov 3, 2023
2 parents 7ff85a9 + 33acba3 commit 88a602a
Show file tree
Hide file tree
Showing 14 changed files with 109 additions and 137 deletions.
27 changes: 12 additions & 15 deletions estimation/covariance_estimated_parameters.ipynb
Expand Up @@ -46,6 +46,7 @@
"from tudatpy import constants\n",
"from tudatpy.interface import spice\n",
"from tudatpy import numerical_simulation\n",
"from tudatpy.numerical_simulation import environment\n",
"from tudatpy.numerical_simulation import environment_setup\n",
"from tudatpy.numerical_simulation import propagation_setup\n",
"from tudatpy.numerical_simulation import estimation, estimation_setup\n",
Expand Down Expand Up @@ -136,10 +137,10 @@
"source": [
"# Create vehicle objects.\n",
"bodies.create_empty_body(\"Delfi-C3\")\n",
"bodies.get(\"Delfi-C3\").mass = 400.0\n",
"bodies.get(\"Delfi-C3\").mass = 2.2\n",
"\n",
"# Create aerodynamic coefficient interface settings\n",
"reference_area = 4.0\n",
"reference_area = (4*0.3*0.1+2*0.1*0.1)/4 # Average projection area of a 3U CubeSat\n",
"drag_coefficient = 1.2\n",
"aero_coefficient_settings = environment_setup.aerodynamic_coefficients.constant(\n",
" reference_area, [drag_coefficient, 0.0, 0.0]\n",
Expand All @@ -148,7 +149,7 @@
"environment_setup.add_aerodynamic_coefficient_interface(bodies, \"Delfi-C3\", aero_coefficient_settings)\n",
"\n",
"# Create radiation pressure settings\n",
"reference_area_radiation = 4.0\n",
"reference_area_radiation = (4*0.3*0.1+2*0.1*0.1)/4 # Average projection area of a 3U CubeSat\n",
"radiation_pressure_coefficient = 1.2\n",
"occulting_bodies = [\"Earth\"]\n",
"radiation_pressure_settings = environment_setup.radiation_pressure.cannonball(\n",
Expand Down Expand Up @@ -242,7 +243,7 @@
"### Define the initial state\n",
"Realise that the initial state of the spacecraft always has to be provided as a cartesian state - i.e. in the form of a list with the first three elements representing the initial position, and the three remaining elements representing the initial velocity.\n",
"\n",
"Within this example, we will make use of the `keplerian_to_cartesian_elementwise()` function - included in the `element_conversion` module - enabling us to convert an initial state from Keplerian elements to a 6x1 cartesian vector."
"Within this example, we will retrieve the initial state of Delfi-C3 using its Two-Line-Elements (TLE) the date of its launch (April the 28th, 2008). The TLE strings are obtained from [space-track.org](https://www.space-track.org)."
]
},
{
Expand All @@ -252,17 +253,13 @@
"metadata": {},
"outputs": [],
"source": [
"# Set the initial state of the vehicle\n",
"earth_gravitational_parameter = bodies.get(\"Earth\").gravitational_parameter\n",
"initial_state = element_conversion.keplerian_to_cartesian_elementwise(\n",
" gravitational_parameter=earth_gravitational_parameter,\n",
" semi_major_axis=7500.0E3,\n",
" eccentricity=0.1,\n",
" inclination=np.deg2rad(85.3),\n",
" argument_of_periapsis=np.deg2rad(235.7),\n",
" longitude_of_ascending_node=np.deg2rad(23.4),\n",
" true_anomaly=np.deg2rad(139.87)\n",
")"
"# Retrieve the initial state of Delfi-C3 using Two-Line-Elements (TLEs)\n",
"delfi_tle = environment.Tle(\n",
" \"1 32789U 07021G 08119.60740078 -.00000054 00000-0 00000+0 0 9999\",\n",
" \"2 32789 098.0082 179.6267 0015321 307.2977 051.0656 14.81417433 68\"\n",
")\n",
"delfi_ephemeris = environment.TleEphemeris( \"Earth\", \"J2000\", delfi_tle, False )\n",
"initial_state = delfi_ephemeris.cartesian_state( simulation_start_epoch )"
]
},
{
Expand Down
23 changes: 10 additions & 13 deletions estimation/covariance_estimated_parameters.py
Expand Up @@ -32,6 +32,7 @@
from tudatpy import constants
from tudatpy.interface import spice
from tudatpy import numerical_simulation
from tudatpy.numerical_simulation import environment
from tudatpy.numerical_simulation import environment_setup
from tudatpy.numerical_simulation import propagation_setup
from tudatpy.numerical_simulation import estimation, estimation_setup
Expand Down Expand Up @@ -92,10 +93,10 @@

# Create vehicle objects.
bodies.create_empty_body("Delfi-C3")
bodies.get("Delfi-C3").mass = 400.0
bodies.get("Delfi-C3").mass = 2.2

# Create aerodynamic coefficient interface settings
reference_area = 4.0
reference_area = (4*0.3*0.1+2*0.1*0.1)/4 # Average projection area of a 3U CubeSat
drag_coefficient = 1.2
aero_coefficient_settings = environment_setup.aerodynamic_coefficients.constant(
reference_area, [drag_coefficient, 0.0, 0.0]
Expand Down Expand Up @@ -172,20 +173,16 @@
"""
Realise that the initial state of the spacecraft always has to be provided as a cartesian state - i.e. in the form of a list with the first three elements representing the initial position, and the three remaining elements representing the initial velocity.
Within this example, we will make use of the `keplerian_to_cartesian_elementwise()` function - included in the `element_conversion` module - enabling us to convert an initial state from Keplerian elements to a 6x1 cartesian vector.
Within this example, we will retrieve the initial state of Delfi-C3 using its Two-Line-Elements (TLE) the date of its launch (April the 28th, 2008). The TLE strings are obtained from [space-track.org](https://www.space-track.org).
"""

# Set the initial state of the vehicle
earth_gravitational_parameter = bodies.get("Earth").gravitational_parameter
initial_state = element_conversion.keplerian_to_cartesian_elementwise(
gravitational_parameter=earth_gravitational_parameter,
semi_major_axis=7500.0E3,
eccentricity=0.1,
inclination=np.deg2rad(85.3),
argument_of_periapsis=np.deg2rad(235.7),
longitude_of_ascending_node=np.deg2rad(23.4),
true_anomaly=np.deg2rad(139.87)
# Retrieve the initial state of Delfi-C3 using Two-Line-Elements (TLEs)
delfi_tle = environment.Tle(
"1 32789U 07021G 08119.60740078 -.00000054 00000-0 00000+0 0 9999",
"2 32789 098.0082 179.6267 0015321 307.2977 051.0656 14.81417433 68"
)
delfi_ephemeris = environment.TleEphemeris( "Earth", "J2000", delfi_tle, False )
initial_state = delfi_ephemeris.cartesian_state( simulation_start_epoch )


### Create the integrator settings
Expand Down
2 changes: 1 addition & 1 deletion estimation/estimation_dynamical_models.ipynb
Expand Up @@ -102,7 +102,7 @@
"bodies.get(\"MEX\").mass = 1000.0\n",
"\n",
"# Create radiation pressure settings\n",
"reference_area_radiation = 4.0\n",
"reference_area_radiation = (4*0.3*0.1+2*0.1*0.1)/4 # Average projection area of a 3U CubeSat\n",
"radiation_pressure_coefficient = 1.2\n",
"occulting_bodies = [\"Mars\"]\n",
"radiation_pressure_settings = environment_setup.radiation_pressure.cannonball(\n",
Expand Down
27 changes: 12 additions & 15 deletions estimation/full_estimation_example.ipynb
Expand Up @@ -48,6 +48,7 @@
"from tudatpy import constants\n",
"from tudatpy.interface import spice\n",
"from tudatpy import numerical_simulation\n",
"from tudatpy.numerical_simulation import environment\n",
"from tudatpy.numerical_simulation import environment_setup\n",
"from tudatpy.numerical_simulation import propagation_setup\n",
"from tudatpy.numerical_simulation import estimation, estimation_setup\n",
Expand Down Expand Up @@ -138,10 +139,10 @@
"source": [
"# Create vehicle objects.\n",
"bodies.create_empty_body(\"Delfi-C3\")\n",
"bodies.get(\"Delfi-C3\").mass = 400.0\n",
"bodies.get(\"Delfi-C3\").mass = 2.2\n",
"\n",
"# Create aerodynamic coefficient interface settings\n",
"reference_area = 4.0\n",
"reference_area = (4*0.3*0.1+2*0.1*0.1)/4 # Average projection area of a 3U CubeSat\n",
"drag_coefficient = 1.2\n",
"aero_coefficient_settings = environment_setup.aerodynamic_coefficients.constant(\n",
" reference_area, [drag_coefficient, 0.0, 0.0]\n",
Expand All @@ -150,7 +151,7 @@
"environment_setup.add_aerodynamic_coefficient_interface(bodies, \"Delfi-C3\", aero_coefficient_settings)\n",
"\n",
"# Create radiation pressure settings\n",
"reference_area_radiation = 4.0\n",
"reference_area = (4*0.3*0.1+2*0.1*0.1)/4 # Average projection area of a 3U CubeSat\n",
"radiation_pressure_coefficient = 1.2\n",
"occulting_bodies = [\"Earth\"]\n",
"radiation_pressure_settings = environment_setup.radiation_pressure.cannonball(\n",
Expand Down Expand Up @@ -244,7 +245,7 @@
"### Define the initial state\n",
"Realise that the initial state of the spacecraft always has to be provided as a cartesian state - i.e. in the form of a list with the first three elements representing the initial position, and the three remaining elements representing the initial velocity.\n",
"\n",
"Within this example, we will make use of the `keplerian_to_cartesian_elementwise()` function - included in the `element_conversion` module - enabling us to convert an initial state from Keplerian elements to a 6x1 cartesian vector."
"Within this example, we will retrieve the initial state of Delfi-C3 using its Two-Line-Elements (TLE) the date of its launch (April the 28th, 2008). The TLE strings are obtained from [space-track.org](https://www.space-track.org)."
]
},
{
Expand All @@ -254,17 +255,13 @@
"metadata": {},
"outputs": [],
"source": [
"# Set the initial state of the vehicle\n",
"earth_gravitational_parameter = bodies.get(\"Earth\").gravitational_parameter\n",
"initial_state = element_conversion.keplerian_to_cartesian_elementwise(\n",
" gravitational_parameter=earth_gravitational_parameter,\n",
" semi_major_axis=7500.0E3,\n",
" eccentricity=0.1,\n",
" inclination=np.deg2rad(85.3),\n",
" argument_of_periapsis=np.deg2rad(235.7),\n",
" longitude_of_ascending_node=np.deg2rad(23.4),\n",
" true_anomaly=np.deg2rad(139.87)\n",
")"
"# Retrieve the initial state of Delfi-C3 using Two-Line-Elements (TLEs)\n",
"delfi_tle = environment.Tle(\n",
" \"1 32789U 07021G 08119.60740078 -.00000054 00000-0 00000+0 0 9999\",\n",
" \"2 32789 098.0082 179.6267 0015321 307.2977 051.0656 14.81417433 68\"\n",
")\n",
"delfi_ephemeris = environment.TleEphemeris( \"Earth\", \"J2000\", delfi_tle, False )\n",
"initial_state = delfi_ephemeris.cartesian_state( simulation_start_epoch )"
]
},
{
Expand Down
23 changes: 10 additions & 13 deletions estimation/full_estimation_example.py
Expand Up @@ -32,6 +32,7 @@
from tudatpy import constants
from tudatpy.interface import spice
from tudatpy import numerical_simulation
from tudatpy.numerical_simulation import environment
from tudatpy.numerical_simulation import environment_setup
from tudatpy.numerical_simulation import propagation_setup
from tudatpy.numerical_simulation import estimation, estimation_setup
Expand Down Expand Up @@ -92,10 +93,10 @@

# Create vehicle objects.
bodies.create_empty_body("Delfi-C3")
bodies.get("Delfi-C3").mass = 400.0
bodies.get("Delfi-C3").mass = 2.2

# Create aerodynamic coefficient interface settings
reference_area = 4.0
reference_area = (4*0.3*0.1+2*0.1*0.1)/4 # Average projection area of a 3U CubeSat
drag_coefficient = 1.2
aero_coefficient_settings = environment_setup.aerodynamic_coefficients.constant(
reference_area, [drag_coefficient, 0.0, 0.0]
Expand Down Expand Up @@ -172,20 +173,16 @@
"""
Realise that the initial state of the spacecraft always has to be provided as a cartesian state - i.e. in the form of a list with the first three elements representing the initial position, and the three remaining elements representing the initial velocity.
Within this example, we will make use of the `keplerian_to_cartesian_elementwise()` function - included in the `element_conversion` module - enabling us to convert an initial state from Keplerian elements to a 6x1 cartesian vector.
Within this example, we will retrieve the initial state of Delfi-C3 using its Two-Line-Elements (TLE) the date of its launch (April the 28th, 2008). The TLE strings are obtained from [space-track.org](https://www.space-track.org).
"""

# Set the initial state of the vehicle
earth_gravitational_parameter = bodies.get("Earth").gravitational_parameter
initial_state = element_conversion.keplerian_to_cartesian_elementwise(
gravitational_parameter=earth_gravitational_parameter,
semi_major_axis=7500.0E3,
eccentricity=0.1,
inclination=np.deg2rad(85.3),
argument_of_periapsis=np.deg2rad(235.7),
longitude_of_ascending_node=np.deg2rad(23.4),
true_anomaly=np.deg2rad(139.87)
# Retrieve the initial state of Delfi-C3 using Two-Line-Elements (TLEs)
delfi_tle = environment.Tle(
"1 32789U 07021G 08119.60740078 -.00000054 00000-0 00000+0 0 9999",
"2 32789 098.0082 179.6267 0015321 307.2977 051.0656 14.81417433 68"
)
delfi_ephemeris = environment.TleEphemeris( "Earth", "J2000", delfi_tle, False )
initial_state = delfi_ephemeris.cartesian_state( simulation_start_epoch )


### Create the integrator settings
Expand Down
12 changes: 6 additions & 6 deletions propagation/keplerian_satellite_orbit.ipynb
Expand Up @@ -225,12 +225,12 @@
"earth_gravitational_parameter = bodies.get(\"Earth\").gravitational_parameter\n",
"initial_state = element_conversion.keplerian_to_cartesian_elementwise(\n",
" gravitational_parameter=earth_gravitational_parameter,\n",
" semi_major_axis=7500.0e3,\n",
" eccentricity=0.1,\n",
" inclination=np.deg2rad(85.3),\n",
" argument_of_periapsis=np.deg2rad(235.7),\n",
" longitude_of_ascending_node=np.deg2rad(23.4),\n",
" true_anomaly=np.deg2rad(139.87),\n",
" semi_major_axis=6.99276221e+06,\n",
" eccentricity=4.03294322e-03,\n",
" inclination=1.71065169e+00,\n",
" argument_of_periapsis=1.31226971e+00,\n",
" longitude_of_ascending_node=3.82958313e-01,\n",
" true_anomaly=3.07018490e+00,\n",
")"
]
},
Expand Down
13 changes: 6 additions & 7 deletions propagation/keplerian_satellite_orbit.py
Expand Up @@ -3,7 +3,6 @@
Copyright (c) 2010-2022, Delft University of Technology. All rights reserved. This file is part of the Tudat. Redistribution and use in source and binary forms, with or without modification, are permitted exclusively under the terms of the Modified BSD license. You should have received a copy of the license with this file. If not, please or visit: http://tudat.tudelft.nl/LICENSE.
"""


## Context
"""
This example demonstrates the basic propagation of a (quasi-massless) body under the influence of a central point-mass attractor. It therefore resembles the classic two-body problem.
Expand Down Expand Up @@ -148,12 +147,12 @@
earth_gravitational_parameter = bodies.get("Earth").gravitational_parameter
initial_state = element_conversion.keplerian_to_cartesian_elementwise(
gravitational_parameter=earth_gravitational_parameter,
semi_major_axis=7500.0e3,
eccentricity=0.1,
inclination=np.deg2rad(85.3),
argument_of_periapsis=np.deg2rad(235.7),
longitude_of_ascending_node=np.deg2rad(23.4),
true_anomaly=np.deg2rad(139.87),
semi_major_axis=6.99276221e+06,
eccentricity=4.03294322e-03,
inclination=1.71065169e+00,
argument_of_periapsis=1.31226971e+00,
longitude_of_ascending_node=3.82958313e-01,
true_anomaly=3.07018490e+00,
)

### Create the propagator settings
Expand Down
25 changes: 11 additions & 14 deletions propagation/linear_sensitivity_analysis.ipynb
Expand Up @@ -46,6 +46,7 @@
"# Load tudatpy modules\n",
"from tudatpy.interface import spice\n",
"from tudatpy import numerical_simulation\n",
"from tudatpy.numerical_simulation import environment\n",
"from tudatpy.numerical_simulation import environment_setup, propagation_setup, estimation_setup\n",
"from tudatpy.astro import element_conversion\n",
"from tudatpy import constants\n",
Expand Down Expand Up @@ -143,7 +144,7 @@
"bodies.get(\"Delfi-C3\").mass = 400.0\n",
"\n",
"# Create aerodynamic coefficient interface settings\n",
"reference_area = 4.0\n",
"reference_area = (4*0.3*0.1+2*0.1*0.1)/4 # Average projection area of a 3U CubeSat\n",
"drag_coefficient = 1.2\n",
"aero_coefficient_settings = environment_setup.aerodynamic_coefficients.constant(\n",
" reference_area, [drag_coefficient, 0.0, 0.0]\n",
Expand All @@ -153,7 +154,7 @@
" bodies, \"Delfi-C3\", aero_coefficient_settings)\n",
"\n",
"# Create radiation pressure settings\n",
"reference_area_radiation = 4.0\n",
"reference_area_radiation = (4*0.3*0.1+2*0.1*0.1)/4 # Average projection area of a 3U CubeSat\n",
"radiation_pressure_coefficient = 1.2\n",
"occulting_bodies = [\"Earth\"]\n",
"radiation_pressure_settings = environment_setup.radiation_pressure.cannonball(\n",
Expand Down Expand Up @@ -256,7 +257,7 @@
"\n",
"This initial state always has to be provided as a cartesian state, in the form of a list with the first three elements reprensenting the initial position, and the three remaining elements representing the initial velocity.\n",
"\n",
"In this case, let's make use of the `keplerian_to_cartesian_elementwise()` function that is included in the `element_conversion` module, so that the initial state can be input as Keplerian elements, and then converted in Cartesian elements."
"Within this example, we will retrieve the initial state of Delfi-C3 using its Two-Line-Elements (TLE) the date of its launch (April the 28th, 2008). The TLE strings are obtained from [space-track.org](https://www.space-track.org)."
]
},
{
Expand All @@ -266,17 +267,13 @@
"metadata": {},
"outputs": [],
"source": [
"# Set the initial state of the vehicle\n",
"earth_gravitational_parameter = bodies.get(\"Earth\").gravitational_parameter\n",
"initial_state = element_conversion.keplerian_to_cartesian_elementwise(\n",
" gravitational_parameter=earth_gravitational_parameter,\n",
" semi_major_axis=7500.0E3,\n",
" eccentricity=0.1,\n",
" inclination=np.deg2rad(85.3),\n",
" argument_of_periapsis=np.deg2rad(235.7),\n",
" longitude_of_ascending_node=np.deg2rad(23.4),\n",
" true_anomaly=np.deg2rad(139.87)\n",
")"
"# Retrieve the initial state of Delfi-C3 using Two-Line-Elements (TLEs)\n",
"delfi_tle = environment.Tle(\n",
" \"1 32789U 07021G 08119.60740078 -.00000054 00000-0 00000+0 0 9999\",\n",
" \"2 32789 098.0082 179.6267 0015321 307.2977 051.0656 14.81417433 68\"\n",
")\n",
"delfi_ephemeris = environment.TleEphemeris( \"Earth\", \"J2000\", delfi_tle, False )\n",
"initial_state = delfi_ephemeris.cartesian_state( simulation_start_epoch )"
]
},
{
Expand Down

0 comments on commit 88a602a

Please sign in to comment.