|
|
You are here: Home / Category Index / Differentiation / The Applications Of Newtonraphson
|
The Applications Of Newtonraphson - By Caitriona Rooney
How to use this applet:The user must enter something in all the boxes before anything happens. The coefficients of the cubic equation and the number you would like to be square-rooted must all be integers.When the user presses the "draw graph" button a graph of the cubic equation is drawn. When the user presses the "get root of cubic equation" button the root is returned at the bottom left corner of the applet. The user will then be able to compare this answer with the graph. When the user presses "Calculate square root" the square root of the number entered is returned at the bottom left corner of the applet.Notes on the maths used in the applet:To get the root of the cubic equation the NewtonRaphson method is used ie. x = x1 - f(x1)/f'(x1).
I translated this into:
x = x1 - (ax1^3 + bx1^2 + cx1 + d)/(3ax1^2 + 2bx1 + c).
This is repeated 20 times in order to get a very close approximation of the root.
To find the square root of the equation the same sort of method is used.
Suppose the user enters 2:
Then the equation is x^2 - 2 and NewtonRaphson formula becomes:
x = x1 - (x1^2 - 2)/2x1.
The NewtonRaphson method is repeated 20 times in order to give a close approximation of the square root of the entered number.
It does not matter what value the user enters for x because the NewtonRaphson formula is repeated so often that it is very unlikely that the answer returned will not be accurate.
In order to draw the graph I entered many values for x in the cubic equation to get points. Then I mapped out these points and joined them all together to form a curved graph.
Other useful information: The scope of the grid:
Both the x-axis and the y-axis go from -10 to +10.
|
|