Starting from:
$30

$24

ASSIGNMENT #6 solution




This is a really large class and the logistics of grading assignments are challenging. Me and the markers require your help in making this process go smoothly. Please ensure that your assignments conform to the following requirements - any violation will result in getting a zero for the particular assignment.




All assignments should be submitted electronically through the ConneX course website and shoud be SINGLE PDF FILES. No other formats will be accepted. Handwritten answers are ok but they will need to be scanned and merged into a single pdf le together with any code examples and associated plots.




The assignment number, student name and student number should be clearly visible on the top of every page of your assignment submission.




PLEASE DO NOT COPY THE ASSIGNMENT DESCRIPTION IN YOUR SUBMISSION




The asnwers to the questions should be in the same order as in the assignment speci-cation.




Some of the questions of the assignments are recycled from previous years but typically with small changes in either the description or the numbers. Any submission that contains numbers from previous years in any questions will be immediately graded with zero.




Any assignment related email questions should have a subject line of the form CSC349A Assignment X, where X is the number of the corresponding assignment.




The total number of points for this assignment is 20.







1



(a) (2 points) Determine the Lagrange form of the interpolating polynomial P (x) that interpolates a function f(x) at x = 0, h and 4h, where h 0. (Multiply the linear factors together, but leave P (x) as a sum of 3 quadratics in the variable x.)



DELIVERABLES: All your work in constructing the polynomial. This is to be done by hand not MATLAB.




(b) (4 points) Derive the quadrature formula of the form




a0f(0) + a1f(h) + a2f(4h)




for approximating I = R04h f(x)dx that results from approximating the integral I by I R04h P (x)dx.

Note: if you know only 3 function values of f(x) and they are at 3 unequally-spaced points 0, h and 4h for any value of h, then this kind of quadrature formula can be used to approximate I.




DELIVERABLES: All your work in deriving the quadrature formula.




(c) (2 points) Suppose that you know only the following function values of f(x):







f(x) 0.0 1:00000



0.1 1:11091




0.4 1:63778

Use the quadrature formula from (b) to approximate R00:4 f(x)dx.

Note: the above data corresponds to the function f(x) = 1 sin1 x , and the exact




value is R00:4 f(x)dx = 0:508498. Use this information only to assess the accuracy of your computed approximation. If you do not obtain a fairly good approximation in (c), then your answer in (b) is incorrect. That is, the relative error between your answer and the true answer should be less than 1%.




DELIVERABLES: All your work to calculate the quadrature.




2. (a) (4 points) Determine the degree of precision of the quadrature formula

9f
5
! + 9f(0) + 9f
5
!


r












r




5


3
8
5
3






























for approximating

1



f(x)dx:




1




Use the de nition of degree of precision to do this, and show all of your work. See Handout #27. Note that the interval of integration here is xed at [ 1; 1]. Use

p




exact arithmetic here { do not use a numeric approximation for 3=5. Note: The interval of integration here is xed at [-1, 1], but this quadrature formula can be used on other intervals by using a change of variable.




DELIVERABLES: Show all your work.







2



(b) (2 points) Use the quadrature formula in (a) to approximate




1 e xpx + 2dx:



1




Either use your calculator or MATLAB to do the computations for evaluating the quadrature formula (use at least 7 signi cant digits).




Note: The exact value of this integral is 3.01747. Your computed approximation based on a sampling of f(x) at only three points is remarkably accurate (as this quadrature formula has a fairly high degree of precision).




DELIVERABLES: Show all your work and/or any MATLAB commands and results if used.




(6 points) Construct the Taylor polynomial approximations of order n = 3 for both f(x0 + h) and f(x0 + 2h) expanded about x0 (with their remainder terms written as O(h4)). Derive a numerical di erentiation formula for approximating f0(x0) by setting 3f(x0) + 4f(x0 + h) f(x0 + 2h) equal to the appropriate linear combination of the above approximations and solving for f0(x0). What is the order of the error of your approximation formula? Your answer whould be O(hd) for some integer d.



DELIVERABLES: Show all your work, the nal approxiamtion formula and the error in big-oh notation.













































































































3

More products