CE5143 Homework 4 (Continued)

David Wagner 2007/10/03 13:12

2. Problem #3.57

|xi(x+1) - xi(x)| ≤ 10-2 ; i=1,2,3,4

In Problems 3.56 and 3.57, solve the given system of equations using the Jacobi iteration method with the initial approximation, x(1) = 0.

  • 3x_1-x_2-x_4=-3;
  • -x_1+3x_2-x_3=2;
  • -x_2+4x_3-x_4=6;
  • -x_1-x_3+4x_4=12.

Diagonally dominant

  • 3 > 1+1✔;
  • 3 > 1+1✔;
  • 4 > 1+1✔;
  • 4 > 1+1✔.

Solve each equation for its diagonal variable

  • x_1={1/3}(x_2+x_4-3);
  • x_2={1/3}(x_1+x_3+2);
  • x_3={1/4}(x_2+x_4+6);
  • x_4={1/4}(x_1+x_3+12).

x(1) = 0

  • x_1={1/3}(x_2+x_4-3)={1/3}(0-3)=-1;
  • x_2={1/3}(x_1+x_3+2)={1/3}(0+2)=2/3;
  • x_3={1/4}(x_2+x_4+6)={1/4}(0+6)=3/2;
  • x_4={1/4}(x_1+x_3+12)={1/4}(0+12)=3.

x(2) = {-1, 2/3, 3/2, 3} →

  • x_1={1/3}(x_2+x_4-3)={1/3}({2/3}+3-3)=0.2222;
  • x_2={1/3}(x_1+x_3+2)={1/3}(-1+{3/2}+2)=0.8333;
  • x_3={1/4}(x_2+x_4+6)={1/4}({2/3}+3+6)=2.4167;
  • x_4={1/4}(x_1+x_3+12)={1/4}(-1+{3/2}+12)=3.1250.

x(3) = {0.2222, 0.8333, 2.4167, 3.1250} →

  • x_1={1/3}(x_2+x_4-3)={1/3}(0.8333+3.125-3)=0.3194;
  • x_2={1/3}(x_1+x_3+2)={1/3}(0.2222+2.4167+2)=1.5463;
  • x_3={1/4}(x_2+x_4+6)={1/4}(0.8333+3.1256+6)=2.4897;
  • x_4={1/4}(x_1+x_3+12)={1/4}(0.2222+2.4167+12)=3.6597.

x(4) = {0.3194, 1.5463, 2.4897, 3.6597}→

  • x_1={1/3}(x_2+x_4-3)={1/3}(1.5463+3.6597-3)=0.7353;
  • x_2={1/3}(x_1+x_3+2)={1/3}(0.3194+2.4897+2)=1.6030;
  • x_3={1/4}(x_2+x_4+6)={1/4}(1.5463+3.6597+6)=2.8015;
  • x_4={1/4}(x_1+x_3+12)={1/4}(0.3194+2.4897+12)=3.7023.

Fourth iteration complete, as assigned. Convergence criteria not yet met.

  • |x^{4}_1 - x^{3}_1|=0.4159 > 10-2
  • |x^{4}_2 - x^{3}_2|= (already failed convergence test)
  • |x^{4}_3 - x^{3}_3|=
  • |x^{4}_4 - x^{3}_4|=
Iteration5 6 7 8 9 10 11 12
x10.7353 0.7684 0.9099 0.9212 0.9694 0.9732 0.9896 0.9909
x21.6030 1.8456 1.8649 1.9475 1.9540 1.9821 1.9844 1.9939
x32.8015 2.8263 2.9325 2.9409 2.9770 2.9799 2.9922 2.9932
x43.7023 3.8842 3.8987 3.9606 3.9655 3.9866 3.9883 3.9954
Δx10.4159 0.0331 0.1415 0.0113 0.0482 0.0038 0.0164 0.0013
Δx20.0567 0.2426 0.0193 0.0825 0.0066 0.0281 0.0022 0.0096
Δx30.3118 0.0248 0.1061 0.0084 0.0361 0.0029 0.0123 0.0010
Δx40.0426 0.1819 0.0145 0.0619 0.0049 0.0211 0.0017 0.0072
x={1,2,3,4}

3. Problem #3.66

//Solve the following tridiagonal system of equations using LU decomposition://

  • 5x_1+4x_2=13;
  • 4x_1-3x_2+7x_3=19;
  • x_2-6x_3+4x_4=0;
  • 12x_3+2x_4=44.

delim{[}{matrix{4}{4}{
5  4  0 0  
4 -3  7 0  
0  1 -6 4  
0  0 12 2}}{]}
delim{lbrace}{matrix{4}{1}{x_1 x_2 x_3 x_4}}{rbrace}=
delim{lbrace}{matrix{4}{1}{13 19 0 44}}{rbrace} l_11 = a_11 =5;

u_12= {a_12/l_11} = 4/5 =0.8000.

n=4;i=(2,3)

l_21=a_21=4; l_22=a_22-l_21 u_12=-3 -(4)(4/5)=-6.2; u_23={a_23/l_22}=7/6.2approx-1.1290

l_32=a_32=1 l_33=a_33- l_32 u_23=-6-(1)(-1.1290)approx-4.8710 u_34={a_34/l_33}={4/-4.8710}approx-0.8212

l_43=a_43=12; l_44=a_44-l_43 u_34 =2-(12)(-0.8212)approx11.8543;

z_1=b_1/l_11=13/5=2.6000.

i=(2,3,4) z_2={{b_2-l_21 z_1}/l_22}={{19-(4)( 2.6)}/-6.2}approx-1.3871; z_3={{b_3-l_32 z_2}/l_33}={{0-(1) (-1.3871)}/-4.8710}approx-0.2848; z_4={{b_4-l_43 z_3}/l_44}={{44-(12) (-0.2848)}/11.8543}approx4.0000.

x_4=z_4=4.0000; x_3=z_3-u_34 x_4 approx -0.2848-(-0.8212)(4) approx 2.9996 approx3 x_2=z_2-u_23 x_3 approx -1.3871-(-1.1290)(3) approx 1.9999 approx2 x_1=z_1-u_12 x_2 approx 2.6000-(0.8000)(2) =1

x={1,2,3,4}

Personal Tools