Due Date:
FINALIZED
As examples, and as part of the assignment, run the Bisection Method with the following arguments.
bisection 1 2 20 bisection 1 5 20 bisection 1 10 20You are to implement the Regula Falsi Method. If you have limited programming experience, I suggest you make a copy of the Bisection Method code and modify it, keeping the same program structure. If you are a more experienced programmer, you are free to program this up from scratch any way you want as long as the compilation via a makefile and the execuation still adhere to the assignment requirements. See below on how to submit the source codes and makefile for the solution methods.
Run the regulaFalsi method with the following arguments:
regulaFalsi 1 2 20 regulaFalsi 1 5 20 regulaFalsi 1 10 20Explain the results of both the Bisection Method and the Regula Falsi Method in the hardcopy you hand in at the beginning of class on the due day. Compare the output of the Bisection Method and the Regula Falsi Method. Use sketches showing how the algorithms solve the problem where appropriate and explain how one outperforms the other for given input.
Newton 1 10Note the value of the error when using starting point of '1'. Use 'verbose' mode to see the convergence. Find low and high values for the starting point where the error significantly changes (say, a couple orders of magnitude). Briefly discuss how Newton's Method solves this problem for a wide range of values (draw a diagram).
secant 0.5 0.55 10 secant 0.5 0.6 10Use verbose mode to see the convergence. Discuss the results and any difference you see.
The assignment is called 'hw2'.
Create a makefile that the grader can use to create your executables. The makefile, for example, can look like:
all: bisection regulaFalsi Newton secant bisection: bisection.c gcc -lm bisection.c -o bisection regulaFalsi: regulaFalsi.c gcc -lm regulaFalsi.c -o regulaFalsi Newton: Newton.c gcc -lm Newton.c -o Newton secant: secant.c gcc -lm secant.c -o secant clean: rm bisection regulaFalsi Newton secantDO NOT SUBMIT THE EXECUTABLE. The grader should be able to go to your submit directory to compile your program with:
make alland then issue the commands as in the assignment above.
There is also amble makefile information on the web, such as this Makefile tutorial.
ehco "CSE541 Homework #2," > output.txt echo "problem 1" >> output.txt bisection 1 2 20 >> output.txt bisection 1 5 20 >> output.txt bisection 1 10 20 >> output.txt echo " " >> output.txt echo "problem 2" >> output.txt regulaFalsi 1 2 20 >> output.txt ...