Inverse Quadratic Interpolation and the secant method

1.8k Views Asked by At

I am currently completing a maths project that aims to approximate the roots of functions using MATLAB.

The two root finding methods that I have used are inverse quadratic interpolation and the secant method.

I have written scripts for both methods and have obtained approximations to the roots of different functions.

I was wondering if it was possible to graphically illustrate the various iterations for a specific function, on the same graph, to show the method converging to the actual root value?

If this is possible I would like to be able to complete it on MATLAB if not then excel?

Does anyone know if this is possible or even how to go about completing it?

Thank you!!

1

There are 1 best solutions below

3
On

This is just a suggestion. Create a table $[n_1,x_{n_1}]$ where $n_1$ is the iteration number and $x_n$ the predicted value for the solution using method $1$. Do the same for method $2$ creating a table $[n_2,x_{n_2}]$. Now, plot the values of $x_{n_1}$ and $x_{n_2}$ as a function of $n$. Eventually, add to the plot the horizontal line corresponding to the exact solution.

Is this totally stupid or undoable (I don't know Matlab) ?