Problem: Numerical Solution of a Nonlinear Equation
In mathematical analysis, solving nonlinear equations is essential for understanding systems in engineering, physics, and economics.
Here, we use Newton’s Method to find the root of a nonlinear equation.
Problem Statement
Solve the nonlinear equation:
$$
f(x) = x^3 - 2x^2 - x + 2 = 0
$$
starting with an initial guess $(x_0 = 1.5)$.
Python Code
1 | import numpy as np |
Explanation of the Code
Newton’s Method:
- Newton’s Method is an iterative algorithm for finding roots of nonlinear equations.
- The iteration formula is:
$$
x_{n+1} = x_n - \frac{f(x_n)}{f’(x_n)}
$$ - The method requires an initial guess $x_0$, the function $f(x)$, and its derivative $f’(x)$.
Convergence Tracking:
- The history of $(x_n)$ values is stored and plotted to show the convergence path.
Graphical Representation:
- The function $f(x)$ is plotted along with the iteration points.
- The root is highlighted on the graph.
Results and Insights
This graph illustrates the solution of the nonlinear equation $f(x) = x^3 - 2x^2 - x + 2$ using Newton’s Method.
- The blue curve represents the function $f(x)$.
- The black dashed line is $y = 0$, showing the x-axis where the root lies.
- Red dots indicate the iteration points computed during the method.
- The orange dashed line represents the convergence path of the iterations.
- The green dot marks the final root found at $x = -1.000000$, where $f(x) = 0$.
This visualization demonstrates how Newton’s Method refines the guess iteratively, converging to the root of the equation.