CS/SE 4X03 — Assignment 3 (Solution)

$ 20.99
Category:

Description

Instructions
• Submit to Avenue a PDF file containing your solutions and the required Matlab files.
Assignments in other formats, e.g. IMG, PNG, will not be marked.
Name your Matlab files exactly as specified.
• Name your PDF file Lastname-Firstname-studentnumber.pdf.
• Submit only what is required.
• Do not submit zipped files. We will ignore any compressed file containing your files.
• We will deduct marks for not following the required naming conventions.
Problem 1 [5 points] Consider the integral . Suppose that we wish to integrate it numerically with an error of magnitude less than 10−8 and using equally spaced points and the trapezoidal rule. Derive how many points are needed to achieve this accuracy.
Problem 2 [3 points] Approximate using the Simpson’s rule with 5 equally spaced points and calculate the error in this approximation.
Problem 3 [3 points] A common problem in surveying is to determine the altitudes of a series of points with respect to some reference point. The measurements are subject to error, so more observations are taken than are necessary to determine the altitudes, and the resulting overdetermined system is solved in the least square sense to smooth out the error. Suppose that there are four points whose altitudes x1, x2, x3, x4 are to be determined. In addition to direct measurements of each xi, with respect to a reference point, measurements are taken of each point with respect to all of the others. The resulting measurements are:
x1 = 2.95 x2 = 1.74 x3 = −1.45 x4 = 1.32 x1 − x2 = 1.23 x1 − x3 = 4.45 x1 − x4 = 1.61 x2 − x3 = 3.21 x2 − x4 = 0.45 x3 − x4 = −2.75
From these data, find the best values for the altitudes. How do your computed values compare with the direct measurements?
Problem 4 [10 points] Implement the composite Simpson’s rule and adaptive Simpson. Construct an example of a function f(x), interval [a,b] and tolerance tol such that, to achieve about the same accuracy, the composite Simpson’s rule on a uniform mesh requires at least 100 times more function evaluations than your adaptive Simpson. For this purpose consider the following steps.
• Use Matlab’s quad function to compute an accurate approximation. For example, you can use tolerance 1e-2*tol in quad.
To measure the error produced by your implementations, you can subtract from the quad’s result and take absolute values.
• Select an n in your composite Simpson such that the error is about tol. Count the number of function evaluation for this n; denote them by C1.
• In the adaptive Simpson, use tol and compare with the result from quad, to ensure that your computed result is within the tolerance.
Count the the number of function evaluations; denote them by C2.
Then C1 ≥ 100C2 should hold.
Submit
i
Submit
(1)
Submit

Reviews

There are no reviews yet.

Be the first to review “CS/SE 4X03 — Assignment 3 (Solution)”

Your email address will not be published. Required fields are marked *