def F(t, y, thetae0, interpTenv, interpTdEnv, interpPress): #y[0] is the velocity, y[1] is the height yp = np.zeros((2,1)) #yp[0] is the buoyancy (acceleration), yp[1] is the velocity yp[0] = calcBuoy(y[1], thetae0, interpTenv, interpTdEnv, interpPress) yp[1] = y[0] return yp
def F(t, y, entrain_rate, interpTenv, interpTdEnv, interpPress): yp = np.zeros((4,1)) velocity = y[0] height = y[1] thetae_cloud = y[2] wT_cloud = y[3] #yp[0] is the acceleration, in this case the buoyancy yp[0] = calcBuoy(height, thetae_cloud, interpTenv, interpTdEnv, interpPress) press = interpPress(height)*100. #Pa Tdenv = interpTdEnv(height) + c.Tc #K Tenv = interpTenv(height) + c.Tc #K wTenv = wsat(Tdenv, press) #kg/kg thetaeEnv = thetaep(Tdenv, Tenv, press) #yp[1] is the rate of change of height yp[1] = velocity #yp[2] is the rate of change of thetae_cloud yp[2] = entrain_rate*(thetaeEnv - thetae_cloud) #yp[3] is the rate of change of wT_cloud yp[3] = entrain_rate*(wTenv - wT_cloud) return yp