paramsNom_O.errtol1 = 0 paramsNom_O.errtol2 = 0 paramsNom_O.dtGdn = 1 # s paramsNom_O.hmin = 3 paramsNom_O.hmax = paramsNom_O.p.halt + 1e-7 paramsNom_O.tf = 6000 # copy generic params for probe and ballistic probe paramsNom_P = copy.deepcopy(paramsNom_O) # ============================================================================= # Orbiter Setup # ============================================================================= # vehicle paramsNom_O.BC = 130 paramsNom_O.A = paramsNom_O.m / (paramsNom_O.BC * paramsNom_O.CD) paramsNom_O.CL = paramsNom_O.CD * paramsNom_O.LD paramsNom_O.Rn = np.sqrt(paramsNom_O.A / np.pi) / 2 # search brackets for Brent's Method paramsNom_O.sig1 = 0 paramsNom_O.sig2 = 180 paramsNom_O.ts1 = 1 paramsNom_O.ts2 = 300 # target state paramsNom_O.raStar = (250 + paramsNom_O.p.rad) * 1e3 paramsNom_O.rpStar = (250 + paramsNom_O.p.rad) * 1e3 # nominal simulation values t0 = 0
paramsNom.p = constants.MARS paramsNom.returnTimeVectors = True ### INPUT ATM TABLE - GET ATM TABLE FROM GRAM DATA FILE paramsNom.dMode = 'table' filename = '../data/dens_Mars_nom.txt' atmdata = np.genfromtxt(filename, names=True) paramsNom.atmdat = np.array([atmdata['Var_X'], atmdata['DENSAV']]) ### VEHICLE PARAMS paramsNom.m = 2920 # kg, roughly MSL mass paramsNom.CD = 1.6 # roughly MSL CD paramsNom.LD = 0.25 paramsNom.BC = 130 paramsNom.A = paramsNom.m / (paramsNom.BC * paramsNom.CD) paramsNom.CL = paramsNom.CD * paramsNom.LD paramsNom.Rn = np.sqrt(paramsNom.A / np.pi) / 2 ### WIND-RELATIVE INITIAL STATE paramsNom.lat = 18.38 paramsNom.lon = -77.58 paramsNom.alt = paramsNom.p.halt paramsNom.efpaWR = -12 paramsNom.hdaWR = 0 paramsNom.vmagWR = 6 ### GET OTHER STATE TYPES (and assume t0 = 0) paramsNom.x0, paramsNom.vInfvec_N = LLAEHV2RV(paramsNom.lat, paramsNom.lon, paramsNom.alt, paramsNom.efpaWR, paramsNom.hdaWR,
# generate input realizations params.efpa_Y = norm.rvs(size = 1).item(0) params.efpaWR = efpamean + efpastd * params.efpa_Y params.vmag_Y = norm.rvs(size = 1).item(0) params.vmagWR = vmagmean + vmagstd * params.vmag_Y params.CD_Y = norm.rvs(size = 1).item(0) params.CD = CDmean + CDstd * params.CD_Y params.m_Y = norm.rvs(size = 1).item(0) params.m = mmean + mstd * params.m_Y params.BC = params.m / (params.CD * Anom) params.A = Anom # run sim print('\nTrial {}'.format(i_trial+1)) outs = Outs() outsList.append(mainAD(params, tspan, events, outs)) paramsList.append(getQoIParams(params)) m_YList.append(params.m_Y) CD_YList.append(params.CD_Y) efpa_YList.append(params.efpa_Y) vmag_YList.append(params.vmag_Y) atm_YsList.append(params.atm_Ys) # every 50 trials, save all results to a file