Example: confidence

Local Truncation Error

R. Mark ProsserCS 370 Local Truncation ErrorThelocal Truncation Error (LTE) of a numerical method is an estimate of the errorintroduced in a single iteration of the method, assuming that everything fed into the methodwas perfectly accurate. Recall thaty1,y2,..,yNrefer to the numerically computed valuesandy(t1),y(t2),..,y(tN)refer to the corresponding exact values (so thatyn y(tn)). Todetermine the Local Truncation Error , analyse a general iteration of a method where the valueyn+1is computed. We want to determine the difference,LTE=y(tn+1) yn+1based on the assumption thatyn+1is determined from exact information. That is, if we havea method of the formyn+1= (tn,yn,f,h)where represents the formula for the numerical method, then we are going to assume thatyn=y(tn), +1= (tn,y(tn),f,h)and, having made this assumption, we are going to examine the differencey(tn+1) yn+1which we call the Local Truncation :1.

+O(h) h2 2 +O(h3) = y(t n)+y0(t n)h+(y0(t n+1) y0(t n)) h 2 +O(h3)+O(h3) = y(t n)+ h 2 (y 0(t n)+y(t n+1))+O(h3) Finally, since y0(t) = f(t;y(t)), we have y(t n+1) = y(t n)+ h 2 (f(t n;y(t n))+f(t n+1;y(t n+1)))+ O(h3) (1) from which we get the Trapezoidal method. The terms on the right-hand side, other than the O(h3) term, are what you would ...

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of Local Truncation Error

1 R. Mark ProsserCS 370 Local Truncation ErrorThelocal Truncation Error (LTE) of a numerical method is an estimate of the errorintroduced in a single iteration of the method, assuming that everything fed into the methodwas perfectly accurate. Recall thaty1,y2,..,yNrefer to the numerically computed valuesandy(t1),y(t2),..,y(tN)refer to the corresponding exact values (so thatyn y(tn)). Todetermine the Local Truncation Error , analyse a general iteration of a method where the valueyn+1is computed. We want to determine the difference,LTE=y(tn+1) yn+1based on the assumption thatyn+1is determined from exact information. That is, if we havea method of the formyn+1= (tn,yn,f,h)where represents the formula for the numerical method, then we are going to assume thatyn=y(tn), +1= (tn,y(tn),f,h)and, having made this assumption, we are going to examine the differencey(tn+1) yn+1which we call the Local Truncation :1.

2 Replace all approximations ( ) on the right-hand side of the method with theirexact counterparts ( (tn)). This gives an expression foryn+1as determined bythe method, assuming all inputs are exactly Taylor-expand everything that isn ty(tn)in the right-hand side (from step 1).3. Taylor-expand the exact valuey(tn+1).4. Subtract the expanded form of the approximationyn+1(from step 2) from the expandedform of the exact valuey(tn)(from step 3) to get the Local Truncation Error :LTE=y(tn+1) yn+ all goes well, things will simplify and cancel out so you ll just be left with an upperbound on the Error in big-O Euler:yn+1=yn+hf(tn,yn)This is a simple case where the method is based on a first order Taylor expansion. Assumingyn=y(tn)we haveyn+1=y(tn) +hf(tn,y(tn))=y(tn) +hy (tn)since we are solving the ODEy (t) =f(t,y(t)). Taylor s expansion of the exact value isy(tn+1) =y(tn) +hy (tn) +O(h2).

3 So the Local Truncation Error isy(tn+1) yn+1=O(h2).Trapezoidal (Crank-Nicolson):yn+1=yn+h2(f(tn,yn) +f(tn+1,yn+1))Assume all the inputs to the method are exactly correct:yn+1=y(tn) +h2(f(tn,y(tn)) +f(tn+1,y(tn+1)))Following the approach described previously, we need to Taylor-expand the termf(tn+1,y(tn+1)).Well, sincef(tn+1,y(tn+1)) =y (tn+1), we will apply Taylor s expansion to the derivativey (tn+1):y (tn+1) =y (tn) +y (tn)h+O(h2)Then (again, sincey (t) =f(t,y(t))) we haveyn+1=y(tn) +h2(y (tn) +y (tn) +y (tn)h+O(h2)))yn+1=y(tn) +hy (tn) +y (tn)h22+O(h3)sinceh2 O(h2) =O(h3).The Taylor series expansion of the exact valuey(tn+1)isy(tn+1) =y(tn) +y (tn)h+y (tn)h22+O(h3).So the Local Truncation Error isy(tn+1) yn+1=O(h3). 2 Another way to show the Local Truncation Error for this method is to derive it, keepingtrack of the remainder terms as we go along.

4 Once the numerical formula is derived, whatevererror terms are left hanging around in the end will be the Local Truncation Error . The ideawas to start with a second order Taylor expansion:y(tn+1) =y(tn) +y (tn)h+y (tn)h22+O(h3)and then use a slope approximation for the second derivativey (tn) =y (tn+1) y (tn)h+O(h).Putting them together, we havey(tn+1) =y(tn) +y (tn)h+(y (tn+1) y (tn)h+O(h))h22+O(h3)=y(tn) +y (tn)h+ (y (tn+1) y (tn))h2+O(h3) +O(h3)=y(tn) +h2(y (tn) +y (tn+1)) +O(h3)Finally, sincey (t) =f(t,y(t)), we havey(tn+1) =y(tn) +h2(f(tn,y(tn)) +f(tn+1,y(tn+1))) +O(h3)(1)from which we get the Trapezoidal method. The terms on the right-hand side, other thantheO(h3)term, are what you would get from the method (yn+1) if the inputs were exactlycorrect. +1=y(tn) +h2(f(tn,y(tn)) +f(tn+1,y(tn+1))).So this shows thaty(tn+1) yn+1=O(h3).

5 Modified Euler:y n+1=yn+hf(tn,yn)yn+1=yn+h2(f(tn,yn) +f(tn+1,y n+1))We have seen that Forward Euler hasO(h2) Local Truncation Error . So ify n+1=y(tn) +hf(tn,y(tn))theny(tn+1) y n+1=O(h2).Now, for the trapezoidal step, we will assume that the inputs on the right-hand side are allexact except fory n+1, because that was computed as part of the method and we need toaddress the the Error in the forward Euler step in our analysis. But we have assumed thatthe inputs to the forward Euler step, which producedy n+1, were all exact. So we haveyn+1=y(tn) +h2(f(tn,y(tn)) +f(tn+1,y n+1))(2)3To reiterate, we are assuming exact inputs in the forward Euler step to gety n+1, and we areusing that in the trapezoidal step and assuming exact inputs for the rest of the , recall that we had an expression for the exact value (equation (1)), from which thetrapezoidal method was derived:y(tn+1) =y(tn) + (f(tn,y(tn)) +f(tn+1,y(tn+1)))h2+O(h3)(3)Now now we want to expand thef(tn+1,y(tn+1))term in order to relate it tof(tn+1,y n+1).

6 Writing it as the first derivativey (tn+1)isn t helpful here because we are dealing with achange with respect to theyvariable (nott). Here is where the Taylor series expansion forfunctions of two variables is useful. In this case, the delta in the first variabletis 0, and weare expanding about the point(t,y) = (tn+1,y n+1)with the delta in the second variablebeingy(tn+1) y n+1:f(tn+1,y(tn+1)) =f(tn+1,y n+1) +fy(tn+1,y n+1)(y(tn+1) y n+1) +O((y(tn+1) y n+1)2)Sincey(tn+1) y n+1=O(h2)(the Local Truncation Error of the forward Euler step) we cansay that1fy(tn+1,y n+1)(y(tn+1) y n+1) =O(h2).And sinceO((y(tn+1) y n+1)2) =O((h2)2) =O(h4)we havef(tn+1,y(tn+1)) =f(tn+1,y n+1) +O(h2)(the lower-order termO(h2)dominates whenh 0).Finally, bringing this back to (3) we havey(tn+1) =y(tn) +h2(f(tn,y(tn)) +f(tn+1,y n+1) +O(h2))+O(h3)y(tn+1) =y(tn) +h2(f(tn,y(tn)) +f(tn+1,y n+1))+O(h3)and subtracting (2) from this givesy(tn+1) yn+1=O(h3).

7 1Of course, by eliminatingfy(tn+1, y n+1) we are losing some information here, but when multipliedby something of orderh2(which is very small) it does not contribute much to the result. Rememberthat this is the same thing we did when replacing the remainder term of apth-order Taylor expansionwithO(h(p+1)).4


Related search queries