Numerical Analysis II
Dr Abigail Wacher
3. Polynomial Interpolation
When presented with n C 1 data points xi , f xi i = 0, 1,., n we may want to draw a curve to go through these points in order to obtain some information, that is by interpolation or extra
Tutorial week 2
Let g (x) = 2 1 + x 2, p0 [a, b] = [0, 3] and pn+1 = g (pn ). Show that cfw_pn is a strictly decreasing sequence and bounded by 0 deduce that the iteration converges. Use the Convergence of a Monotonic Sequence Theorem. We know g (0) = 0
Tutorial week 4
1. (a) Let f (x) = ex 4x. Using the Intermediate Value Theorem prove that the equation f (x) = 0 has a unique solution, p, in the interval (0, 1). (b) One rearrangement of this equation is x = g (x) := 0.25 ex . Show that the iterative met
Tutorial week 10
1. A dierentiable function takes the values f (0.1) = 1.629, f (0) = 1.312 and f (0.1) = 1.043.
Using the central and backward dierence formulae f (x2 ) f (x0 ) x2 x0 ANSWER: Using the central dierence formula with x2 = 0.1 and x0 = 0.1 f
Homework 3 due Thursday October 28 before 13:30 in corresponding group folder on door of oce CM110
Consider the sequence cfw_pn generated by p0 = 0 , pn+1 = (p3 + 2)/6, n n = 0, 1, 2, .
Show that for all n, 1 pn 0 and that the sequence converges to a li
Homework 1 due Thursday October 14 at 12:00 at lecture
Prove that the equation x3 + x + 1 = 0 has one and only one real root, p, and show that it lies between 1 and 0. Use a bisection method to nd p correct to three decimal places. How many steps of the
Homework 2 due Thursday October 21 before 13:30 in corresponding group folder on door of oce CM110
Let a > 0. Could the iterative formula pn+1 = a/pn be used to solve x2 = a, i.e. to nd the square root of a? Give reasons for your answer. Let g (x) := a/x
Numerical Analysis II
Dr Abigail Wacher
Two drawbacks of Lagrange formula for obtaining the interpolating polynomial. 1) To evaluate the polynomial there is a lot of arithmetic. 2) If a new node is added to the date say xn C 1 and we wish to include it in
The lagrange form is a direct way to obtain the unique polynomial interpolating a set of data points which goes through each n C 1 data point, with a polynomail of order n. Given n C 1 data points x0 , y0 , x1 , y1 $.$ xn , yn where no two xj are the same
Numerical Analysis II
Dr Abigail Wacher
Newton's Method fx g x = xK f' x f x f ' x Since g ' x = f' x 2 g ' p = 0 as long as f ' p s0 so care must be taken if f has a double root or higher multiplicity root. Provided the starting value is "close" to p and
Numerical Analysis II
Dr Abigail Wacher
Aside Continuity Recall that f:-> is continuous if > 0 > 0 s.t. |x-y|< => |f(x)-f(y)|< But some functions are "more continuous" than others, so we need a more refined definition. Definitions: Let I =d , then f:I->I
Numerical Analysis II
Dr Abigail Wacher
Convergence Speed & Acceleration Convergence of an iteration sequence can be very slow, i.e. many iterations may be required to reach the desired accuracy. When possible we would like to accelerate. We begin by unde
Numerical
Differentiation
Finite Difference Formuia: comes from a sim
ple approximation based on computing the sIQpe
between two points (t§f(t), (t+At,f(tiAt),
that is the secant line
f(t + At) - f(t)
At Taking the limit of the secant line as At + O
we
Maple can handle a very large number of digits, the maximum number of digits in our computer. O Maple_floats(MAX_DIGITS); 38654705646 The result of the function O D_H=evalhf(Digits); (1) (1)
D_H = 15.
(2)
is the number of decimal digits that the correspon
Numerical Analysis II
Dr Abigail Wacher
Errors Errors can be introducted in several ways. We can have experimental errors (such as measurement errores), machine/computer errors, mathematical approximations. Mathematical approximations, and computer errors
Numerical Analysis II
Dr Abigail Wacher
Example 1 Try with K , 1 , 0, 1 , 1, 2 , 2, 4 1
i
xi
K 1 0 2 4
f
xi
f xi K 1 , xi
f xi K 2 , xi K 1 , xi
f xi K 3 ,., xi
0 1 2 3
1 1 2 4 0 1 2 1 2 1 2 0
p3 x = f x0 C f x0 , x1 w1 x C f x0 , x1 , x2 w2 x C f x0 ,.,
Homework 4 due Thursday November 4 before 13:30 in corresponding group folder on door of oce CM110
Prove that the sequence generated by the iterative formula pn+1 = 1 sin pn converges to the real root of the equation sin x + x 1 = 0 for every real starti
Homework 5 due Thursday November 11 before 13:30 in corresponding group folder on door of oce CM110
1. (a) The equation x3 + x 1 = 0 has one real root near to 0.7. Discuss briey, and without actually implementing the iterative method, the convergence of i
Recall that in GE, we did [assuming no pivoting]
A d A 1 /A 2 /./A s /./A n = U
At step s we have
x x
x
x
.
. 0
asss
0
A
s
=
. as s 1, s
C
.
s
ans
ais s
rows from rowi
asss
We can write this operations as:
for i = s C 1,., n (rows)
Subtract
(*) aij
sC1
Last Week
If A can be reduced to upper triangular U by GE (no pivoting), then we can write
A = LU
Where L is lower triangular with Ljj = 1
How about pivoting?
Ex. 9.2 in Practical.
In general
Thoerem
Any non-singular A can be written as
PA = LU
Where
Homework for 9th Feb
7(A), 9, E1) Compute # flops to do A = LU.
Recap
Factor A = LU
Where U is obtained by GE
L = G 1 .G n K 1 = I C n K 1 f
>
r
5e
r
r=1
More precisely, recall that
f
s
= 0,., 0,
s
as C 1, s
asss
,.,
anss
asss
So
1
0
1
1
a21
1
a11
. . 0
Least-square Approximation for Continuous Functions
Closely related to the discrete case, but some what simpler
~
Given a function f : a, b /=, find a polynomial pk e P k that minimises the error.
b
2
~
f x K pk x
E p =
a
dx
For later use, consider a more
Least Square Approximation
Given a set of data xi , yi
n
find a function p x that approximates it.
i=1
How?
a) Lagrange Interpolation
adv
exact at xi
dis
expensive to compute a polynomial of high degree.
unstable when n is large, pn K 1 x oscill
From earlier
Example
1
Find a quadratic approximation to f x = sinK x in K 1 with weight w x =
1,
~
p2 x = p0 C p1 x C p2 x 2
Where p is the solution of Ap = q
1
1 0
2
0
1
2
0
1
2
0
3
8
1
0
1
2
0
1
0
1
2
0
0
1
2
0
2 ~ 0
1
2
0
2
1
2
A
2
0
3
8
0
0
1
8
0
=p
Numerical Analysis II
Dr Abigail Wacher
So now we turn our attention to wn C 1 x which we can control by choosing the nodes to minimise
the maximum error in wn C 1 x . Thus minimising (as best we can) the error in the interpolation.
As it turns out the ma