1 compute the error I f T h f for h 1 10 1 20 1 40 and verify that T h has a

1 compute the error i f t h f for h 1 10 1 20 1 40

This preview shows page 1 - 2 out of 2 pages.

1
4. Consider the definite integralI[e-x2] =Z10e-x2dx,(3)We cannot calculate its exact value but we can compute accurate approximations to it usingTh[e-x2]. Letq(h) =Th/2[e-x2]-Th[e-x2]Th/4[e-x2]-Th/2[e-x2].(4)Using your code, find a value of h for whichq(h) is approximately equal to 4.(a) Get anapproximationof the error,I[e-x2]-Th[e-x2], for that particular value ofh.(b) Use thiserror approximation to obtain theextrapolated, improved, approximationSh[e-x2] =Th[e-x2] +43Th/2[e-x2]-Th[e-x2].(5)Explain whySh[e-x2] is more accurate and converges faster toI[e-x2] thanTh[e-x2].5.(optional)(a) Letf(x) =|x|in [-1,1].What isT2/NforNeven?Explain.What is the order ofconvergence you observe forNodd?(b) Letf(x) =xin in [0,1]. ComputeT1/NforN= 16, 32, 64, 128. Do you see a secondorder convergence to the exact value of the integral? Explain. 2

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture