Ceng 375 Numerical Computing
Midterm
Nov 12, 2009 14.40-16.30
Good Luck!
Each question is 25 pts.
  1. The following function is given

    \begin{displaymath}
f(x)=3*sin(x)- e^x/4-1
\end{displaymath}

    This nonlinear equation ($f(x)=0$) is solved by using four methods, namely Bisection, Regula Falsi, Newton's, Muller's methods. See the following MATLAB commands;
    >> f = inline ( ' 2*sin( x) - exp ( x)/4 -1');
    >> df = inline ( ' 2*cos( x) - exp ( x)/4');
    >> fplot(f,[-7 -3]); grid on;
    >> format short e
    >> bisect(f,-7,-5,fzero(f,[-7 -5]),1e-5);
    >> regula(f,-7,-5,fzero(f,[-7 -5]),1e-5,eps,20);
    >> newton(f,df,-7,fzero(f,[-7 -5]),1e-5,eps,20);
    >> muller(f,-7,-6,-5,fzero(f,[-7 -5]),1e-5,eps,20);
    
    Plot of the function is given at the following figure;

    \includegraphics[scale=0.4]{figures/28}

    Then, the following tables are obtained.

    Table: Obtained root values at each iteration for all of four methods.
    iteration Bisection Regula Newton Muller
    1 -6.0000e+00 -5.5672e+00 -5.4650e+00 -5.7134e+00
    2 5.5000e+00 -5.7373e+00 -5.8008e+00 -5.7604e+00
    3 -5.7500e+00 -5.7575e+00 -5.7596e+00 -5.7591e+00
    4 -5.8750e+00 -5.7590e+00 -5.7591e+00 -5.7591e+00
    5 -5.8125e+00 -5.7591e+00 -5.7591e+00 -
    6 -5.7812e+00 -5.7591e+00 - -


    Table: Obtained function values at each iteration for all of four methods.
    iteration Bisection Regula Newton Muller
    1 -4.4179e-01 3.1174e-01 4.5882e-01 7.8084e-02
    2 4.1006e-01 3.7524e-02 -7.3051e-02 -2.2184e-03
    3 1.5762e-02 2.8928e-03 -8.1042e-04 4.1882e-06
    4 -2.0681e-01 2.0926e-04 -1.0968e-07 -4.0674e-11
    5 -9.3753e-02 1.5061e-05 -2.2204e-15 -
    6 -3.8525e-02 1.0836e-06 - -

    i
    Analyze these tables. Is the convergence sustained for the each methods? For the sustained ones; at which iteration and why?
    ii
    If the exact value is given as $-5.7591e+00$, fill the following table for two methods. Choose two methods and use scientific notation with five significant figures.;
     
    iteration $Error_1$    $Error_2$    $Error~Ratio_1$ $Error~Ratio_2$
    1        
    2        
    3        
    4        
    5        
    6        
     
    iii
    What can you say about the speed of convergences for each method?














    iv
    Which method is the best one? Why?









  2. Consider the same function with the previous question:
    v
    Find the root in the interval of $[-5,-3]$ with Newton's method. Hint: Newton's method uses the algorithm:

    \begin{displaymath}
x_{n+1}=x_n-\frac{f(x_n)}{f'(x_n)}
\end{displaymath}

    vi
    Estimate the error at the last iteration in your answer to part i. Hint: To estimate the error, compute one more iteration.














    vii
    Approximately how many iterations of the bisection method would have been required to achieve the error value of $1e-5$?
  3. Consider this pair of equations:

    \begin{displaymath}
x^2+4y^2=4
\end{displaymath}


    \begin{displaymath}
y-x^2+2x=0.5
\end{displaymath}

    Plot of the system is given at the following figure;

    \includegraphics[scale=0.4]{figures/30}


    Solve this system by iteration. Start with something like $y=???$ and proceed only two iterations.
  4. Consider the linear system;

    \begin{displaymath}
\begin{array}{r}
x_1-2x_2+4x_3=6\\
8x_1-3x_2+2x_3=2\\
-1x_1+10x_2+2x_3=4\\
\end{array}\end{displaymath}

    viii
    Solve this system by Gaussian elimination with pivoting. How many row interchanges are needed?
    ix
    What is the value of determinant?
    x
    Obtain the $LU$ decomposition of the system.
    xi
    Repeat without any row interchanges (only for the first item). Do you get the same results? Why?



Cem Ozdogan 2009-11-15