Homework #5

Due Friday, August 8, 2003

Nonlin Eq. & Optimization

Answer all questions. Submit any pertinent hand calculations and/or Matlab code in a neat manner in order to help us give you partial credit. Readings: Van Loan 8.0-8.2 inclusive.

1) Do problem P8.1.9 in the text.

2) Yet another interesting application of Newton’s method. Throughout your engineering careers you will, no doubt, always be endebted to Newton for his method. It underlies many iterative processes. Here is yet another example.

Sometimes a function y(x) is defined implicitly through the equation G(x, y) = 0 (for purposes of this assignment you need not know the necessary conditions for when this is possible). I.e. the equation G(x, y(x)) = 0 holds true. One can think of y(x) as being the intersection of z = G(x, y) with the plane z = 0, so that y(x) traces out the curve in the plane z = 0 that shows where G(x, y) = 0. We can use Newton’s method to calculate a table of (x, y(x)) values. For a given x_{1} we calculate Newton iterates

y_{k+1}^{(2)} = y_{k}^{(2)} − \frac{G(x_{2}, y_{k}^{(2)})}{\frac{∂G}{∂y}(x_{2}, y_{k}^{(2)})},

for k = 1, 2, …, for a nearby abscissa x_{2}. Of course y_{1} = y_{1}^{(2)} must satisfy G(x_{1}, y_{1}) = 0. Once the y_{k}^{(2)} converge to y_{2} we can do the same for a nearby x_{3}, and so on.

Write a Matlab program implicitY that calculates a table of (x, y) values and uses them to plot y(x) that is defined implicitly by G(x, y(x)) = 0, for the two cases below. The program should return a vector of y values. The program should take in the functions G, \frac{∂G}{∂y} and the values x_{1}, y_{1}, x_{numX}, numX and numIter. These last two arguments are described next.

End the Newton iteration process by simply limiting the number of iterations to numIter. While using implicitY, numIter should be anywhere from 5 to 10. numX will denote the number of x values.

Do not include any tables in your submission, just plots and program listings.

a) Any good scientist should have test cases that ensure that methods and code are correct. Test the method and your code for G(x, y) = x^{2} + y^{2} − 1. The familiar equation G(x, y) = 0 defines the unit circle given by the functions y_{±}(x) = ±\sqrt{1 − x^{2}}. Your table need only recover y_{+}(x) for x ∈ [−1 + ε, 1 − ε], for ε = 0.01. Start with x_{1} = −1 + ε. In addition to the plot of x versus y(x), case produce a plot of relative error to confirm correctness.

b) G(x, y) = 3x^{7} +2y^{5} −x^{3} +y^{3} −3, for x ∈ [0, 10]. Start with x_{1} = 0. In order to confirm some sort of convergence of the method use (numX, numIter) = (100, 5), (1000, 50). Observe what happens.

3) Do problem P8.2.9 in the text.