So, my instructor for my Numerical Analysis class gave me a project today, due tomorrow, and I am supposed to do it in Matlab. The problem is I have never used Matlab and I have very limited programming knowledge or experience. I don't know where to begin...
This is the Project:
1. Bisection Method.
a. Find the root of f(x) in a given interval [a,b] with a specified tolerance. Run your program on the three test problems listed below.
b. In the beginning of the program, use Intermediate Value Theorem to check if the given problem has a solution in [a,b]. If not, quit and show some error message.
c. Estimate the number of iteration steps N needed to attain the required accuracy. Use for 1:N to do the iteration.
d. The printout of your results should be to 7 decimal places. Show n(step), a(left end), b(right end), c(midpoint), and f(c) at each step. Use fprintf ('%2d, %12.7f, %12.7f, %12.7f, %12.7f/n', n,a,b,c,f(c)).
Test your code on the following problems:
1. f(x)=230x^4+18x^3+9x^2-221x-9, a=0. b=1, with |Cn-r|<10^-6.
2. f(x)=1+ln(1+x^2), a=0, b=1, with |Cn-r|<10^-6.
3. f(x)=e^x+2^-x+2cos(x)-6, a=1, b=2, with |Cn-r|<10^-6.
2. Fixed-point Iteration
a. Written part: Derive Gi(x), i=1,2,3, for finding roots of f(x)=2x^3-6x-1 by Fixed-point iteration (FPI). Newton's method is NOT allowed to use.
Suppose the three roots are known as:
r1=-1.641783527452926
r2=-0.168254401764093
r3=+1.810037929236685
Verify that the Gi's you derived generate convergent sequences approaching the three roots correspondingly.
b. Run FPI for each G(x) and print your results in the same format as shown in the text.
c. Use while to do the iteration with stopping criterion
|F(Xn)|<10^-8.
Please someone help me out.
Jon
This is the Project:
1. Bisection Method.
a. Find the root of f(x) in a given interval [a,b] with a specified tolerance. Run your program on the three test problems listed below.
b. In the beginning of the program, use Intermediate Value Theorem to check if the given problem has a solution in [a,b]. If not, quit and show some error message.
c. Estimate the number of iteration steps N needed to attain the required accuracy. Use for 1:N to do the iteration.
d. The printout of your results should be to 7 decimal places. Show n(step), a(left end), b(right end), c(midpoint), and f(c) at each step. Use fprintf ('%2d, %12.7f, %12.7f, %12.7f, %12.7f/n', n,a,b,c,f(c)).
Test your code on the following problems:
1. f(x)=230x^4+18x^3+9x^2-221x-9, a=0. b=1, with |Cn-r|<10^-6.
2. f(x)=1+ln(1+x^2), a=0, b=1, with |Cn-r|<10^-6.
3. f(x)=e^x+2^-x+2cos(x)-6, a=1, b=2, with |Cn-r|<10^-6.
2. Fixed-point Iteration
a. Written part: Derive Gi(x), i=1,2,3, for finding roots of f(x)=2x^3-6x-1 by Fixed-point iteration (FPI). Newton's method is NOT allowed to use.
Suppose the three roots are known as:
r1=-1.641783527452926
r2=-0.168254401764093
r3=+1.810037929236685
Verify that the Gi's you derived generate convergent sequences approaching the three roots correspondingly.
b. Run FPI for each G(x) and print your results in the same format as shown in the text.
c. Use while to do the iteration with stopping criterion
|F(Xn)|<10^-8.
Please someone help me out.
Jon