def plot_rt_vs_theta_alpha(p, T, r, rl, alpha):
    theta_l = thermo.theta_l(p, T, r, rl)
    theta_e = thermo.theta_e(p, T, r, rl)
    theta_alpha = (1. - alpha) * theta_l + alpha * theta_e
    rt = r + rl

    ax = subplot(1, 1, 1)
    ax.plot(theta_alpha, rt * 1000)

    yl = ax.get_ylim()
    if yl[0] < yl[1]: ax.set_ylim([yl[1], yl[0]])
Example #2
0
def plot_rt_vs_theta_alpha(p, T, r, rl, alpha):
    theta_l = thermo.theta_l(p, T, r, rl)
    theta_e = thermo.theta_e(p, T, r, rl)
    theta_alpha = (1. - alpha)*theta_l + alpha*theta_e
    rt = r + rl
    
    ax = subplot(1,1,1)
    ax.plot(theta_alpha, rt*1000)
    
    yl = ax.get_ylim()
    if yl[0] < yl[1]: ax.set_ylim([yl[1], yl[0]])
Example #3
0
def Tfind(Tguess, p, theta_l, rt):
    # due to the check in invert_theta_l, we can assume that r = r_star.
    # However, we don't know the exact value of r_star because we don't know T.
    r = thermo.r_star(p, Tguess)
    rl = rt - r
    return theta_l - thermo.theta_l(p, Tguess, r, rl)
Example #4
0
def plot_rt_vs_theta_l(p, T, r, rl):
    rt = r + rl
    theta_l = thermo.theta_l(p, T, r, rl)
    plot(theta_l, rt*1000)
Example #5
0
def plot_rt_vs_theta_l(p, T, r, rl):
    rt = r + rl
    theta_l = thermo.theta_l(p, T, r, rl)
    plot(theta_l, rt * 1000)
Example #6
0
def Tfind(Tguess, p, theta_l, rt):
    # due to the check in invert_theta_l, we can assume that r = r_star.
    # However, we don't know the exact value of r_star because we don't know T.
    r = thermo.r_star(p, Tguess)
    rl = rt - r
    return theta_l - thermo.theta_l(p, Tguess, r, rl)