コード例 #1
0
def Geodesic_script():
    # setup the initial conditions
    geo = Geodesic()
    # assume initially a vertical launch from 5 degrees latitude
    radiusE = geo.oblateRadius(5) * 1000

    # launch vehicle
    lv = LaunchVehicle()

    # standard atmosphere (1976) data
    atm = Atmosphere()
    [altList, tempList, pressureList, densityList, asoundList] = atm.stdAtm()

    Area = pow(lv.Rcross,2)*pi
    k = 9.81*pow(geo.a * 1000,2)

    # flight path angle (deg)
    fp = pi/2
    # velocity magnitude /speed (m/s)
    vc = 0
    # altitude above geodesic (m)
    alt = 0

    nu = 0

    # speed of sound (m/s)
    a = np.interp(alt,altList,asoundList)

    # atmospheric density (kg/m^3)
    rho = np.interp(alt,altList,densityList)

    r = radiusE + alt
    r2 = pow(r,2)
    g = k/r2

    m = 2300000
    T = 34020000
    Isp = 400
    theta = 0

    Mach = vc/a
    D = 0.5 * lv.getCd(Mach) * Area * rho * pow(vc,2)

    params = (k, radiusE, altList, asoundList, densityList, Area, lv, Isp, T, theta)

    x0 = [r,m,nu,fp,vc]

    return x0, params