{"title":"Week 20","authors":"N. Newton","doi":"10.4324/9780367821968-20","DOIUrl":null,"url":null,"abstract":"of forward Euler To solve dy dt = f (y, t), y(t 0) = y 0 numerically we choose a step length h > 0 and then calculate y 1 = y 0 + hf (y 0 , t 0), t 1 = t 0 + h y 2 = y 1 + hf (y 1 , t 1), t 2 = t 1 + h y 3 = y 2 + hf (y 2 , t 2), t 3 = t 2 + h etc. in which case y i is an approximation to y(t i) at each step. The approximation should get more accurate as h gets smaller. The error at each step will get worse if d 2 y/dt 2 is large and these errors can build up for longer time intervals. 1. We would like to to solve the differential equation dy dt = −10(t − 1)y with the given initial condition: y(0) = e −5. A reference solution to this problem can be plotted in MATLAB by typing the command sequence tt=0:0.01:2; ex=exp(-5*(tt-1).^2);plot(tt,ex,'-k')} (a) Find the analytic solution y(t), and evaluate it at (b) Compute the forward Euler solution by taking seven steps of the method with a step length of h = 0.2. (You will need a calculator to do this.) Generate a table which compare the analytic solution with the numerical solution. At which time t do you find the biggest error ? (c) Compute a more accurate forward Euler solution by taking four steps with a much smaller step length of h = 0.05. Compare this solution with the exact solution y(0.2) and compare the accuracy of this solution with the first time step result obtained in (b). Note that this differential equation is not as benign as it looks; if one wants to solve it over a long time interval, sophisticated numerical methods (like those that are built into MATLAB) are needed. A simple example of a sophisticated method is the implicit Euler method which will be discussed in the lectures. Solution 1. Analytical solution is y(t) = exp(−5(t − 1) 2) Plot of exact solution 1","PeriodicalId":363854,"journal":{"name":"Day-by-Day Math Thinking Routines in Kindergarten","volume":"22 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2020-02-20","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Day-by-Day Math Thinking Routines in Kindergarten","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.4324/9780367821968-20","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0
Abstract
of forward Euler To solve dy dt = f (y, t), y(t 0) = y 0 numerically we choose a step length h > 0 and then calculate y 1 = y 0 + hf (y 0 , t 0), t 1 = t 0 + h y 2 = y 1 + hf (y 1 , t 1), t 2 = t 1 + h y 3 = y 2 + hf (y 2 , t 2), t 3 = t 2 + h etc. in which case y i is an approximation to y(t i) at each step. The approximation should get more accurate as h gets smaller. The error at each step will get worse if d 2 y/dt 2 is large and these errors can build up for longer time intervals. 1. We would like to to solve the differential equation dy dt = −10(t − 1)y with the given initial condition: y(0) = e −5. A reference solution to this problem can be plotted in MATLAB by typing the command sequence tt=0:0.01:2; ex=exp(-5*(tt-1).^2);plot(tt,ex,'-k')} (a) Find the analytic solution y(t), and evaluate it at (b) Compute the forward Euler solution by taking seven steps of the method with a step length of h = 0.2. (You will need a calculator to do this.) Generate a table which compare the analytic solution with the numerical solution. At which time t do you find the biggest error ? (c) Compute a more accurate forward Euler solution by taking four steps with a much smaller step length of h = 0.05. Compare this solution with the exact solution y(0.2) and compare the accuracy of this solution with the first time step result obtained in (b). Note that this differential equation is not as benign as it looks; if one wants to solve it over a long time interval, sophisticated numerical methods (like those that are built into MATLAB) are needed. A simple example of a sophisticated method is the implicit Euler method which will be discussed in the lectures. Solution 1. Analytical solution is y(t) = exp(−5(t − 1) 2) Plot of exact solution 1