Exemplo n.º 1
0
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'Aero'))
import aero_calcs as ac
import mars_standard_atmosphere as atm

mean_radius = 3389500  #[m]
reentry_altitude = 80000  #[m]
v_insertion_orbit = 3272.46591  #[m/s]
insertion_orbit_a = mean_radius + 500000  #[m]
insertion_orbit_p = mean_radius - 300000  #[m]

vehicle_mass = 38000  #[kg]
S = 350  #[m^2]
MOI = [391281.1045, 22714482.967, 22714482.967]  # Ixx, Iyy, Izz
dt = 0.1

mars = astro_tools.Planet()

state = np.zeros(12)
state[0] = mars.reentry_velocity(reentry_altitude, insertion_orbit_a,
                                 insertion_orbit_p)  # velocity
state[1] = mars.reentry_angle(
    reentry_altitude, insertion_orbit_p,
    insertion_orbit_a)  # flight path angle (1.5 arcsecs (2 sigma))
state[2] = np.radians(42.5)  # heading angle (1.5 arcsecs (2 sigma))
state[3] = reentry_altitude + mean_radius  # radius
state[4] = np.radians(-1.168)  # lognitude 25.5 -1.168 - 0.141
state[5] = np.radians(24.322)  # latitude 42.5 24.322 - 0.077
state[6] = 0  # rollrate
state[7] = 0  # pitchrate
state[8] = 0  # yawrate
state[9] = -np.radians(55)  # angle of attack defined positive downwards
data = np.genfromtxt('spirit_flightpath.csv', delimiter='', dtype=None)
t = data[:, 0] - data[0, 0]
alt = data[:, 2]
gamma = data[:, 1]
lat = data[:, 4]
long = data[:, 6]
ca = data[:, 32]
cn = data[:, 34]
vx = data[:, 18]
vy = data[:, 20]
vz = data[:, 22]
v = np.sqrt(vx**2 + vy**2 + vz**2)
vrel = data[:, 24]
aaxial = data[:, 8]
aradial = data[:, 10]
mars = astro_tools.Planet(scale_height=11.1e3)

state = np.zeros(12)
state[0] = v[0]  # velocity
state[1] = np.radians(-16)  # flight path angle
state[2] = np.radians(86.5)  # heading angle
state[3] = mars.r + 125000  # radius end at 3400300 m 3522200
state[4] = np.radians(340.9)  # lognitude
state[5] = np.radians(-2.9)  # latitude
state[6] = 0  # rollrate
state[7] = 0  # pitchrate
state[8] = 0  # yawrate
state[9] = np.radians(0)  # angle of attack defined positive downwards
state[10] = 0  # sideslip angle
state[11] = np.radians(0)  # bank angle