Section 06 - Effect of Atmospheric Uncertainties
[1]:
from AMAT.planet import Planet
from AMAT.vehicle import Vehicle
[2]:
import numpy as np
import matplotlib.pyplot as plt
[3]:
planet = Planet('URANUS')
planet.loadAtmosphereModel('../../../atmdata/Uranus/uranus-gram-avg.dat', 0 , 1 ,2, 3, heightInKmFlag=True)
planet.h_skip = 1000.0E3
planet.h_low = 120e3
planet.h_trap = 100e3
[4]:
ATM_height, ATM_density_low, ATM_density_avg, ATM_density_high, ATM_density_pert = planet.loadMonteCarloDensityFile2('../../../atmdata/Uranus/uranus-gram-mean-density-variations.txt', 0, 1, 2, 3, 4, heightInKmFlag=True)
density_int_low = planet.loadAtmosphereModel5(ATM_height, ATM_density_low, ATM_density_avg, ATM_density_high, ATM_density_pert, -3.0, 2201, 1)
density_int_avg = planet.loadAtmosphereModel5(ATM_height, ATM_density_low, ATM_density_avg, ATM_density_high, ATM_density_pert, 0.0, 2201, 1)
density_int_hig = planet.loadAtmosphereModel5(ATM_height, ATM_density_low, ATM_density_avg, ATM_density_high, ATM_density_pert, +3.0, 2201, 1)
[5]:
planet1 = Planet('URANUS')
planet2 = Planet('URANUS')
planet3 = Planet('URANUS')
planet1.density_int = density_int_low
planet2.density_int = density_int_avg
planet3.density_int = density_int_hig
[6]:
h_array = np.linspace(0, 1000e3, 1001)
d_min_arr = planet1.densityvectorized(h_array)
d_avg_arr = planet2.densityvectorized(h_array)
d_max_arr = planet3.densityvectorized(h_array)
[16]:
fig = plt.figure()
fig.set_size_inches([6.25, 3.25])
plt.rc('font',family='Times New Roman')
params = {'mathtext.default': 'regular' }
plt.rcParams.update(params)
plt.plot(d_min_arr, h_array*1E-3, 'b-', linewidth=1.0, label="Minimum "+r"$(-3\sigma)$")
plt.plot(d_avg_arr, h_array*1E-3, 'g-', linewidth=1.0, label="Average")
plt.plot(d_max_arr, h_array*1E-3, 'r-', linewidth=1.0, label="Maximum "+r"$(+3\sigma)$")
plt.xlabel("Density, kg/m3",fontsize=12)
plt.ylabel("Altitude, km",fontsize=12)
plt.xscale('log')
plt.yticks(fontsize=12)
plt.xticks(np.logspace(-8, 0, 9), fontsize=12)
plt.grid('on',linestyle='-', linewidth=0.2)
ax=plt.gca()
ax.xaxis.set_tick_params(direction='in', which='both')
ax.yaxis.set_tick_params(direction='in', which='both')
ax.xaxis.set_tick_params(width=2, length=4)
ax.yaxis.set_tick_params(width=2, length=4)
ax.xaxis.set_tick_params(width=1, length=4, which='minor')
ax.yaxis.set_tick_params(width=1, length=4, which='minor')
ax.xaxis.grid(which='major', color='k', linestyle='dotted', linewidth=0.5)
ax.xaxis.grid(which='minor', color='k', linestyle='dotted', linewidth=0.0)
ax.yaxis.grid(which='major', color='k', linestyle='dotted', linewidth=0.5)
ax.yaxis.grid(which='minor', color='k', linestyle='dotted', linewidth=0.0)
for axis in ['top', 'bottom', 'left', 'right']:
ax.spines[axis].set_linewidth(2)
plt.legend(loc='upper right', fontsize=12, framealpha=0.8)
plt.savefig('../../../data/acta-astronautica/uranus-orbiter-probe/density-variations.png', dpi= 300,bbox_inches='tight')
plt.savefig('../../../data/acta-astronautica/uranus-orbiter-probe/density-variations.pdf', dpi=300,bbox_inches='tight')
plt.savefig('../../../data/acta-astronautica/uranus-orbiter-probe/density-variations.eps', dpi=300,bbox_inches='tight')
plt.show()
The PostScript backend does not support transparency; partially transparent artists will be rendered opaque.

[17]:
planet.density_int = density_int_low
vehicle=Vehicle('Titania', 3200.0, 146 , 0.24, np.pi*4.5**2.0, 0.0, 1.125, planet)
vehicle.setInitialState(1000.0,-15.22,75.55,29.2877,88.687,-11.0 ,0.0,0.0)
vehicle.setSolverParams(1E-6)
# Compute the corridor bounds and TCW for low density atnosphere
overShootLimit, exitflag_os = vehicle.findOverShootLimit2(2400.0,0.1,-25,-4.0,1E-10,500e3)
underShootLimit, exitflag_us = vehicle.findUnderShootLimit2(2400.0,0.1,-25 ,-4.0,1E-10,500e3)
# print the overshoot and undershoot limits we just computed.
print("Overshoot limit : "+str('{:.4f}'.format(overShootLimit))+ " deg")
print("Undershoot limit : "+str('{:.4f}'.format(underShootLimit))+ " deg")
print("TCW: "+ str('{:.4f}'.format(overShootLimit-underShootLimit))+ " deg")
Overshoot limit : -11.3102 deg
Undershoot limit : -12.3240 deg
TCW: 1.0138 deg
[18]:
planet.density_int = density_int_avg
vehicle=Vehicle('Titania', 3200.0, 146 , 0.24, np.pi*4.5**2.0, 0.0, 1.125, planet)
vehicle.setInitialState(1000.0,-15.22,75.55,29.2877,88.687,-11.0 ,0.0,0.0)
vehicle.setSolverParams(1E-6)
# Compute the corridor bounds and TCW for low density atnosphere
overShootLimit, exitflag_os = vehicle.findOverShootLimit2(2400.0,0.1,-25,-4.0,1E-10,500e3)
underShootLimit, exitflag_us = vehicle.findUnderShootLimit2(2400.0,0.1,-25 ,-4.0,1E-10,500e3)
# print the overshoot and undershoot limits we just computed.
print("Overshoot limit : "+str('{:.4f}'.format(overShootLimit))+ " deg")
print("Undershoot limit : "+str('{:.4f}'.format(underShootLimit))+ " deg")
print("TCW: "+ str('{:.4f}'.format(overShootLimit-underShootLimit))+ " deg")
Overshoot limit : -11.1238 deg
Undershoot limit : -12.1418 deg
TCW: 1.0180 deg
[19]:
planet.density_int = density_int_hig
vehicle=Vehicle('Titania', 3200.0, 146 , 0.24, np.pi*4.5**2.0, 0.0, 1.125, planet)
vehicle.setInitialState(1000.0,-15.22,75.55,29.2877,88.687,-11.0 ,0.0,0.0)
vehicle.setSolverParams(1E-6)
# Compute the corridor bounds and TCW for low density atnosphere
overShootLimit, exitflag_os = vehicle.findOverShootLimit2(2400.0,0.1,-25,-4.0,1E-10,500e3)
underShootLimit, exitflag_us = vehicle.findUnderShootLimit2(2400.0,0.1,-25 ,-4.0,1E-10,500e3)
# print the overshoot and undershoot limits we just computed.
print("Overshoot limit : "+str('{:.4f}'.format(overShootLimit))+ " deg")
print("Undershoot limit : "+str('{:.4f}'.format(underShootLimit))+ " deg")
print("TCW: "+ str('{:.4f}'.format(overShootLimit-underShootLimit))+ " deg")
Overshoot limit : -10.9809 deg
Undershoot limit : -12.0031 deg
TCW: 1.0221 deg
Target EFPA selection
[91]:
from matplotlib.patches import Polygon
fig = plt.figure()
fig.set_size_inches([6.25,3.25])
plt.rc('font',family='Times New Roman')
params = {'mathtext.default': 'regular' }
plt.rcParams.update(params)
ax = plt.gca()
x1 = [1.0, 1.0, 2.0, 2.0]
y1 = [-12.3240, -11.3102, -11.3102, -12.3240]
x2 = [2.0, 2.0, 3.0, 3.0]
y2 = [-12.1418,-11.1238, -11.1238, -12.1418]
x3 = [3.0, 3.0, 4.0, 4.0]
y3 = [-12.0031, -10.9809 , -10.9809 , -12.0031]
poly1 = Polygon( list(zip(x1,y1)), facecolor='xkcd:blue', edgecolor='k')
ax.add_patch(poly1)
poly2 = Polygon( list(zip(x2,y2)), facecolor='xkcd:green', edgecolor='k')
ax.add_patch(poly2)
poly3 = Polygon( list(zip(x3,y3)), facecolor='xkcd:red', edgecolor='k')
ax.add_patch(poly3)
plt.ylabel("Entry flight-path angle, deg",fontsize=12)
plt.xlabel("Atmospheric density",fontsize=12)
plt.tick_params(axis='x', # changes apply to the x-axis
which='both', # both major and minor ticks are affected
bottom=False, # ticks along the bottom edge are off
top=False, # ticks along the top edge are off
labelbottom=False)
plt.axhline(y=-11.3102, linewidth=1.0, linestyle='solid' ,color='xkcd:blue')
plt.axhline(y=-12.0031, linewidth=1.0, linestyle='solid' ,color='xkcd:red')
plt.axhline(y=-11.70, linewidth=2.0, linestyle='dashdot' ,color='xkcd:black')
plt.axhline(y=-11.40, linewidth=2.0, linestyle='dotted' ,color='xkcd:black')
plt.axhline(y=-12.00, linewidth=2.0, linestyle='dotted' ,color='xkcd:black')
ax.tick_params(direction='in')
ax.yaxis.set_ticks_position('both')
plt.yticks(fontsize=12)
ax=plt.gca()
ax.xaxis.set_tick_params(direction='in', which='both')
ax.yaxis.set_tick_params(direction='in', which='both')
ax.xaxis.set_tick_params(width=1, length=4)
ax.yaxis.set_tick_params(width=1, length=4)
ax.xaxis.set_tick_params(width=1, length=4, which='minor')
ax.yaxis.set_tick_params(width=1, length=4, which='minor')
ax.xaxis.grid(which='major', color='k', linestyle='dotted', linewidth=0.5)
ax.xaxis.grid(which='minor', color='k', linestyle='dotted', linewidth=0.0)
ax.yaxis.grid(which='major', color='k', linestyle='dotted', linewidth=0.5)
ax.yaxis.grid(which='minor', color='k', linestyle='dotted', linewidth=0.0)
for axis in ['top', 'bottom', 'left', 'right']:
ax.spines[axis].set_linewidth(2)
ax.set_xlim([-1.5, 6.5])
ax.set_ylim([-13.05, -10.5])
plt.text(1.3, -12.45, 'Min', color='xkcd:blue', fontsize=10)
plt.text(2.3, -12.27, 'Avg', color='xkcd:green', fontsize=10)
plt.text(3.3, -12.15, 'Max', color='xkcd:red', fontsize=10)
plt.annotate("Overshoot limit for min. density atmosphere" , xy=(0.20, -11.33),
xytext=(1.3, -10.650),
va="center", ha="center",
arrowprops=dict(arrowstyle='->, head_width=0.2', facecolor='blue'), fontsize=10,color='k',
bbox=dict(boxstyle='round,pad=0.2', fc='w', ec='k', alpha=1))
plt.annotate("Undershoot limit for max. density atmosphere" , xy=(0.20, -12.00),
xytext=(1.3, -12.750),
va="center", ha="center",
arrowprops=dict(arrowstyle='->, head_width=0.2', facecolor='blue'), fontsize=10,color='k',
bbox=dict(boxstyle='round,pad=0.2', fc='w', ec='k', alpha=1))
plt.annotate("Target EFPA" , xy=(4.5, -11.73),
xytext=(4.5, -10.75),
va="center", ha="center",
arrowprops=dict(arrowstyle='->, head_width=0.2', facecolor='blue'), fontsize=10,color='k',
bbox=dict(boxstyle='round,pad=0.2', fc='w', ec='k', alpha=1))
plt.annotate("Assumed delivery error\n" +r"$\pm 0.30$"+ " deg. "+ r"$3\sigma$" , xy=(5.3, -11.38),
xytext=(5.3, -12.225),
va="center", ha="center",
arrowprops=dict(arrowstyle='<->, head_width=0.4', facecolor='blue'), fontsize=10,color='k',
bbox=dict(boxstyle='round,pad=0.2', fc='w', ec='k', alpha=1))
plt.savefig('../../../data/acta-astronautica/uranus-orbiter-probe/target-efpa-selection.png', dpi= 300,bbox_inches='tight')
plt.savefig('../../../data/acta-astronautica/uranus-orbiter-probe/target-efpa-selection.pdf', dpi=300,bbox_inches='tight')
plt.savefig('../../../data/acta-astronautica/uranus-orbiter-probe/target-efpa-selection.eps', dpi=300,bbox_inches='tight')
plt.show()
