s07 - Ma 449: Numerical Applied Mathematics Model Solutions...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Ma 449: Numerical Applied Mathematics Model Solutions to Homework Assignment 7 Prof. Wickerhauser Exercise 4 of Section 6.1, p.335. (a) Formula 10 MATLAB code and its output: <>num = [1 -8 0 8 -1]; dx=[-2 -1 0 1 2]; <>x1=2.3*ones(dx) +0.1*dx, f1=exp(x1) X1 = 2.1000 2.2000 2.3000 2.4000 2.5000 F1 = 8.1662 9.0250 9.9742 11.0232 12.1825 <>x01=2.3*ones(dx) +0.01*dx, f01=exp(x01) X01 = 2.2800 2.2900 2.3000 2.3100 2.3200 F01 = 9.7767 9.8749 9.9742 10.0744 10.1757 <>h=0.1; den=12*h; df1=(f1*num')/den; <>long; df1, short; err=df1-exp(2.3) DF1 = 9.974149167936689 ERR = -3.3287E-05 <>h=0.01; den=12*h; df01=(f01*num')/den; <>long; df01, short; err=df01-exp(2.3) DF01 = 9.974182451489710 ERR = -3.3250E-09 (b) Formula 29 MATLAB code and its output: <>x0=2.3; <>h=0.1; <>d2=(exp(x0+2*h)-exp(x0-2*h))/(4*h) D2 = 10.0408 <>d1=(exp(x0+h)-exp(x0-h))/(2*h) D1 = 9.9908 <>fe=(4*d1-d2)/3, err=fe-exp(x0) FE = 9.974149167936696 ERR = -3.3287E-05 <>h=0.01; <>d2=(exp(x0+2*h)-exp(x0-2*h))/(4*h) D2 = 9.9748 <>d1=(exp(x0+h)-exp(x0-h))/(2*h) D1 = 9.9743 <>fe=(4*d1-d2)/3, err=fe-exp(x0) FE = 9.974182451489680 ERR = -3.3250E-09 (c) Using |f'''''(c)| < 12.2, we get |E_d| < h^4 * 12.2 / 30, which is evaluated by MATLAB as follows: <>h=0.1; h4=h*h*h*h; f5=12.2; ed=h4*f5/30 ED = 4.0667E-05 <>h=0.01; h4=h*h*h*h; f5=12.2; ed=h4*f5/30 ED = 4.0667E-09 Exercise 16 of Section 6.1, p.338. (a) Formula 22 in MATLAB, and its output: <> num = [1 -8 0 8 -1]; dh=[-2 -1 0 1 2]; x0=3; h=0.1; x=x0*ones(num)+h*dh; f=[1.02962 1.06471 1.09861 1.13140 1.16315]; long; df=(f*num')/(12*h), short; err= df-1/3 DF = .333324999999999 ERR = -8.3333E-06 h=0.001; x=x0*ones(num)+h*dh;
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
f=[1.09795 1.09828 1.09861 1.09895 1.09928]; long; df=(f*num')/(12*h), short; err= df-1/3 DF = .335833333333443 ERR = .0025 (b) Formula 24 can be estimated as follows: E = E_r + E_d, so |E| <= |E_r| + |E_d|. Now for f(x)=ln(x), we have f''''(x) = 24/x^5, which is no bigger than 24/(x0-2*h)^5 on the interval x-2h<c<x+2h, so we use that value to estimate |f''''(c)| when computing |E_d| <= 24*h^4/(30*(x0-2*h)^5). We are given that |e_k|<= 5*10^{-6}, for all k. E_r from Formula 24 needs e_{-2}, e_{-1}, e_{1}, and e_{2}. These can be estimated with the triangle inequality: |E_r| <= |-e_{-2}+8e_{-1}-8 e_{1}+e_{2}| / (12*h) <= |e_{-2}|+8|e_{-1}|+8|e_{1}|+|e_{2}| / (12*h) <= 18*5*10^{-6} / (12*h) Thus |E| <= 24*h^4/(30*(x0-2*h)^5) + 18*5*10^{-6} / (12*h). We compute this with MATLAB: <>h=0.1; h4=h*h*h*h; x0=3; x=x0-2*h; x5=x*x*x*x*x; <>eps=5e-6; ed = 24*h4/(30*x5), er=18*eps/(12*h), e=ed+er ED = 4.648360802046769E-07 ER = 7.499999999999990E-05 E = 7.546483608020458E-05 <>h=0.001; h4=h*h*h*h; x0=3; x=x0-2*h; x5=x*x*x*x*x; <>eps=5e-6;
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/16/2010 for the course MATH 449 taught by Professor Wickerhauser during the Fall '09 term at Washington University in St. Louis.

Page1 / 7

s07 - Ma 449: Numerical Applied Mathematics Model Solutions...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online