E.g.
f(x) = x² - x - 4
When the above is rearranged in the form of x = g(x), it is said to be in iterative form. x² - x - 4 = 0 x = 1 + x/4 xn+1 = 1 + xn / 4 If xn is known, xn+1 can be calculated.The initial value to trigger off the iterative process is found by looking for change in sign of the function by trial and improvement.
f(2) = - 2; < 0 f(3) = 2; > 0
That means there is a root between x = 2 and x = 3.
Let's use x0 as 2 to iterate the formula. As you can see, x approaches 2.56.
The root is x ≈ 2.56(2dp)
Note: the simulation is made with Python:
1. Cobweb method
As you can see, each iteration brings us closer to the root, weaving a pattern of a cobweb.
2. Staircase method - convergence to a root
Each iteration forms a part of a staircase and converges to a root.
2. Staircase method - divergence from a root
0 comments:
Post a Comment