Y2, C10 - Numerical Methods Flashcards
How would you show that f(x) = e^x +2x - 3 has a root between x = 0.5 and x = 0.6
Solve f(0.5) and f(0.6)
= -0.35127
= 0.02211
Because CHANGE IN SIGN and f(x) CONTINUOUS, root for f(x) is between 0.5 and 0.6
When is a function continuous
When you can trace it without taking your pen off the page
Does a change in sign always mean there isn’t a root
NO
The sign change method fails to detect a root if there were an even number of roots in that interval
g(x) = e^x-1 + x - 6
The root of g(x) = 0 is A
What is a suitable interval to show that A = 2.307 to 3 decimal places
[2.3065, 2.3075]
How do you solve f(x) = 0 by an iterative method
Rearrange into form x = g(x) and use the iterative formula x(n+1) = g(x(n))
Where n+1 and n are subscripts
The iterative formula:
x(n+1) = ln(6 - x(n)) + 1
x(0) = 2
is used to find an approximate value for A, calculate the values of x1, x2 and x3
x1 = ln(6 - x(0)) + 1
x1 = ln(6 - 2) + 1 = 2.3863
x2 = ln(6 - x(1)) + 1 = …
x3 = ln(6 - x(2)) + 1 = …
What does it mean if the x(n) values get closer and closer together
The iteration is successful and convergent
What does it mean if the x(n) values get further and further apart
The iteration has failed and is divergent
What does it mean if the x(n) values bounce back and forth between values
The iteration oscillates and is periodic / non-convergent
Do staircase diagrams always converge
NO, they can diverge
How do you draw staircase / cobweb diagrams
From x0, draw up to curve, across to line (y=x), then to curve etc.
What is the Newton-Raphson iteration formula for solving f(x) = 0
x(n+1) = xn - (f(xn)) / (f’(xn))
Where xn is the first x coordinate and f(xn) is the first y coordinate
Using the Newton-Raphson process, state the recurrence relation for f(x) = x^2 - x - 1
x(n+1) = x(n) - (f(xn)) / (f’(xn))
x(n+1) = x(n) - (xn^2 - xn - 1) / (2xn - 1)
When can the Newton-Raphson method fail (3 ways)
When the starting x0 value is the stationary point
It can diverge (oscillate)
Can give approximation for a different (wrong) root
Why doesn’t the Netwon-Raphson method work when the starting x0 point is stationary
f’(x0) = 0
You cannot divide by 0 and f’(x0) is the denominator of the formula
The tangent will never meet the x-axis