<?xml version="1.0" encoding="UTF-8"?>
<Worksheet><Version major="6" minor="1"/><View-Properties><Zoom percentage="100"/></View-Properties><Styles><Layout alignment="left" bullet="none" firstindent="0.0" leftmargin="0.0" linebreak="space" linespacing="0.0" name="Normal" rightmargin="0.0" spaceabove="0.0" spacebelow="0.0"/><Font background="[255,255,255]" bold="true" executable="true" family="Monospaced" foreground="[255,0,0]" italic="false" name="Maple Input" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false"/></Styles><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">restart; with(plots):</Font></Text-field></Group><Group><Text-field layout="Normal"><Font background="[0,0,0]" bold="true" executable="false" family="Lucida Bright" foreground="[0,0,0]" italic="false" size="20" subscript="false" superscript="false" underline="false">Earth's heat balance</Font></Text-field><Text-field layout="Normal"/><Text-field layout="Normal"><Font background="[0,0,0]" bold="false" executable="false" family="Lucida Bright" foreground="[0,0,0]" italic="false" size="12" subscript="false" superscript="false" underline="false">define system...</Font></Text-field></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">f := T -&gt; -epsilon*(T+273)^4+w(T)*cos(theta);</Font></Text-field></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">w := T -&gt; a+b*erf(c*T);</Font></Text-field></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">df := simplify(D(f));</Font></Text-field></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">a := 4.4e9; b := 1.3e9; c := .2; epsilon := .5;</Font></Text-field></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">plot([w(T)], T = -30 .. 30, labels = (["T", "w(T)"]));</Font></Text-field></Group><Group><Text-field layout="Normal"><Font background="[0,0,0]" bold="false" executable="false" family="Lucida Bright" foreground="[0,0,0]" italic="false" size="12" subscript="false" superscript="false" underline="false">determine fixed points</Font></Text-field></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">theta := 0;</Font></Text-field></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">plot([f(T)], T = -60 .. 60, labels = (["T", "dT/dt"]));</Font></Text-field></Group><Group><Text-field layout="Normal"><Font background="[0,0,0]" bold="false" executable="false" family="Lucida Bright" foreground="[0,0,0]" italic="false" size="12" subscript="false" superscript="false" underline="false">only one fixed point</Font></Text-field></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">fp[1] := fsolve(f(T) = 0, T = 50);</Font></Text-field></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">sigma[1] := evalf(df(fp[1]));</Font></Text-field></Group><Group><Text-field layout="Normal"><Font background="[0,0,0]" bold="false" executable="false" family="Lucida Bright" foreground="[0,0,0]" italic="false" size="12" subscript="false" superscript="false" underline="false">So T = 53.7C is stable</Font></Text-field></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">theta := 1/4*Pi;</Font></Text-field></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">plot([f(T)], T = -60 .. 60, labels = (["T", "dT/dt"]));</Font></Text-field></Group><Group><Text-field layout="Normal"><Font background="[0,0,0]" bold="false" executable="false" family="Lucida Bright" foreground="[0,0,0]" italic="false" size="12" subscript="false" superscript="false" underline="false">three fixed points</Font></Text-field></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">fp[1] := fsolve(f(T) = 0, T = -50);</Font></Text-field></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">fp[2] := fsolve(f(T) = 0, T = 0);</Font></Text-field></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">fp[3] := fsolve(f(T) = 0, T = 50);</Font></Text-field></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">sigma[1] := evalf(df(fp[1]));</Font></Text-field></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">sigma[2] := evalf(df(fp[2]));</Font></Text-field></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">sigma[3] := evalf(df(fp[3]));</Font></Text-field></Group><Group><Text-field layout="Normal"><Font background="[0,0,0]" bold="false" executable="false" family="Lucida Bright" foreground="[0,0,0]" italic="false" size="12" subscript="false" superscript="false" underline="false">So: T = -15.6C is stable, T=-2.1C unstable, T = 26.6C is stable</Font></Text-field><Text-field layout="Normal"><Font background="[0,0,0]" bold="false" executable="false" family="Lucida Bright" foreground="[0,0,0]" italic="false" size="12" subscript="false" superscript="false" underline="false">The domains of attraction are:</Font></Text-field><Text-field layout="Normal"><Font background="[0,0,0]" bold="false" executable="false" family="Lucida Bright" foreground="[0,0,0]" italic="false" size="12" subscript="false" superscript="false" underline="false">fp[1]: -273C &lt;= T &lt; fp[2]</Font></Text-field><Text-field layout="Normal"><Font background="[0,0,0]" bold="false" executable="false" family="Lucida Bright" foreground="[0,0,0]" italic="false" size="12" subscript="false" superscript="false" underline="false">fp[2]: empty</Font></Text-field><Text-field layout="Normal"><Font background="[0,0,0]" bold="false" executable="false" family="Lucida Bright" foreground="[0,0,0]" italic="false" size="12" subscript="false" superscript="false" underline="false">fp[3]: fp[2] &lt; T &lt; infinity</Font></Text-field></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">theta := 1/3*Pi;</Font></Text-field></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">plot([f(T)], T = -60 .. 60, labels = (["T", "dT/dt"]));</Font></Text-field></Group><Group><Text-field layout="Normal"><Font background="[0,0,0]" bold="false" executable="false" family="Lucida Bright" foreground="[0,0,0]" italic="false" size="12" subscript="false" superscript="false" underline="false">only one fixed point</Font></Text-field></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">fp[1] := fsolve(f(T) = 0, T = 50);</Font></Text-field></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">sigma[1] := evalf(df(fp[1]));</Font></Text-field></Group><Group><Text-field layout="Normal"><Font background="[0,0,0]" bold="false" executable="false" family="Lucida Bright" foreground="[0,0,0]" italic="false" size="12" subscript="false" superscript="false" underline="false">So T=-37 C is stable</Font></Text-field><Text-field layout="Normal"/></Group><Group><Text-field layout="Normal"><Font background="[0,0,0]" bold="false" executable="false" family="Lucida Bright" foreground="[0,0,0]" italic="false" size="12" subscript="false" superscript="false" underline="false">Potential Function: we determine V(x)  such that dV/dx=-f(x):</Font></Text-field></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">theta := 1/4*Pi;</Font></Text-field></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">V := unapply(-int(f(T), T), T);</Font></Text-field></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">plot([V(T)], T = -60 .. 60, labels = (["T", "V(T)"]));</Font></Text-field></Group><Group><Text-field layout="Normal"/><Text-field layout="Normal"><Font background="[0,0,0]" bold="false" executable="false" family="Lucida Bright" foreground="[0,0,0]" italic="false" size="12" subscript="false" superscript="false" underline="false">Evolution in time for two initial conditions</Font></Text-field><Text-field layout="Normal"/></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">epsilon := 'epsilon'; theta := 'theta';</Font></Text-field></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">eq := diff(T(t), t) = f(T(t));</Font></Text-field></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">epsilon := .5; theta := 1/4*Pi;</Font></Text-field></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">ic1 := T(0) = 100;</Font></Text-field></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">ic2 := T(0) = -100;</Font></Text-field></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">sol1 := dsolve({ic1, eq}, T(t), type = numeric);</Font></Text-field></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">sol2 := dsolve({eq, ic2}, T(t), type = numeric);</Font></Text-field></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">tinf := 1e-6;</Font></Text-field></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">pl1 := odeplot(sol1, [t, T(t)], 0 .. tinf, color = red, legend = "hot");</Font></Text-field></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">pl2 := odeplot(sol2, [t, T(t)], 0 .. tinf, color = blue, legend = "cold");</Font></Text-field></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">display(pl1, pl2, labels = (["t", "T[C]"]));</Font></Text-field></Group><Group><Text-field layout="Normal"/><Text-field layout="Normal"><Font background="[0,0,0]" bold="false" executable="false" family="Lucida Bright" foreground="[0,0,0]" italic="false" size="12" subscript="false" superscript="false" underline="false">equilibrium solutions as a function theta</Font></Text-field><Text-field layout="Normal"/></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">thetamin := 0.0;</Font></Text-field></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">thetamax := Pi/2;</Font></Text-field></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">n := 50;</Font></Text-field></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">tinf := 1e-6;</Font></Text-field></Group><Group><Text-field layout="Normal"><Font background="[0,0,0]" bold="false" executable="false" family="Lucida Bright" foreground="[0,0,0]" italic="false" size="12" subscript="false" superscript="false" underline="false">loop...</Font></Text-field></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">bif1 := NULL: bif2 := NULL:</Font></Text-field></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">for i from 0 to n do</Font></Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">  theta := thetamin + i*(thetamax-thetamin)/n:</Font></Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">  sol1 := dsolve({eq,ic1},T(t), type=numeric);</Font></Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">  sol2 := dsolve({eq,ic2},T(t), type=numeric);</Font></Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">  T1 := subs(sol1(tinf),T(t));</Font></Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">  T2 := subs(sol2(tinf),T(t));</Font></Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">  bif1 := bif1, [theta/Pi*180, T1]:</Font></Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">  bif2 := bif2, [theta/Pi*180, T2]:</Font></Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">od:</Font></Text-field></Group><Group><Text-field layout="Normal"><Font background="[0,0,0]" bold="false" executable="false" family="Lucida Bright" foreground="[0,0,0]" italic="false" size="12" subscript="false" superscript="false" underline="false">plot...</Font></Text-field></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">pl1 := plot([bif1],labels=["theta","T[C]"],legend="hot branch",color=red):</Font></Text-field></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">pl2 := plot([bif2],labels=["theta","T[C]"],legend="cold branch",color=blue):</Font></Text-field></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">display(pl1,pl2);</Font></Text-field></Group><Group><Text-field layout="Normal"><Font background="[0,0,0]" bold="false" executable="false" family="Lucida Bright" foreground="[0,0,0]" italic="false" size="12" subscript="false" superscript="false" underline="false">To get an indication of the critical theta values we look at the graphs of f(T)</Font></Text-field></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">theta := 'theta';</Font></Text-field></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">plot([subs(theta = (38*Pi)*(1/180), f(T)), subs(theta = (57*Pi)*(1/180), f(T))], T = -40 .. 40,legend = (["theta=38", "theta=57"]));</Font></Text-field></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">soltheta1 := fsolve({f(T)=0,df(T)=0},{T=-5,theta=38*Pi/180});</Font></Text-field></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">soltheta2 := fsolve({f(T)=0,df(T)=0},{T=8,theta=57*Pi/180});</Font></Text-field></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">thetacrit[1] := evalf(180*subs(soltheta1, theta)/Pi);</Font></Text-field></Group><Group><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font background="[0,0,0]">thetacrit[2] := evalf(180*subs(soltheta2, theta)/Pi);</Font></Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"/></Group><Text-field/></Worksheet>