Assignment 2 - Solving Sets of Equations

  1. Solve the following linear system by using Gauss-Jordan Method;

    \begin{displaymath}
\begin{array}{r}
x_1+2x_2+x_3+4x_4=13\\
2x_1+4x_3+3x_4=28...
... 4x_1+2x_2+2x_3+x_4=20\\
-3x_1+x_2+3x_3+2x_4=6\\
\end{array}\end{displaymath}

    Hint: Modify the MATLAB code for Upper Triangularization Followed by Back Substitution (uptrbk.m).
  2. Modify the MATLAB code for $PA=LU$:Factorization with Pivoting (lufact.m) so that $L,U$ and $P$ are output, then by using solve the following linear system;

    \begin{displaymath}
\begin{array}{r}
x_1+2x_2+4x_3+x_4=21\\
2x_1+8x_2+6x_3+4x...
...+10x_2+8x_3+8x_4=79\\
4x_1+12x_2+10x_3+6x_4=82\\
\end{array}\end{displaymath}

    Hints: You can check your results by using MATLAB as;
    >>[L,U,P]=lu(A)
    >>inv(P)*L*U
    
  3. Solve the following linear system by using Gauss-Seidel Iteration;

    \begin{displaymath}
\begin{array}{r}
4x-y+z=7\\
4x-8y+z=-21\\
-2x+y+5z=15\\
\end{array}\end{displaymath}

    Hint: Modify the MATLAB code for Jacobi Iteration (jacobi.m).


2005-07-17