Assignment 1AMME2000/BMET2960Engineering Analysis/Biomedical Engineering 2SID: 480225063Semester 1, 2019Tutorial Time: Friday 9am - 11amTutorial Room: Chem Eng Lecture Room 21
Contents1Taylor Series Approximations31.1First Derivative off(x). . . . . . . . . . . . . . . . . . . . . . . . . . . . .31.2Taylor Expansion of Difference Stencils. . . . . . . . . . . . . . . . . . . . .31.3Plotting Difference Stencils Compared to the AnalyticSolution. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .51.4Euclidean Norm of Errors in Respect toΔx. . . . . . . . . . . . . . . . . .82Heat Equation using Fourier Series102.1Heat Equation ast→ ∞. . . . . . . . . . . . . . . . . . . . . . . . . . . .102.2Deriving the Temporal Solution and the Overall Solution toT(x, t). . . . .102.3Formulating the Final Solution ofT(x, t). . . . . . . . . . . . . . . . . . .112.4PlottingT(x, t)witht= 0andt= 0.1and Finding Time Within 10% ofthe Equilibrium atx= 0. . . . . . . . . . . . . . . . . . . . . . . . . . . .132.5Plotting Different and Finding Optimala. . . . . . . . . . . . . . . . . . .143Appendix163.1Appendix A: Matlab Code for Subsection 1.3. . . . . . . . . . . . . . . . . .173.2Appendix B: Matlab Code for Subsection 1.4 - Plotting the log-log plot ofL2-norm againstΔx. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .193.3Appendix C: Matlab Code for Subsection 2.4 - PlottingT(x,0)andT(x,0.1)223.4Appendix D: Matlab Code for Subsection 2.4 - FindingtwhenT(0, t) =110% of the steady state. . . . . . . . . . . . . . . . . . . . . . . . . . . . .233.5Appendix E: Matlab Code for Subsection 2.5 - Plotting T(x,0.2) with varyinga243.6Appendix F: Matlab Code for Subsection 2.5 - Finding optimalasuch thattemperature reaches2oC beforet= 0.1s. . . . . . . . . . . . . . . . . . .252
1Taylor Series Approximations1.1First Derivative off(x)Sinceddxcos(2x) =-2 sin(2x)andddxsin(x)-12x2= cos(x)-xf(x) = cos(2x) (sin(x)-12x2)=⇒f0(x) =ddxcos(2x)sin(x)-12x2+ cos(2x)ddxsin(x)-12x2=-2 sin(2x)sin(x)-12x2+ cos(2x)(cos(x)-x)= cos(2x)(cos(x)-x)-2 sin(2x)sin(x)-12x21.2Taylor Expansion of Difference StencilsFor simplicity, let’s allow the notationf(xi+n)≡fi+nsuch thatn∈ZUsing Taylor Series expansion of the basic functions centered atx=xiup to the 5thderivativefi+1=fi+dfdxx=xiΔx+12!d2fdx2x=xi(Δx)2+13!d3fdx3x=xi(Δx)3+· · ·+15!d5fdx5x=xi(Δx)5∵(xi+1-xi= Δx)Similarly,fi-1=fi-dfdxx=xiΔx+12!d2fdx2x=xi(Δx)2-13!d3fdx3x=xi(Δx)3+· · · -15!d5fdx5x=xi(Δx)5∵(xi-1-xi=-Δx)fi+2=fi+dfdxx=xi2Δx+12!d2fdx2x=xi(2Δx)2+13!d3fdx3x=xi(2Δx)3+· · ·+15!d5fdx5x=xi(2Δx)5∵(xi+2-xi= 2Δx)3
∴fi+2=fi+ 2dfdxx=xiΔx+42!d2fdx2x=xi(Δx)2+83!d3fdx3x=xi(Δx)3+· · ·+325!d5fdx5x=xi(Δx)5Similarly,fi-2=fi+dfdxx=xi(-2Δx)+12!d2fdx2x=xi(2Δx)2+13!d3fdx3x=xi(-2Δx)3+· · ·+15!d5fdx5x=xi(-2Δx)5∵(xi-2-xi=-2Δx)∴fi-2=fi-2dfdxx=xiΔx+42!d2fdx2x=xi(Δx)2-83!d3fdx3x=xi(Δx)3+· · · -325!d5fdx5x=xi(Δx)5Computing the four point forward difference stencil1f+x(xi)≈-fi+2+ 6fi+1-3fi-2fi-16Δx=6dfdxx=xiΔx-124!d4fdx4x=xi(Δx)4-245!d5fdx5x=xi(Δx)56Δx=dfdxx=xi-(Δx)312d4fdx4x=xi-(Δx)430d5fdx5x=xi(1)Hence the leading order error for this stencil is denoted asO((Δx)3) =-(Δx)312d4fdx4x=xiComputing the four point backward difference stencil1f-x(xi)≈2fi+1+ 3fi-6fi-1+fi-26Δx=6dfdxx=x