diff --git a/estimation/covariance_estimated_parameters.ipynb b/estimation/covariance_estimated_parameters.ipynb index 0f42a4a..552068e 100644 --- a/estimation/covariance_estimated_parameters.ipynb +++ b/estimation/covariance_estimated_parameters.ipynb @@ -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", @@ -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", @@ -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", @@ -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)." ] }, { @@ -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 )" ] }, { diff --git a/estimation/covariance_estimated_parameters.py b/estimation/covariance_estimated_parameters.py index da4daa8..9ad4da8 100644 --- a/estimation/covariance_estimated_parameters.py +++ b/estimation/covariance_estimated_parameters.py @@ -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 @@ -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] @@ -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 diff --git a/estimation/estimation_dynamical_models.ipynb b/estimation/estimation_dynamical_models.ipynb index 221bdb5..cbabfac 100644 --- a/estimation/estimation_dynamical_models.ipynb +++ b/estimation/estimation_dynamical_models.ipynb @@ -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", diff --git a/estimation/full_estimation_example.ipynb b/estimation/full_estimation_example.ipynb index deed820..e46a969 100644 --- a/estimation/full_estimation_example.ipynb +++ b/estimation/full_estimation_example.ipynb @@ -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", @@ -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", @@ -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", @@ -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)." ] }, { @@ -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 )" ] }, { diff --git a/estimation/full_estimation_example.py b/estimation/full_estimation_example.py index f17fab6..ca82fbb 100644 --- a/estimation/full_estimation_example.py +++ b/estimation/full_estimation_example.py @@ -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 @@ -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] @@ -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 diff --git a/propagation/keplerian_satellite_orbit.ipynb b/propagation/keplerian_satellite_orbit.ipynb index 74ce8da..4952ea5 100644 --- a/propagation/keplerian_satellite_orbit.ipynb +++ b/propagation/keplerian_satellite_orbit.ipynb @@ -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", ")" ] }, diff --git a/propagation/keplerian_satellite_orbit.py b/propagation/keplerian_satellite_orbit.py index 614218f..7b78d9c 100644 --- a/propagation/keplerian_satellite_orbit.py +++ b/propagation/keplerian_satellite_orbit.py @@ -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. @@ -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 diff --git a/propagation/linear_sensitivity_analysis.ipynb b/propagation/linear_sensitivity_analysis.ipynb index e24ab83..e7dd935 100644 --- a/propagation/linear_sensitivity_analysis.ipynb +++ b/propagation/linear_sensitivity_analysis.ipynb @@ -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", @@ -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", @@ -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", @@ -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)." ] }, { @@ -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 )" ] }, { diff --git a/propagation/linear_sensitivity_analysis.py b/propagation/linear_sensitivity_analysis.py index d071af6..6280339 100644 --- a/propagation/linear_sensitivity_analysis.py +++ b/propagation/linear_sensitivity_analysis.py @@ -31,6 +31,7 @@ # Load tudatpy modules from tudatpy.interface import spice from tudatpy import numerical_simulation +from tudatpy.numerical_simulation import environment from tudatpy.numerical_simulation import environment_setup, propagation_setup, estimation_setup from tudatpy.astro import element_conversion from tudatpy import constants @@ -95,10 +96,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] @@ -108,7 +109,7 @@ bodies, "Delfi-C3", aero_coefficient_settings) # Create radiation pressure settings -reference_area_radiation = 4.0 +reference_area_radiation = (4*0.3*0.1+2*0.1*0.1)/4 # Average projection area of a 3U CubeSat radiation_pressure_coefficient = 1.2 occulting_bodies = ["Earth"] radiation_pressure_settings = environment_setup.radiation_pressure.cannonball( @@ -186,20 +187,17 @@ 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. -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. +In this casWithin 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 """ diff --git a/propagation/perturbed_satellite_orbit.ipynb b/propagation/perturbed_satellite_orbit.ipynb index 61d2a66..c430dec 100644 --- a/propagation/perturbed_satellite_orbit.ipynb +++ b/propagation/perturbed_satellite_orbit.ipynb @@ -45,6 +45,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\n", "from tudatpy.astro import element_conversion\n", "from tudatpy import constants\n", @@ -140,7 +141,7 @@ "# Create vehicle objects.\n", "bodies.create_empty_body(\"Delfi-C3\")\n", "\n", - "bodies.get(\"Delfi-C3\").mass = 400.0" + "bodies.get(\"Delfi-C3\").mass = 2.2" ] }, { @@ -150,7 +151,7 @@ "source": [ "To account for the aerodynamic of the satellite, let's add an aerodynamic interface and add it to the environment setup, taking the followings into account:\n", "- A constant drag coefficient of 1.2.\n", - "- A reference area of 4m$^2$.\n", + "- A reference area of 0.035m$^2$.\n", "- No sideslip or lift coefficient (equal to 0).\n", "- No moment coefficient." ] @@ -163,7 +164,7 @@ "outputs": [], "source": [ "# Create aerodynamic coefficient interface settings, and add to vehicle\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]\n", @@ -188,7 +189,7 @@ "outputs": [], "source": [ "# Create radiation pressure settings, and add to vehicle\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", @@ -291,7 +292,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)." ] }, { @@ -301,19 +302,13 @@ "metadata": {}, "outputs": [], "source": [ - "# Set initial conditions for the satellite that will be\n", - "# propagated in this simulation. The initial conditions are given in\n", - "# Keplerian elements and later on converted to Cartesian elements\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 )" ] }, { diff --git a/propagation/perturbed_satellite_orbit.py b/propagation/perturbed_satellite_orbit.py index a19b922..5bb5080 100644 --- a/propagation/perturbed_satellite_orbit.py +++ b/propagation/perturbed_satellite_orbit.py @@ -30,6 +30,7 @@ # Load tudatpy modules from tudatpy.interface import spice from tudatpy import numerical_simulation +from tudatpy.numerical_simulation import environment from tudatpy.numerical_simulation import environment_setup, propagation_setup from tudatpy.astro import element_conversion from tudatpy import constants @@ -95,7 +96,7 @@ # Create vehicle objects. bodies.create_empty_body("Delfi-C3") -bodies.get("Delfi-C3").mass = 400.0 +bodies.get("Delfi-C3").mass = 2.2 # To account for the aerodynamic of the satellite, let's add an aerodynamic interface and add it to the environment setup, taking the followings into account: @@ -105,7 +106,7 @@ # - No moment coefficient. # Create aerodynamic coefficient interface settings, and add to vehicle -reference_area = 4.0 +reference_area = (4*0.3*0.1+2*0.1*0.1)/4 # Average projection drag_coefficient = 1.2 aero_coefficient_settings = environment_setup.aerodynamic_coefficients.constant( reference_area, [drag_coefficient, 0, 0] @@ -117,7 +118,7 @@ # To account for the pressure of the solar radiation on the satellite, let's add another interface. This takes a radiation pressure coefficient of 1.2, and a radiation area of 4m$^2$. This interface also accounts for the variation in pressure cause by the shadow of Earth. # Create radiation pressure settings, and add to vehicle -reference_area_radiation = 4.0 +reference_area_radiation = (4*0.3*0.1+2*0.1*0.1)/4 # Average projection area of a 3U CubeSat radiation_pressure_coefficient = 1.2 occulting_bodies = ["Earth"] radiation_pressure_settings = environment_setup.radiation_pressure.cannonball( @@ -194,22 +195,16 @@ 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. -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. -""" - -# Set initial conditions for the satellite that will be -# propagated in this simulation. The initial conditions are given in -# Keplerian elements and later on converted to Cartesian elements -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), +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). +""" + +# 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 ) ### Define dependent variables to save diff --git a/pygmo/asteroid_orbit_optimization/aoo_custom_environment.ipynb b/pygmo/asteroid_orbit_optimization/aoo_custom_environment.ipynb index 3e13590..4d31b73 100644 --- a/pygmo/asteroid_orbit_optimization/aoo_custom_environment.ipynb +++ b/pygmo/asteroid_orbit_optimization/aoo_custom_environment.ipynb @@ -337,7 +337,7 @@ " bodies.get(\"Spacecraft\").set_constant_mass(400.0)\n", "\n", " # Create radiation pressure settings, and add to vehicle\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", " radiation_pressure_settings = environment_setup.radiation_pressure.cannonball(\n", " \"Sun\",\n", diff --git a/pygmo/asteroid_orbit_optimization/aoo_design_space_exploration.ipynb b/pygmo/asteroid_orbit_optimization/aoo_design_space_exploration.ipynb index c9896c6..9d59402 100644 --- a/pygmo/asteroid_orbit_optimization/aoo_design_space_exploration.ipynb +++ b/pygmo/asteroid_orbit_optimization/aoo_design_space_exploration.ipynb @@ -312,7 +312,7 @@ " bodies.get(\"Spacecraft\").set_constant_mass(400.0)\n", "\n", " # Create radiation pressure settings, and add to vehicle\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", " radiation_pressure_settings = environment_setup.radiation_pressure.cannonball(\n", " \"Sun\",\n", diff --git a/pygmo/asteroid_orbit_optimization/aoo_optimization.ipynb b/pygmo/asteroid_orbit_optimization/aoo_optimization.ipynb index 10e7ca5..1212357 100644 --- a/pygmo/asteroid_orbit_optimization/aoo_optimization.ipynb +++ b/pygmo/asteroid_orbit_optimization/aoo_optimization.ipynb @@ -313,7 +313,7 @@ " bodies.get(\"Spacecraft\").set_constant_mass(400.0)\n", "\n", " # Create radiation pressure settings, and add to vehicle\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", " radiation_pressure_settings = environment_setup.radiation_pressure.cannonball(\n", " \"Sun\",\n",