R = 287.04
g = 9.80665

T0 = 288.15
Th = -6.5E-3

rho0 = 1.225
P0 = 101325.0

Tref = 273.15
S = 110.4
mu_ref = 1.716E-5

def temperature(h):
    return T0 + Th * h

def pressure(h):
    return P0 * (1.0 + Th/T0 * h)**(- g / (R * Th))

def density(h):
    return pressure(h) / (R * temperature(h))

def viscosity(h):
    T = temperature(h)
    return mu_ref * (T / Tref)**1.5 * (Tref + S)/(T + S)

if __name__ == "__main__":
    print("{:>10s} {:>10s} {:>10s} {:>10s} {:>15s} {:>15s}".format("h [m]", "T [C]", "T [K]", 'P [Pa]', 'Rho [Kg/m3]', 'Mu [kg/(m s)]'))
    for h in range(0, 11500, 500):
        T = temperature(h)
        P = pressure(h)
        rho = density(h)
        mu = viscosity(h)
        print("{:10g} {:10g} {:10g} {:10g} {:15g} {:15g}".format(h, T - Tref, T, P, rho, mu))
