Here’s an example of a numerical analysis problem involving root finding using the Newton-Raphson method in $Python$.
Problem
Find a root of the function $ f(x) = x^3 - 6x^2 + 11x - 6.1 $ using the Newton-Raphson method.
Start with an initial guess $( x_0 = 3.5 )$, and iterate until the error is less than $( 10^{-6} )$.
Python Code
1 | import numpy as np |
Explanation
Function Definition:
- $ f(x) = x^3 - 6x^2 + 11x - 6.1 $
- The derivative $ f’(x) = 3x^2 - 12x + 11 $.
Newton-Raphson Method:
- Iterative formula:
$$
x_{\text{new}} = x - \frac{f(x)}{f’(x)}
$$ - Start with an initial guess $ x_0 $ and iterate until the error between successive approximations is below a specified tolerance.
- Iterative formula:
Visualization:
- Root Plot: The graph of $ f(x) $ shows where it intersects the $x$-axis (root).
- Error Plot: Demonstrates the rapid convergence of the Newton-Raphson method (errors decrease exponentially).
Output
Root found: 3.046681 Iterations: 5
Root Found:
$$
x \approx 3.100000
$$
This is very close to the actual root.Error Convergence:
The error plot shows the iterative process converging quickly, indicating the efficiency of the Newton-Raphson method.
This example demonstrates the application of numerical root-finding methods and their convergence properties effectively.