Chapter 5 Developing Newton-Raphson Method Simulation
This simulation is inspired by the wolfram demonstration project of Angela Sharp, Chad Pierson, and Joshua Fritz which is available here Learning Newton’s Method
The basic structure of the simulation is divided into three parts:
- The Input Panel
- The Graph Panel
- The Results Panel
5.0.1 The Input Panel
The general idea is that the user should have the ability to choose one function at a time from these for functions:
- \(x^2 - 2 = 0\)
- \(cos(x) = 0\)
- \(x^3 - 7 = 0\)
- \(x^3 - 3x^2 + x - 1 = 0\)
The user should also be able to select the number of iterations from a range of 0 to 5.
And finally, the user should be able to change the value of initial estimate \(x_0\) using a slider
with an interval of 0.01
5.0.2 The Graph Panel
The graph panel should show the plot of the chosen function in black and a black point for the 0th iteration and red for the other iterations based on the selection.
The graph assists in illustrating geometrically Newton’s method for approximating roots. The set of functions available demonstrate where the method produces interesting behavior.
5.0.3 The Results Panel
This panel shows the results in a tabular format. The first column denotes the Iterations
. The second column denotes the Estimate
and finally the third column denotes the Absolute relative error
.
Based on the user’s selection of function
, number of iterations
, and the value of initial estimate
the output should get updated on this panel.