Starting from:
$30

$24

Tasksheet 2: More on Root Finding Algorithms




The following tasks comprise the second homework assignment for the class. In the class, we have talked about a few basic content items.

Task 1. Newton's Method for Root Finding.


Develop a standalone function/module that implements Newton's method. Keep in mind that you will need to limit the number of iterations to make sure your code will work. Test the code on the function

f (x) = x e−x

Also, create a software page for your version of Newton's method using the template given to you in class. Include a version of the code in the module or shared library.

Task 2. Secant Method for Root Finding.


Develop and implement a function/module to use the Secant method as developed in class. Use the same test function and add another page to your software manual to document your version of the Secant method. Put a version of the Secant method in your root finding module.

Task 3. Tabulation of Results


Modify your code from the first task to produce a table of the results from the Bisection method, Newton's method, and the Secant method. That is, the code should accept a flag that will tell the code to provide a list of numerical values that include (1) the iteration number, (2) the approximate location of the root, and (3) the absolute value of the error in the approximation. In many cases, Linux commands use "-v" or "--v" to turn on verbose mode in the command. You might consider a parameter like this and put the logic in to use the parameter.
Task 4. Hybrid Method - Bisection/Newton's Method


Develop a code that implements a hybrid method using Newton's method and the Bisection method. To test your code, consider the function

f (x) = 10.14 ⋅ ex2   cos ( πx )

on the interval [−3, 7]. Subdivide the interval and apply the hybrid method to intervals that have a root Notice there is a singularity in the function near x = 0.

Task 5. Another Hybrid Method - Bisection/Secant Method.


Develop a version of the hybrid root finding code that replaces Newton's method with the Secant method. Use the same tests as for the previous tasks and also create a software manual page for this alternative for a hybrid method. Finally, include your version of the code is included as a function or module for the root finding problem.

More products