Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Assignment 4

MATH 3NA3

28 October 2022

Instructions:

• Carefully read and answer all parts of each question. Four significant figures are sufficient for numerical answers.

• Ensure that your document is well organized and legible, with each question clearly labelled (e.g. 1(a), 1(b) etc.).

• Include any matlab code as well as its output. The code should have comments indicating the question it relates to and an explanation of what it is doing (use the % symbol for comments).

• Ensure that any figures are numbered, have labelled axes and a caption. The caption should include the figure number, the question it is related to and an explanation (e.g. ”Figure 2(a): question 3. The total error in the first order finite difference approximation for sin(1) illustrating the optimal step size and minimum error.”)

• Submit as a single pdf file on the Avenue dropbox by the due date.

Review exercises not to be handed in:

1. True or False: Newton’s method always converges quadratically.

2. True or False: An overdetermined linear least squares problem Ax ≈ b always has a unique solution that minimizes the Euclidean norm of the residual vector.

3. True or False: In solving a linear least squares problem, zero residual means the solution must be unique.

4. In an overdetermined linear least squares problem with model functions f(t, x) = x1φ1(t) + x2φ2(t)+x3φ3(t), what is the rank of the resulting least squares matrix A if we take φ1(t) = 1, φ2(t) = t and φ3(t) = 1 − t?

5. In a linear least squares problem Ax ≈ b, where A is an (m × n) matrix, if rank(A) < n, then which of the following situations are possible?

(a) There is no solution.

(b) There is a unique solution.

(c) There is a solution, but it is not unique.

Exercises To BE HANDED 1N:

[14]        1.   Exercise 5.4.

2.  Suppose we wish to develop an iterative method to compute the square root of a given number y > 0 by solving the nonlinear equation

f (x) = x2 - y = 0

given the value of y . The functions g1  and g2  below each give a different xed point problem that is equivalent to f (x) = 0.  For each of these functions, determine whether the corre- sponding xed-point iteration scheme x(k+1)  = gi(x(k)) is locally convergent to ^y if y = 3. Explain your reasoning in each case.  [Hint: consider the open interval x s (1, 2).]

[2]              (a)   g1 (x) = y + x - x2 .

[2]              (b)   g2 (x) = 1 + x - x2 /y .

[4]              (c)   What is the xed-point iteration function  g(x) given by Newton’s method for this

particular problem?  Show that Newton’s iteration must converge quadratically to the root x*  for y = 3.

3.  Consider the problem of nding the roots of the nonlinear equation f (x) = 3x2 - ex .

[3]              (a)   Plot the graphs of y = ex  and y = 3x2  on the same axes.  How many roots does f (x)

have? What type are they?

[3]              (b)   Prove that the Newton (also called Newton–Raphson) method for nding the roots of f (x) converges and describe the type of convergence.  [Hint: you may use the approxi- mation x* = 3.5 in the convergence prove.]

[4]              (c)   Write a MATLAB script implementing the iterations for Newton’s method for this equation with initial guess x(0)  = 3.5.  Stop the iterations when the distance between two consecutive approximations is smaller than 10_9 . What is the nal estimate for the root?

4. A planet follows an elliptical orbit, which can be represented implicitly in a Cartesian (x, y) coordinate system by the equation

ay2 + bxy + cx + dy + e = x2 .

[10]              (a)   Use qr house.m  (from the website) for linear least squares to determine the orbital

parameters a, b, c, d, e given the following observations of the plant’s position:

x

y

1.02    0.95 0.77    0.67    0.56    0.30    0.16    0.01 0.39 0.32    0.22    0.18    0.15    0.12    0.13    0.15

In addition to printing the values for the orbital parameters, plot the full elliptical orbit described by the parameters and the given data points in the (x, y) plane.  [Hint: use the matlab function fimplicit to plot the ellipse using the implicit form and the coefficients you found.]

[8]              (b)   The least squares problem is nearly rank-deficient.  To see what effect this has on the

solution, perturb the input data slightly by adding the following perturbations to the data in part (a).

6x

6y

1.2e-3 6.4e-3    -4.8e-3    2.8e-3    -1.4e-3    3.2e-3     3.6e-3    -9.0e-4

-4.8e-3    1.9e-3     3.2e-3    4.8e-3    -2.1e-3    2.4e-3    -5.0e-3     2.2e-3

Now, solve the least squares problem for the perturbed data.  Plot the (complete) new orbit. Compare the new values for the parameters with those computed previously. Is the size of the change in the parameters similar to the size of the perturbation?  (Use norms to compare.) Is the orbit for the perturbed data close to the orbit for the unperturbed data?  Explain.  [Hint: use the matlab function fimplicit to plot the ellipse using the implicit form and the coefficients you found.]

Total: 50