%auto
#T is in degrees Celsius and A and B are from derived from atmospheric
# conditions to be A = 218 Wm^2 and B = 1.90 W/m^2C
# The value of C to be 10^7J/2.0
# I use some variables as I wanted to test the new symbolic support
var('t Q gamma')
ai = 0.35; af = 0.7
A = 218.0
B = 1.9
# effective heat capacity.
C = 10^7/2.0
# solved for T at equilibrium
T = function('T',t)
# the co-albedo is a function of T
ap(T) = ai + 0.5*(af-ai)*(1 + tanh(gamma*T))
# eq 2.36
bal_eq = C*diff(T,t) == -A - B*T + Q*ap
# solve for steady state
q_eq = solve(bal_eq.rhs() == 0,Q)[0].rhs()
@interact
def coalbedo(gamma_value=(0,1,.1)):
# this is the ap and Q plot.
#ga = graphics_array([qplot,aplot])
#show(qplot + aplot,figsize=5)
plot(ap.substitute(gamma=gamma_value),(T,-50,50),legend_label='$a_p$').show()
plot(q_eq.substitute(gamma=gamma_value),(T,-40,40),color="cyan",legend_label='$Q$').show()
|
|
Click to the left again to hide and once more to show the dynamic interactive window
|