Professional Documents
Culture Documents
Sheet 3
Sheet 3
Homework 3
due 13.11.23 before 8 AM
Solutions must be delivered as specified by the instructions shown in Moodle.
Exercise 3.1:
Exercise 3.2:
Consider the function f (x) = xn for a fixed n. For an initial guess x0 = 1, calcu-
late the value of n such that after m iterations of the Newton-Raphson method the
resulting estimate of the root is 10−15 . This calculation must be handed in phys-
ically. Confirm this calculation by writing a Matlab script which implements the
Newton-Raphson iteration for f (x). Perform m = 1000 iterations with n given
by the prediction of the previous calculation and plot the estimates of the root on
a semi-logarithmic scale. Do you observe what you expected? What does this
mean for large values of n, for example n = 100? Is the Newton-Raphson a good
method for such cases?
(5 points)
Exercise 3.3:
Write a MATLAB program that implements the secant method. You can mod-
ify the existing bisect.m program from Moodle.
Write also a modified variant, which (like the bisection) is guaranteed to converge.
This is achieved by always keeping the pair of points (generated by the iteration)
which encloses the solution.
1
• Solve the equation
tanh(6βm) − m = 0 , β = 0.17 ,
• The exact solution for this case can be found in the previous exercise sheet.
Generate a log-log plot of δn+1 versus δn for both variants and calculate the
corresponding convergence exponents α [hint: |δn+1 | ∝ |δn |α ] . What can
you say about their values?
(15 points)
Note: For each exercise we should be able to see, from what you handed in, what
you did and what came out of it. Print out/write down everything we need for
this. If you don’t manage to write a working program, then write down a kind of
pseudo code. That is, explain step by step, what your program should be doing.