%% Created by Maple 9.5, Linux
%% Source Worksheet: /var/www/html/mikesullivan/Courses/305/LectureNotes/HeatDisk.mw
%% Generated: Sun Apr 16 12:50:51 CDT 2017
\documentclass{article}
\usepackage{maplestd2e}
\def\emptyline{\vspace{12pt}}
\DefineParaStyle{Maple Heading 4}
\DefineParaStyle{Maple Heading 2}
\DefineParaStyle{Maple Text Output}
\DefineParaStyle{Maple Bullet Item}
\DefineParaStyle{Maple Warning}
\DefineParaStyle{Maple Error}
\DefineParaStyle{Maple Dash Item}
\DefineParaStyle{Maple Heading 3}
\DefineParaStyle{Maple Heading 1}
\DefineParaStyle{Maple Title}
\DefineParaStyle{Maple Normal}
\DefineCharStyle{Maple 2D Input}
\DefineCharStyle{Maple Maple Input}
\DefineCharStyle{Maple 2D Output}
\DefineCharStyle{Maple 2D Math}
\DefineCharStyle{Maple Hyperlink}
\begin{document}
\pagestyle{empty}
\begin{Maple Normal}{\normalsize{Example of heat eq on disk.}}\end{Maple Normal}

\begin{Maple Normal}{\normalsize{}}\end{Maple Normal}
\begin{Maple Normal}{\normalsize{Alpha=1. Boundary = 0 for all time. f(r) = 1-r\symbol{94}2. }}\end{Maple Normal}

\begin{mapleinput}
\mapleinline{active}{1d}{\begin{Maple Normal}\QTR{Maple Maple Input}{}\QTR{Maple Maple Input}{with(plots):}\end{Maple Normal}}{}
\end{mapleinput}

\mapleresult
\begin{maplettyout}
\begin{Maple Warning}{\normalsize{}}\end{Maple Warning}

\end{maplettyout}
\begin{mapleinput}
\mapleinline{active}{1d}{\begin{Maple Normal}\QTR{Maple Maple Input}{}\QTR{Maple Maple Input}{}\end{Maple Normal}}{}
\end{mapleinput}
\begin{mapleinput}
\mapleinline{active}{1d}{\begin{Maple Normal}\QTR{Maple Maple Input}{}\QTR{Maple Maple Input}{f := r -\TEXTsymbol{>} 1-r\symbol{94}2;}\end{Maple Normal}}{}
\end{mapleinput}

\mapleresult
\begin{maplelatex}
\QTR{Maple 2D Output}{\mapleinline{inert}{2d}{f := proc (r) options operator, arrow; 1-r^2 end proc}{%
\[
f\, := \,r\mapsto 1-{r}^{2}
\]
}
}

\end{maplelatex}
\begin{mapleinput}
\mapleinline{active}{1d}{\begin{Maple Normal}\QTR{Maple Maple Input}{}\QTR{Maple Maple Input}{g := n -\TEXTsymbol{>} evalf(BesselJZeros(0,n)); # g(n) is n-th zero of Bessel function Jo. }\end{Maple Normal}}{}
\end{mapleinput}

\mapleresult
\begin{maplelatex}
\QTR{Maple 2D Output}{\mapleinline{inert}{2d}{g := proc (n) options operator, arrow; evalf(BesselJZeros(0, n)) end proc}{%
\[
g\, := \,n\mapsto {\it BesselJZeros} \left(  0.0,n \right) 
\]
}
}

\end{maplelatex}
\begin{mapleinput}
\mapleinline{active}{1d}{\begin{Maple Normal}\QTR{Maple Maple Input}{}\QTR{Maple Maple Input}{c := n -\TEXTsymbol{>} (int(r*f(r)*BesselJ(0,g(n)*r) ,r=0..1))/(int(r*BesselJ(0,g(n)*r)\symbol{94}2 ,r=0..1));}\end{Maple Normal}}{}
\end{mapleinput}

\mapleresult
\begin{maplelatex}
\QTR{Maple 2D Output}{\mapleinline{inert}{2d}{c := proc (n) options operator, arrow; int(r*f(r)*BesselJ(0, g(n)*r), r = 0 .. 1)/int(r*BesselJ(0, g(n)*r)^2, r = 0 .. 1) end proc}{%
$c\, := \,n\mapsto  2.0\, \left( {\frac {{\it BesselJ} \left(  1.0,{\it BesselJZeros} \left(  0.0\\
\mbox{},n \right)  \right) }{{\it BesselJZeros} \left(  0.0,n \right) }}- 8.0\,{\frac { 0.2500000000\, \left( {\it BesselJZeros} \left(  0.0,n \right)  \right) ^{2}\\
\mbox{}{\it BesselJ} \left(  0.0,{\it BesselJZeros} \left(  0.0,n \right)  \right) + 0.2500000000\,{\it BesselJZeros} \left(  0.0,n \right)  \left( - 2.0+ 0.5000000000\, \left( {\it BesselJZeros} \left(  0.0,n \right)  \right) ^{2}\\
\mbox{} \right) {\it BesselJ} \left(  1.0,{\it BesselJZeros} \left(  0.0,n \right)  \right) \\
\mbox{}}{ \left( {\it BesselJZeros} \left(  0.0,n \right)  \right) ^{4}}}\\
\mbox{} \right)  \left( {\it BesselJ} \left(  1.0,{\it BesselJZeros} \left(  0.0,n \right)  \right)  \right) ^{-2}$}
}

\end{maplelatex}
\begin{Maple Normal}{\normalsize{We plot the partial sums together with f(r) to see how good the approximation is. }}\end{Maple Normal}

\begin{mapleinput}
\mapleinline{active}{1d}{\begin{Maple Normal}\QTR{Maple Maple Input}{}\QTR{Maple Maple Input}{N:=1:}\end{Maple Normal}}{}
\end{mapleinput}
\begin{mapleinput}
\mapleinline{active}{1d}{\begin{Maple Normal}\QTR{Maple Maple Input}{}\QTR{Maple Maple Input}{plot([sum(c(n)*BesselJ(0,g(n)*r),n=1..N),1-r\symbol{94}2 ] ,r=0..1,thickness=2,color=[red,blue]);}\end{Maple Normal}}{}
\end{mapleinput}

\mapleresult
\begin{center}
\mapleplot{HeatDiskplot1.eps}


\end{center}
\begin{mapleinput}
\mapleinline{active}{1d}{\begin{Maple Normal}\QTR{Maple Maple Input}{}\QTR{Maple Maple Input}{N:=2:}\end{Maple Normal}}{}
\end{mapleinput}
\begin{mapleinput}
\mapleinline{active}{1d}{\begin{Maple Normal}\QTR{Maple Maple Input}{}\QTR{Maple Maple Input}{plot([sum(c(n)*BesselJ(0,g(n)*r),n=1..N),1-r\symbol{94}2 ] ,r=0..1,thickness=2,color=[red,blue]);}\end{Maple Normal}}{}
\end{mapleinput}

\mapleresult
\begin{center}
\mapleplot{HeatDiskplot2.eps}


\end{center}
\begin{mapleinput}
\mapleinline{active}{1d}{\begin{Maple Normal}\QTR{Maple Maple Input}{}\QTR{Maple Maple Input}{N:=3:}\end{Maple Normal}}{}
\end{mapleinput}
\begin{mapleinput}
\mapleinline{active}{1d}{\begin{Maple Normal}\QTR{Maple Maple Input}{}\QTR{Maple Maple Input}{plot([sum(c(n)*BesselJ(0,g(n)*r),n=1..N),1-r\symbol{94}2 ] ,r=0..1,thickness=2,color=[red,blue]);}\end{Maple Normal}}{}
\end{mapleinput}

\mapleresult
\begin{center}
\mapleplot{HeatDiskplot3.eps}


\end{center}
\begin{mapleinput}
\mapleinline{active}{1d}{\begin{Maple Normal}\QTR{Maple Maple Input}{}\QTR{Maple Maple Input}{N:=5:}\end{Maple Normal}}{}
\end{mapleinput}
\begin{mapleinput}
\mapleinline{active}{1d}{\begin{Maple Normal}\QTR{Maple Maple Input}{}\QTR{Maple Maple Input}{plot([sum(c(n)*BesselJ(0,g(n)*r),n=1..N),1-r\symbol{94}2 ] ,r=0..1,thickness=2,color=[red,blue]);}\end{Maple Normal}}{}
\end{mapleinput}

\mapleresult
\begin{center}
\mapleplot{HeatDiskplot4.eps}


\end{center}
\begin{Maple Normal}{\normalsize{Looks pretty good! But, watch what happens when we graph from r=0 to 5.}}\end{Maple Normal}

\begin{Maple Normal}{\normalsize{}}\end{Maple Normal}
\begin{mapleinput}
\mapleinline{active}{1d}{\begin{Maple Normal}\QTR{Maple Maple Input}{}\QTR{Maple Maple Input}{plot([sum(c(n)*BesselJ(0,g(n)*r),n=1..N),1-r\symbol{94}2 ] ,r=0..5,thickness=2,color=[red,blue]);}\end{Maple Normal}}{}
\end{mapleinput}

\mapleresult
\begin{center}
\mapleplot{HeatDiskplot5.eps}


\end{center}
\begin{mapleinput}
\mapleinline{active}{1d}{\begin{Maple Normal}\QTR{Maple Maple Input}{}\QTR{Maple Maple Input}{ }\end{Maple Normal}}{}
\end{mapleinput}
\begin{Maple Normal}{\normalsize{Yikes!. Fortunately we only care about r=0 to 1.}}\end{Maple Normal}

\begin{Maple Normal}{\normalsize{}}\end{Maple Normal}
\begin{Maple Normal}{\normalsize{Now let's plot (r,t) for r=0 to 1 for serval values of t. Alpha is set to 1.}}\end{Maple Normal}

\begin{mapleinput}
\mapleinline{active}{1d}{\begin{Maple Normal}\QTR{Maple Maple Input}{}\QTR{Maple Maple Input}{N:=10:t:=0.01:}\end{Maple Normal}}{}
\end{mapleinput}
\begin{mapleinput}
\mapleinline{active}{1d}{\begin{Maple Normal}\QTR{Maple Maple Input}{}\QTR{Maple Maple Input}{plot(sum(c(n)*BesselJ(0,g(n)*r)*exp(-g(n)\symbol{94}2*t),n=1..N) ,r=0..1,thickness=2,color=red,view=0..1);}\end{Maple Normal}}{}
\end{mapleinput}

\mapleresult
\begin{center}
\mapleplot{HeatDiskplot6.eps}


\end{center}
\begin{mapleinput}
\mapleinline{active}{1d}{\begin{Maple Normal}\QTR{Maple Maple Input}{}\QTR{Maple Maple Input}{t:=0.02:}\end{Maple Normal}}{}
\end{mapleinput}
\begin{mapleinput}
\mapleinline{active}{1d}{\begin{Maple Normal}\QTR{Maple Maple Input}{}\QTR{Maple Maple Input}{plot(sum(c(n)*BesselJ(0,g(n)*r)*exp(-g(n)\symbol{94}2*t),n=1..N) ,r=0..1,thickness=2,color=red,view=0..1);}\end{Maple Normal}}{}
\end{mapleinput}

\mapleresult
\begin{center}
\mapleplot{HeatDiskplot7.eps}


\end{center}
\begin{mapleinput}
\mapleinline{active}{1d}{\begin{Maple Normal}\QTR{Maple Maple Input}{}\QTR{Maple Maple Input}{t:=0.05:}\end{Maple Normal}}{}
\end{mapleinput}
\begin{mapleinput}
\mapleinline{active}{1d}{\begin{Maple Normal}\QTR{Maple Maple Input}{}\QTR{Maple Maple Input}{plot(sum(c(n)*BesselJ(0,g(n)*r)*exp(-g(n)\symbol{94}2*t),n=1..N) ,r=0..1,thickness=2,color=red,view=0..1);}\end{Maple Normal}}{}
\end{mapleinput}

\mapleresult
\begin{center}
\mapleplot{HeatDiskplot8.eps}


\end{center}
\begin{mapleinput}
\mapleinline{active}{1d}{\begin{Maple Normal}\QTR{Maple Maple Input}{}\QTR{Maple Maple Input}{t:=0.1:}\end{Maple Normal}}{}
\end{mapleinput}
\begin{mapleinput}
\mapleinline{active}{1d}{\begin{Maple Normal}\QTR{Maple Maple Input}{}\QTR{Maple Maple Input}{plot(sum(c(n)*BesselJ(0,g(n)*r)*exp(-g(n)\symbol{94}2*t),n=1..N) ,r=0..1,thickness=2,color=red,view=0..1);}\end{Maple Normal}}{}
\end{mapleinput}

\mapleresult
\begin{center}
\mapleplot{HeatDiskplot9.eps}


\end{center}
\begin{mapleinput}
\mapleinline{active}{1d}{\begin{Maple Normal}\QTR{Maple Maple Input}{}\QTR{Maple Maple Input}{t:=0.2:}\end{Maple Normal}}{}
\end{mapleinput}
\begin{mapleinput}
\mapleinline{active}{1d}{\begin{Maple Normal}\QTR{Maple Maple Input}{}\QTR{Maple Maple Input}{plot(sum(c(n)*BesselJ(0,g(n)*r)*exp(-g(n)\symbol{94}2*t),n=1..N) ,r=0..1,thickness=2,color=red,view=0..1);}\end{Maple Normal}}{}
\end{mapleinput}

\mapleresult
\begin{center}
\mapleplot{HeatDiskplot10.eps}


\end{center}
\begin{mapleinput}
\mapleinline{active}{1d}{\begin{Maple Normal}\QTR{Maple Maple Input}{}\QTR{Maple Maple Input}{t:=0.3:}\end{Maple Normal}}{}
\end{mapleinput}
\begin{mapleinput}
\mapleinline{active}{1d}{\begin{Maple Normal}\QTR{Maple Maple Input}{}\QTR{Maple Maple Input}{plot(sum(c(n)*BesselJ(0,g(n)*r)*exp(-g(n)\symbol{94}2*t),n=1..N) ,r=0..1,thickness=2,color=red,view=0..1);}\end{Maple Normal}}{}
\end{mapleinput}

\mapleresult
\begin{center}
\mapleplot{HeatDiskplot11.eps}


\end{center}
\begin{mapleinput}
\mapleinline{active}{1d}{\begin{Maple Normal}\QTR{Maple Maple Input}{}\QTR{Maple Maple Input}{t:=1.0:}\end{Maple Normal}}{}
\end{mapleinput}
\begin{mapleinput}
\mapleinline{active}{1d}{\begin{Maple Normal}\QTR{Maple Maple Input}{}\QTR{Maple Maple Input}{plot(sum(c(n)*BesselJ(0,g(n)*r)*exp(-g(n)\symbol{94}2*t),n=1..N) ,r=0..1,thickness=2,color=red,view=0..1);}\end{Maple Normal}}{}
\end{mapleinput}

\mapleresult
\begin{center}
\mapleplot{HeatDiskplot12.eps}


\end{center}
\begin{mapleinput}
\mapleinline{active}{1d}{\begin{Maple Normal}\QTR{Maple Maple Input}{}\QTR{Maple Maple Input}{}\end{Maple Normal}}{}
\end{mapleinput}

\end{document}
%% End of Maple 9.5 Output