Assignment A4

501 students do all exercises, 340 students do either exercise 1 or 3 and the rest.

Exc 1: Solve Heath Computer problem 6.7 (a), (b) and (d) (p. 303). Part (c) is not graded. A suggested tool for 3D graphing is GeoGebra or Desmos. For part (d), implement your own minimization routine such as Newton's method, and plot at least 5 iterations as points on the 3D graph. Give an example of a starting point that avoids the saddle points, and one that take more iterations to get around the saddle points. Hint: For a 2x2 Hessian [a, b; c, d], the eigenvalues (lambda) are the solutions to the quadratic equation (a-lambda)*(d-lambda) - b*c = 0


Exc 2: Solve Heath Computer problem 6.15 (p. 305).


Exc 3: Solve Heath Computer problem 6.19 (p. 306)


Exc 4: Solve Heath Computer problem 8.18a (p. 381). Additionally use the forward, backward and central difference as defined on page 366 on some of the original tabulated data points. Compare the various approaches. In your answer we are mostly interested in your analysis of when and when not a particular method works You can plot the data, fitted polynomials, computed derivatives (as tangents). What do you think the function underlying this data is? Given that hypothesis, what method of derivative computation gives the most accurate result?
Hand in plots and your description for particular examples of "good" and "bad" results, and explain why. (We are looking for analysis and understanding, not a tabulated list of all the derivative values.)

Exc 5. An automobile consumes far more fuel for the first few
kilometers (when cold started) than when it is properly warmed up. To measure the fuel consumption an in-line fuel flow rate sensor is used which measures the instantaneous fuel flow in liter (such a thing is already installed in modern cars with electronic fuel injection but manufacturers choose not to show the measurements to the consumer. However there are aftermarket devices that can read data from the car computer). Below is a table with distance x in km and instantaneous fuel consumption in liter/km.

a. cmput 340 : Integrate numerically using the midpoint, trapezoid and Simpsons rule using all the data points to arrive at an as good as possible estimate of the total amount of fuel consumed in the first 10km of driving. What is a reasonable estimate for the error in your midpoint and trapezoidal rule value respectively?
cmput 501 Perform the above but instead with Romberg integration. (Trapezoid rule and repeated Richardson extrapolation, Heath p.370.)

b. (all students) Suppose we wanted to know the amount fuel used to drive 8 km how might we go about finding this? What would the amount be?

Distance x km
0
1.25
2.5
3.75
5
6.25
7.5
8.75
10
Consumption f(x) l/km
0.26
0.208
0.172
0.145
0.126
0.113
0.104
0.097
0.092