# Just some draft plots and testing time varying mu. todo:
# Next try to do a bf-plot of this dynamic version
reset()
# Add a function that captures the constants/equations above. returns two functions mu(t) and net radiation
def zg_num(kappa, mu0, tme, ampl, omega):
Q0 = 342.5; c1 = 0.15; c2 = 0.7; m = 0.4; T0= 1.9e-15^(-1/6)
sigma_sb= 5.6697e-8; Tc = 273.0
t,T = var('t,T')
mu = (mu0 + ampl*sin(omega*t))
zgn = mu*(Q0*(1 - (c1 + c2*(1 - tanh(kappa*(T - Tc)))/2.0)) - sigma_sb*T^4 *(1 - m* tanh((T/T0)^6)))
#print "mu(t) = %s"% mu
return mu,zgn
@interact
def sensanalyze(kappa = (0.05,1.0,0.05), mu0 = (0.1,2.5,0.1), tme= (0.1,100.0,.1),omega= (0.0,20.0,.1),ampl = (0.01,5.0,0.05)):
html('<h2 align=center><font color="darkred">Kappa = %g Mu0= %g</font></h2>'%(kappa,mu0))
mu,zg = zg_num(kappa,mu0,tme,ampl,omega)
mup = plot(mu,(t,0,tme),rgbcolor="darkred",ymin=-3,ymax=2,legend_label="Function: $\mu(t)$")
mup.show(axes=True, figsize=[7,2])
# just use line() instead
#bifp = list_plot(zgn(t,T))
mu3d = plot3d(zg,(t,0.,100.),(T,150,370))
mu3d.show(figsize=[7,2])
|
|
Click to the left again to hide and once more to show the dynamic interactive window
|