Section 07 - Guidance Scheme

[2]:
from AMAT.planet import Planet
from AMAT.vehicle import Vehicle
[3]:
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]:
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.8 ,0.0,0.0)
vehicle.setSolverParams(1E-6)
[15]:
vehicle.propogateEntry2(200, 0.1, 0)

# Values for -13.64 deg, these are the linear fit
# y = ax + b parameters used to compute Ghdot and Gq (see refs.)
a = -0.155
b =  56000

x_arr = np.linspace(260.0E3,350.0E3,101)
y_arr = a*x_arr + b

fig = plt.figure()
fig.set_size_inches([4.25,3.25])
plt.rc('font',family='Times New Roman')
params = {'mathtext.default': 'regular' }
plt.rcParams.update(params)

plt.plot(vehicle.h_kmc*1E3,vehicle.dyn_pres_atm*1.01325E5,'r-',linewidth=3.0)

plt.xlim(100.0E3, 700.0E3)
#plt.ylim(0.0,12500.0)

plt.plot(x_arr,y_arr,color='k',linewidth=2.0,linestyle='dashed')
plt.xlabel("Altitude, m", fontsize=10)
plt.ylabel("Dynamic pressure, Pa ",fontsize=10)

plt.xticks(np.array([200.0E3 ,300E3, 400.00E3,  500e3, 600.0E3]),fontsize=10)

ax=plt.gca()
ax.tick_params(direction='in')
ax.yaxis.set_ticks_position('both')
ax.xaxis.set_ticks_position('both')
ax.tick_params(axis='x',labelsize=10)
ax.tick_params(axis='y',labelsize=10)
ax.tick_params(direction='in')

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=8)
ax.yaxis.set_tick_params(width=1, length=8)
ax.xaxis.set_tick_params(width=1, length=6, which='minor')
ax.yaxis.set_tick_params(width=1, length=6, 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)

ax.annotate(r'$\bar{q} = -0.155h + 56000$',
    xy=(348586, 9103.4) ,
    xytext=(431181, 9103.4),
    arrowprops=dict(arrowstyle="<-"),  va="center", ha="left", fontsize=9)

for axis in ['top', 'bottom', 'left', 'right']:
    ax.spines[axis].set_linewidth(2)

plt.savefig('../../../data/acta-astronautica/uranus-orbiter-probe/dyn-pres-profile.png', dpi= 300,bbox_inches='tight')
plt.savefig('../../../data/acta-astronautica/uranus-orbiter-probe/dyn-pres-profile.pdf', dpi=300,bbox_inches='tight')
plt.savefig('../../../data/acta-astronautica/uranus-orbiter-probe/dyn-pres-profile.eps', dpi=300,bbox_inches='tight')


plt.show()
../../_images/acta-aa-notebooks_uranus-orbiter-probe_07-guidance-scheme_5_0.png
[11]:
0.05**2*146/(0.24*0.155)
[11]:
9.81182795698925
[12]:
2*1.5*0.05*146/0.24
[12]:
91.25000000000001

Example Guided Trajectory

[26]:
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
[129]:
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)
[130]:
planet.density_int = density_int_avg
[131]:
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.180,0.0,0.0)
vehicle.setSolverParams(1E-6)
# Set the guidance parameters described in the paper.
# See the function description for parameter details.

# Set max roll rate constraint to 30 deg/s
vehicle.setMaxRollRate(30.0)

# Set Ghdot = 83
# Set Gq = 9.0
# Set v_switch_kms = 16.0 :: this parameter is not really used, and should just be set to low value
# Set low_Alt_km = 120
# Set numPoints_lowAlt = 101
# Set hdot_threshold = -500 m/s
vehicle.setEquilibriumGlideParams(83.0, 9.0, 16.0, 120.0, 101, -500.0)

# Set target orbit parameters
# periapsis = 4000.0 km
# apoapsis = 550,000 km :: set slightly above target (500e3) to account for bias in targeting algorithm
# apoapsis tolerance = 10 km
vehicle.setTargetOrbitParams(4000.0, 550.0E3, 10.0E3)
[132]:
vehicle.propogateGuidedEntry2(0.5, 0.1, 2400.0)
[179]:
# plot overshoot and undershoot trajectories
fig = plt.figure()
fig = plt.figure()
fig.set_size_inches([11.8,6.85])
plt.rc('font',family='Times New Roman')
params = {'mathtext.default': 'regular' }
plt.rcParams.update(params)


plt.subplot(2, 2, 1)
plt.plot(vehicle.t_min_full , vehicle.h_km_full, linestyle='solid' , color='xkcd:blue',linewidth=2.0)
plt.scatter(vehicle.t_switch, vehicle.h_switch, marker="o", s=30, color='xkcd:bright red', zorder=100)
plt.scatter(vehicle.t_step_array[np.where(vehicle.hdot_array[1:]>-500)[0][0]],
            vehicle.h_step_array[np.where(vehicle.hdot_array[1:]>-500)[0][0]],marker="D", s=30, color='xkcd:green', zorder=100)
plt.xlabel('Time, min',fontsize=14)
plt.ylabel("Altitude, km",fontsize=14)
ax = plt.gca()
ax.tick_params(direction='in')
ax.yaxis.set_ticks_position('both')
ax.xaxis.set_ticks_position('both')
plt.tick_params(direction='in')
plt.tick_params(axis='x',labelsize=14)
plt.tick_params(axis='y',labelsize=14)

plt.subplot(2, 2, 2)
plt.plot(vehicle.t_step_array[1:] , vehicle.hdot_array[1:], linestyle='solid' , color='xkcd:blue',linewidth=2.0)
plt.scatter(vehicle.t_switch, vehicle.hdot_array[np.where(vehicle.t_step_array>vehicle.t_switch)[0][0]], marker="o", s=30, color='xkcd:bright red', zorder=100)
plt.scatter(vehicle.t_step_array[np.where(vehicle.hdot_array[1:]>-500)[0][0]],
            vehicle.hdot_array[np.where(vehicle.hdot_array[1:]>-500)[0][0]],marker="D", s=30, color='xkcd:green', zorder=100)
plt.xlabel('Time, min',fontsize=14)
plt.ylabel('Altitude rate'+', m/s',fontsize=14)
plt.axhline(y=-500, color='k', linestyle='dashed', linewidth=1.5)
ax = plt.gca()
ax.tick_params(direction='in')
ax.yaxis.set_ticks_position('both')
ax.xaxis.set_ticks_position('both')
plt.tick_params(direction='in')
plt.tick_params(axis='x',labelsize=14)
plt.tick_params(axis='y',labelsize=14)

plt.subplot(2, 2, 3)
plt.plot(vehicle.t_step_array , vehicle.delta_deg_array, linestyle='solid' , color='xkcd:blue',linewidth=2.0)
plt.scatter(vehicle.t_step_array[np.where(vehicle.hdot_array[1:]>-500)[0][0]],
            vehicle.delta_deg_array[np.where(vehicle.hdot_array[1:]>-500)[0][0]],marker="D", s=30, color='xkcd:green', zorder=100)
plt.scatter(vehicle.t_switch, 180, marker="o", s=30, color='xkcd:bright red', zorder=100)
plt.xlabel('Time, min',fontsize=14)
plt.ylabel('Commanded bank angle, deg.',fontsize=14)
ax = plt.gca()
ax.tick_params(direction='in')
ax.yaxis.set_ticks_position('both')
ax.xaxis.set_ticks_position('both')
plt.tick_params(direction='in')
plt.tick_params(axis='x',labelsize=14)
plt.tick_params(axis='y',labelsize=14)

plt.subplot(2, 2, 4)
plt.plot(vehicle.t_min_full , vehicle.v_kms_full, linestyle='solid' , color='xkcd:blue',linewidth=2.0)
plt.scatter(vehicle.t_step_array[np.where(vehicle.hdot_array[1:]>-500)[0][0]], 27.25, marker="D", s=30, color='xkcd:green', zorder=100)
plt.scatter(vehicle.t_switch, vehicle.v_kms_eg[-1], marker="o", s=30, color='xkcd:bright red', zorder=100)
plt.xlabel('Time, min',fontsize=14)
plt.ylabel("Planet-relative speed, km/s",fontsize=14)
ax = plt.gca()
ax.tick_params(direction='in')
ax.yaxis.set_ticks_position('both')
ax.xaxis.set_ticks_position('both')
plt.tick_params(direction='in')
plt.tick_params(axis='x',labelsize=14)
plt.tick_params(axis='y',labelsize=14)

plt.savefig('../../../data/acta-astronautica/uranus-orbiter-probe/guidance-schematic.png', dpi= 300,bbox_inches='tight')
plt.savefig('../../../data/acta-astronautica/uranus-orbiter-probe/guidance-schematic.pdf', dpi=300,bbox_inches='tight')
plt.savefig('../../../data/acta-astronautica/uranus-orbiter-probe/guidance-schematic.eps', dpi=300,bbox_inches='tight')

plt.show()
<Figure size 640x480 with 0 Axes>
../../_images/acta-aa-notebooks_uranus-orbiter-probe_07-guidance-scheme_14_1.png
[ ]: