8 Systems PDF

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 107

 At the end of the period, you should be

able to:
 Solve systems of equations using
gaussian elimination or gauss-jordan
elimination.
 Solve systems of equations using gauss-
seidel or gauss-jacobi.
 Solve non linear systems of equations
Naïve Gaussian
Elimination
 A system of equations is a collection of two or more
equations with a same set of unknowns.
 In solving a system of equations, we try to find
values for each of the unknowns that will satisfy
every equation in the system.
 The equations in the system can be linear or non-
linear.
 The problem can be expressed in narrative form or
the problem can be expressed in algebraic form.
 Example of a narrative statement of a system of
the equations:
 The air-mail rate for letters to Europe is 45
cents per half-ounce and to Africa as 65 cents
per half-ounce. If Shirley paid $18.55 to send
35 half-ounce letters abroad, how many did she
send to Africa?
 Example of an algebraic statement of the same
system of the equations:
0.45 x  0.65 y  18.55
x  y  35
 A method to solve simultaneous linear equations of
the form [A][X]=[C]
 Two steps
1. Forward Elimination
2. Back Substitution
 The goal of forward elimination is to transform
the coefficient matrix into an upper triangular
matrix
 25 5 1  x1  106.8 
 64 8 1  x   177.2 
   2  
144 12 1  x3  279.2

25 5 1   x1   106.8 
 0  4.8  1.56  x    96.21
   2  
 0 0 0.7   x3   0.735 
 A set of n equations and n unknowns
a11x1  a12 x2  a13 x3  ...  a1n xn  b1
a21x1  a22 x2  a23 x3  ...  a2 n xn  b2
. .
. .
. .
an1x1  an 2 x2  an3 x3  ...  ann xn  bn

(n-1) steps of forward


elimination
 Step 1:
 For Equation 2, divide Equation 1 by a11 and
multiply by a21 .

 a21 
 a (a11x1  a12 x2  a13 x3  ...  a1n xn  b1 )
 11 
a21 a21 a21
a21x1  a12 x2  ...  a1n xn  b1
a11 a11 a11
 Subtract the result from Equation 2.
a21x1  a22 x2  a23 x3  ...  a2 n xn  b2
a21 a21 a21
− a21x1  a a12 x2  ...  a a1n xn  a b1
_________________________________________________
11 11 11

 a21   a21  a21


 a22  a12  x2  ...   a2 n  a1n  xn  b2  b1
 a11   a11  a11

or a x  ...  a x  b
'
22 2
'
2n n
'
2
 Repeat this procedure for the remaining
equations to reduce the set of equations
as a11x1  a12 x2  a13 x3  ...  a1n xn  b1
'
a22 x2  a23
'
x3  ...  a2' n xn  b2'
'
a32 x2  a33
'
x3  ...  a3' n xn  b3'
. . .
. . .
. . .

an' 2 x2  an' 3 x3  ...  ann


'
xn  bn'

End of Step 1
 Step 2:
 Repeat the same procedure for the 3rd
term of Equation 3.
a11x1  a12 x2  a13 x3  ...  a1n xn  b1
'
a22 x2  a23
'
x3  ...  a2' n xn  b2'
"
a33 x3  ...  a3" n xn  b3"
. .
. .
. .

an" 3 x3  ...  ann


"
xn  bn"
End of Step 2
 At the end of (n-1) Forward Elimination steps, the
system of equations will look like
a11 x1  a12 x2  a13 x3  ...  a1n xn  b1
'
a22 x2  a23
'
x3  ...  a2' n xn  b2'
"
a33 x3  ...  a3" n xn  b3"
. .
. .
. .

 n 1 n 1 
ann xn  bn

End of Step (n-1)


 Matrix Form at End of Forward Elimination

a11 a12 a13  a1n   x1   b1 


 0 a' a'23  a'2 n   x2   b2' 
 22    
0 0 a"
33  a3n   x3    b3 
" "

    
           
 0 0 0 0 ann   xn  bn 
(n1 )
    (n-1 )
 Back Substitution
 Solve each equation starting from the last
equation

 Start with the last equation because it


has only one unknown

( n 1)
b
xn  n
( n 1)
a nn
 Back Substitution
bn( n 1)
x n  ( n 1)
a nn

bii 1  ai,ii11 xi 1  ai,ii12 xi  2  ...  ai,in1 xn


xi  i 1 for i  n  1,...,1
aii
i 1
  aiji 1 x j
n
bi
j i 1
xi  i 1 for i  n  1,...,1
a ii
 The upward velocity of a rocket
is given at three different times
Table 1 Velocity vs. time data.
Time, t s  Velocity, v m/s 
5 106.8
8 177.2
12 279.2

 The velocity data is approximated by a polynomial


as: vt   a t 2  a t  a , 5  t  12.
1 2 3

 Find the velocity at t=6 seconds .


 Assume
vt   a1t 2  a2t  a3 , 5  t  12.

 Results in a matrix template of the form:


t12 t1 1  a1   v1 
 2   a   v 
t 2 t2 1  2  2
t32 t3 1 
 a3 
  v3 

 

 Using data from Table 1, the matrix becomes:


 25 5 1  a1  106.8 
 64 8 1 a   177.2 
   2  
144 12 1  a3  279.2
 25 5 1  a1  106.8   25 5 1  106.8 
 64 8 1 a 2   177.2    64 8 1  177.2 
       
144 12 1  a3  279.2 144 12 1  279.2

 Forward Elimination
 Back Substitution
 Forward Elimination: Step 1
 25 5 1  106.8 
 
 64 8 1  177.2 
144 12 1  279.2

Divide Equation 1 by 25 64 8 1  177.2


and multiply it by 64,
.

 64 12.8 2.56  273.408


Subtract the result from 0  4.8  1.56   96.208
Equation 2

Substitute new equation for  25 5 1  106.8 


Equation 2 
0  4.8  1.56   96.208

 
144 12 1  279.2 
 Forward Elimination:
 25 5 1  106.8 
 
 0  4.8  1.56   96.208
144 12 1  279.2 

Divide Equation
.
1 by 25 and
multiply it by 144,
Subtract the result from
144 12 1  279.2
 144 5.76  615.168
Equation 3
28.8
0  16.8  4.76   335.968

25  106.8 
Substitute new equation for 
5 1

   
Equation 3  0 4.8 1.56 96.208 
 0  16.8  4.76   335.968
 Forward Elimination:
25 5 1  106.8 
 
 0  4.8  1.56   96.208 
 0  16.8  4.76   335.968

Divide Equation 2 by −4.8


and multiply it by −16.8
0  16.8  4.76  335.968
Subtract the result from  0  16.8  5.46   336.728
Equation 3
0 0 0.7  0.76

Substitute new equation for 25 5 1  106.8 


 
Equation 3  0  4.8  1.56   96.208
 0 0 0.7  0.76 
 Back Substitution
25 5 1  106.8  25 5 1   a1   106.8 
      
 0  4.8  1.56   96.2    0  4.8  1.56 a
  2    96.208
 0 0 0.7  0.7   0 0 0.7  a 3   0.76 

 Solving for a3

0.7a 3  0.76
0.76
a3 
0 .7
a 3  1.08571
 Back Substitution
25 5 1   a1   106.8 
    
 0  4.8  1.56 a
  2    96.208
 0 0 0.7  a 3   0.76 

 Solving for a2

4.8a 2  1.56a 3  96.208


 96.208  1.56a 3
a2 
 4. 8
 96.208  1.56  1.08571
a2 
 4.8
a 2  19.6905
 Back Substitution
 25 5 1   a1   106.8 
    
 0  4.8  1.56 a
  2    96.2 
 0 0 0.7  a 3   0.76 
 Solving for a1

25a1  5a 2  a 3  106.8
106.8  5a 2  a 3
a1 
25
106.8  5  19.6905  1.08571

25
 0.290472
 Solution:
 a1  0.290472
 The solution   
a  19.6905

 2  
vector is a 3   1.08571 

 The polynomial that passes through the three


data points is then:
v t   a1t 2  a 2 t  a 3
 0.290472t 2  19.6905t  1.08571, 5  t  12

v 6  0.29047262  19.69056  1.08571


 129.686 m/s .
 Pitfall#1. Division by zero

10 x 2  7 x 3  3
6 x1  2 x 2  3 x 3  11
5 x1  x 2  5 x 3  9

0 10  7  x1   3 
    
6 2 3   x 2   11
5  1 5   x 3   9 
 Is division by zero an issue here?

12 x1  10 x2  7 x3  15
6 x1  5 x2  3 x3  14
5 x1  x2  5 x3  9

12 10  7   x1  15
6 5    
3   x2   14 

 5  1 5   x3   9 
12 x1  10 x2  7 x3  15
6 x1  5 x2  3 x3  14
24 x1  x2  5 x3  28

12 10  7   x1  15  12 10  7   x1   15 


6   x   14  0 0 6.5   x   6.5
 5 3   2      2  
 24  1 5   x3   28 12  21 19   x3    2

 Division by zero is a possibility at any step of


forward elimination.
 Pitfall#2. Large Round-off Errors

 20 15 10  x1   45 
 3  2.249 7   x   1.751
   2  
 5 1 3   x3   9 

 x1  1
 x   1
 2   Exact Solution
 x3  1
 Pitfall#2. Large Round-off Errors
 20 15 10  x1   45 
 3  2.249 7   x   1.751
   2  
 5 1 3   x3   9 

 Solve it using 6 significant digits with chopping


 x1   0.9625 
 x    1.05 
 2  
 x3  0.999995
 20 15 10  x1   45 
 3  2.249 7   x   1.751
   2  
 5 1 3   x3   9 

 Solve it using 5 significant digits with chopping


 x1   0.625 
 x    1.5 
 2  
 x3  0.99995
 Is there a way to reduce the round off error?
 Avoiding Pitfalls

 Increase the number of significant


digits
 Decreases round-off error
 Does not avoid division by zero
 Avoiding Pitfalls

 Gaussian Elimination with


Partial Pivoting
 Avoids division by zero
 Reduces round off error
Gauss
Elimination with Partial Pivoting
At the beginning of the kth step of
forward elimination, find the
maximum of
akk , ak 1,k ,................, ank

If the maximum of the values is a pk


in the p th row, k  p  n,
then switch rows p and k.
6 14 5.1 3.7 6   x1   5 
0  7 6 1 2   x2   6
    
0 4 12 1 11  x3    8 
    
 0 9 23 6 8 x
   
4 9
0  17 12 11 43  x5   3 
 Which two rows would you switch?
6 14 5.1 3.7 6   x1   5 
0  17 12 11 43  x   3 
  2   
0 4 12 1 11  x3    8 
    
 0 9 23 6 8 x
   
4 9
0  7 6 1 2   x5   6

 Switched Rows
 Forward Elimination
Same as naïve Gauss elimination
method except that we switch rows
before each of the (n-1) steps of
forward elimination.
 Solve the following set of equations by
Gaussian elimination with partial pivoting

 25 5 1  a1  106.8 
 64 8 1 a 2   177.2 
     
144 12 1  a3  279.2
 25 5 1  a1  106.8   25 5 1  106.8 
 64 8 1 a   177.2    
    
2   64 8 1  177.2 
144 12 1  a3  279.2 144 12 1  279.2

 Forward Elimination
 Back Substitution
 Examine absolute values of first column,
first row and below.
 Largest absolute value is 144 and exists
in row 3. Switch row 1 and row 3.

 25 5 1  106.8  144 12 1  279.2


 64 8 1  177.2    64 8 1  177.2 
   
144 12 1  279.2  25 5 1  106.8 
 Forward Elimination:
144 12 1  279.2
 
 64 8 1  177.2 
.
 25 5 1  106.8 

144 12 1  279.2
 
 0 2.667 0.5556  53.10 
 0 2.917 0.8264  58.33
 Forward Elimination:
Examine absolute values of second
column, second row and below.
 Largest absolute value is 2.917 and exists
in row 3. Switch row 2 and row 3.
144 12 1  279.2 144 12 1  279.2
   
 0 2.667 0.5556  53.10   0 2.917 0.8264  58.33
 0 2.917 0.8264  58.33  0 2.667 0.5556  53.10
 Forward Elimination:
144 12 1  279.2
 
 0 2.917 0.8264  58.33 
 0 2.667 0.5556  53.10
.

144 12 1  279.2 
 
 0 2.917 0.8264  58.33 
 0 0  0.2   0.23
 Back Substitution
144 12 1  279.2  144 12 1   a1   279.2 
       
 0 2.917 0.8264  58 .33    0 2 .917 0 .8264  a
 2   58 .33 
 0 0  0.2   0.23  0 0  0 .2  a 3   0 .23

Solving for a3
0.2a 3  0.23
 0.23
a3 
 0.2
 1.15
 Back Substitution
 Solving for a2
2.917a 2  0.8264a 3  58.33
58.33  0.8264a 3
a2 
2.917
58.33  0.8264 1.15

2.917
 19.67
 Back Substitution
 Solving for a1
144a1  12a 2  a 3  279.2
279.2  12a 2  a 3
a1 
144
279.2  12  19.67  1.15

144
 0.2917
 25 5 1  a1  106.8 
 64     
 8 1 a
   
2  177 .2 
144 12 1 a 3   279.2

 a1  0.2917
   
a 2    19.67 
a 3   1.15 
 Example:
 Use Naïve Gauss elimination to solve
20 x1  15 x 2  10 x 3  45
 3 x1  2.249x 2  7 x 3  1.751
5 x1  x 2  3 x 3  9

 Use six significant digits with


chopping in your calculations.
Answer:

Working in the matrix form


 20 15 10  x1   45 
    
  3  2.249 7 x
   2  1.751
 5 1 3   x 3   9 

Divide Row 1 by 20 and then multiply it by –3. Subtract


the result from Row 2.
Divide Row 1 by 20 and then multiply it by 5. Subtract
the result from Row 3.
20 15 10   x1   45 
    
 0 0.001 8.5 x
   2  8.501 
 0  2.75 0.5  x 3   2.25
=

We can now solve the above equations by back


substitution. From the third equation,
23375.5 x3  23375.4  x3  0.999995

Substituting the value of in the second equation


0.001x2  8.5 x3  8.501  x3  1.05

Substituting the value of and in the first equation,


20 x1  15 x2  10 x3  45  x3  0.9625

Hence the solution is  x1   0.9625 


   
[ X ]   x 2    1.05 
 x 3  0.999995

Compare this with the exact solution of [1,1,1].


=

To decrease the error: Second step


The absolute value of the second column elements below
Row 1 is 0.001 or 2.75.
So the largest absolute value is in Row 3. So Row 2 is
switched with Row 3.
20 15 10   x1   7 
    
 0  2.75 0.5   x 2    2.25
 0 0.001 8.5  x 3   8.501 

Divide Row 2 by –2.75 and then multiply it by 0.001.


Subtract the result from Row 3
 20 15 10   x1   45 
    
 0  2 .75 0.5 x
  2   2.25 
 0 0  
8.5001  x 3  8.5001
 
We can now solve the above equations by back
substitution. From the third equation,
8.5001 x 3  8.5001  x3  1

Substituting the value of in the second equation


 2.75 x 2  0.5 x 3  2.25  x2  1

Substituting the value of and in the first equation,


20 x1  15 x 2  10 x 3  45  x1  1

Hence the solution is  x1  1


   
[ X ]   x 2   1
 x 3  1

Compare this with the exact solution of [1,1,1].


If a multiple of one row of [A]nxn is
added or subtracted to another row of
[A]nxn to result in [B]nxn then
det(A)=det(B)
 Theorem of Determinants
The determinant of an upper
triangular matrix [A]nxn is given by
det A   a11  a22  ...  aii  ...  ann
n
  a ii
i 1
Using forward elimination to transform
[A]nxn to an upper triangular matrix,
[U]nxn.
Ann  U  nn
det  A  det U 
 Using naïve Gaussian elimination find the
determinant of the following square matrix.

 25 5 1
 64 8 1
 
144 12 1
 After forward elimination
 25 5 1 25 5 1 
   
 64 8 1    0  4.8  1.56 
. 144 12 1  0 0 0.7 

det A   u11  u22  u33


 25   4.8  0.7
 84.00
 Gauss–Jordan elimination, a procedure
that further reduces the coefficient
matrix to the point where back-
substitution is no longer necessary
after forward elimination.
.

 In linear algebra, Gauss–Jordan


elimination is an algorithm for getting
matrices in reduced row echelon form
using elementary row operations.
 It is a variation of Gaussian
elimination.
 Gaussian elimination places zeros
below each pivot in the matrix,
starting with the top row and
.

working downwards.
 Matrices containing zeros below
each pivot are said to be in row
echelon form.
 Gauss–Jordan elimination goes a
step further by placing zeros
above and below each pivot; such
matrices are said to be in reduced
row echelon form.
.

 Every matrix has a reduced row


echelon form, and Gauss–Jordan
elimination is guaranteed to find
it.
GAUSS-SEIDEL METHOD
 In numerical linear algebra , the Gauss–Seidel
method, also known as the Liebmann method or the
method of successive displacement, is an iterative
method used to solve a linear system of equations.
 It is named after the German mathematicians Carl
Friedrich Gauss and Philipp Ludwig von Seidel.
 Though it can be applied to any matrix with non-
zero elements on the diagonals, convergence is only
guaranteed if the matrix is either diagonally
dominant or symmetric.
 Basic Procedure:
- Algebraically solve each linear equation for xi
- Assume an initial guess solution array
- Solve for each xi and repeat
- Use absolute relative approximate error after
each iteration to check if error is within a pre-
specified tolerance.
 Algorithm:
 A set of n equations and n unknowns:
a11x1  a12 x2  a13 x3  ...  a1n xn  b1
a21x1  a22 x2  a23 x3  ...  a2n xn  b2
. .
. .
. .

an1x1  an 2 x2  an3 x3  ...  ann xn  bn

 If the diagonal elements are non-zero


 Rewrite each equation solving for the corresponding
unknown:
 First equation, solve for x1
c  a x  a13 x3   a1n xn
x1  1 12 2
a11
 Solve for x2’ x3, . . . , xn
c2  a21 x1  a23 x3   a2 n xn
x2 
a22
  
cn 1  an 1,1 x1  an 1, 2 x2   an 1,n  2 xn  2  an 1,n xn
xn 1 
an 1,n 1
cn  an1 x1  an 2 x2    an ,n 1 xn 1
xn 
ann
 Rewrite each equation solving for the corresponding
unknown:
 General Form for any row ‘i’

n
ci   aij x j
j 1
j i
xi  , i  1,2,, n.
aii
 Solve for the unknowns  x1 
x 
 Assume an initial guess for [X]  2
  
 
 xn -1 
 xn 

 Use rewritten equations to solve for each value


of xi.
 Important: Remember to use the most recent
value of xi. Which means to apply values
calculated to the calculations remaining in the
current iteration.
 Calculate the Absolute Relative Approximate Error

xinew  xiold
a i  new
100
xi

 So when has the answer been found?

 The iterations are stopped when the absolute


relative approximate error is less than a
prespecified tolerance for all unknowns.
The upward velocity of a rocket is
given at three different times

Time, t s  Velocity, v m/s 


5 106.8
8 177.2
12 279.2

The velocity data is approximated by a polynomial as:


vt   a1t 2  a 2 t  a3 , 5  t  12.
Find the velocity at t=6 seconds .
 The system of equations becomes
 25 5 1  a1  106.8 
 64 8 1 a   177.2 
   2  
144 12 1 a 3   279.2

 Initial Guess: Assume an initial guess of


 a1  1 
   
 a 2    2
a 3   5
 a1  1 
 Applying the initial guess and solving for ai    
 a 2    2
a 3   5
106.8  5( 2)  (5)
a1   3.6720
25

177.2  643.6720  5


a2   7.8510
8

279.2  1443.6720  12 7.8510


a3   155.36
1

 At the end of the first iteration


 a1   3.6720 
   
a
  
2   7.8510 
a 3    155.36
 Finding the absolute relative approximate error
x inew  x iold
a i   100
new
xi

3.6720 1.0000
a 1  x100  72.76%
3.6720

 7.8510 2.0000
a 2  x100  125.47%
 7.8510

 155.36  5.0000
a 3  x100  103.22%
 155.36
 At the end of the second iteration

 a1   12.056 
   
a
  
2   54. 882
a 3    798.54

 The maximum absolute relative approximate error


is 85.695%
 54.882   7.8510
a 2  x100  85.695%
 54.882
 Repeating more iterations, the following values are
obtained:
Iteration a1 a2 a3
1 3.6720 72.767 −7.8510 125.47 −155.36 103.22
2 12.056 69.543 −54.882 85.695 −798.34 80.540
3 47.182 74.447 −255.51 78.521 −3448.9 76.852
4 193.33 75.595 −1093.4 76.632 −14440 76.116
5 800.53 75.850 −4577.2 76.112 −60072 75.963
6 3322.6 75.906 −19049 75.972 −249580 75.931

 Notice – The relative errors are not decreasing at


any significant rate.
 Also, the solution is not converging to the true
solution.
 What went wrong?
 Even though done correctly, the answer is not
converging to the correct answer
 This example illustrates a pitfall of the Gauss-
Siedel method: not all systems of equations
will converge.
 Is there a fix?
 One class of system of equations always
converges: One with a diagonally dominant
coefficient matrix.
 Diagonally dominant: The coefficient on the
diagonal must be at least equal to the sum of the
other coefficients in that row and at least one
row with a diagonal coefficient greater than the
sum of the other coefficients in that row.
 Which coefficient matrix is diagonally dominant?

 2 5.81 34 124 34 56 


A   45 43 1  [ B ]   23 53 5 
123 16 1   96 34 129
 Given the system of equations
12 x1  3 x 2 - 5 x 3  1

x1  5 x 2  3 x 3  28

3 x1  7 x 2  13 x 3  76

 Solve using the Gauss-Siedel method with an


initial guess of
 x1  1
   
 x 2    0
 x 3  1
 Checking if the coefficient matrix is diagonally
dominant
a11  12  12  a12  a13  3   5  8

a22  5  5  a21  a23  1  3  4


a33  13  13  a31  a32  3  7  10
 The inequalities are all true and at least one row
is strictly greater than:
 Therefore: The solution should converge using
the Gauss-Siedel Method
 Rewriting each equation
1  3 x2  5 x3
x1 
12
28  x1  3 x3
x2 
5
76  3 x1  7 x2
x3 
13
1  30  51
x1   0.50000
12
28  0.5  31
x2   4.9000
5

76  30.50000  74.9000
x3   3.0923
13
 The absolute relative approximate error
0.50000 1.0000
a 1   100  100.00%
0.50000

 After Iteration #1
 x1   0.5000
   
x
  2  4 . 9000
 x 3   3.0923

 After Iteration #2
 x1  0.14679
   
x
 2   3 . 7153 
 x 3   3.8118 
 Repeating more iterations, the following values
are obtained
Iteration a1 a2 a3

1 0.50000 100.00 4.9000 100.00 3.0923 67.662


2 0.14679 240.61 3.7153 31.889 3.8118 18.876
3 0.74275 80.236 3.1644 17.408 3.9708 4.0042
4 0.94675 21.546 3.0281 4.4996 3.9971 0.65772
5 0.99177 4.5391 3.0034 0.82499 4.0001 0.074383
6 0.99919 0.74307 3.0001 0.10856 4.0001 0.00101

 The solution obtained


 x1  0.99919
 x    3.0001 
 2  
 x3   4.0001 
 Given the system of equations
3x1  7 x2  13x3  76
x1  5x2  3x3  28
12 x1  3x2  5 x3  1

 Solve using the Gauss-Siedel method with an


initial guess of
 x1  1
 x   0 
 2  
 x3  1
 Conducting six iterations, the following values are
obtained
Iteration a1 A2 a3

1 21.000 95.238 0.80000 100.00 50.680 98.027


2 −196.15 110.71 14.421 94.453 −462.30 110.96
3 −1995.0 109.83 −116.02 112.43 4718.1 109.80
4 −20149 109.90 1204.6 109.63 −47636 109.90
5 2.0364×105 109.89 −12140 109.92 4.8144×105 109.89
6 −2.0579×105 109.89 1.2272×105 109.89 −4.8653×106 109.89

 The values are not converging.


 Does this mean that the Gauss-Seidel method
cannot be used?
 If a system of linear equations is not diagonally
dominant, check to see if rearranging the
equations can form a diagonally dominant matrix.

 3 7 13 
A   1 5 3 
12 3  5
12 3  5
A   1 5 3 
 3 7 13 
 Not every system of equations can be rearranged
to have a diagonally dominant coefficient matrix.

x1  x2  x3  3
2 x1  3x2  4 x3  9

x1  7 x2  x3  9
NONLINEAR SYSTEMS
At the end of the lecture, the student
must be able to:
solve nonlinear systems of
equations using Gauss-Seidel
method.
solve nonlinear systems of
equations using Newton-Raphson
method.
Nonlinear systems can be solved using
the same strategy as the Gauss-Seidel
method.
solve each system for one of the
unknowns and update each unknown
using information from the previous
iteration.
This is called successive
substitution.
Example:
Solve the given system:
2
x  xy  10
2
y  3 xy  57
Answer: x 2  xy  10
y  3 xy 2  57

Update the formulas:


2
10  x n
xn 1 
yn
2
yn1  57  3 xn yn
Answer: 2
x  xy  10
2
y  3 xy  57

Update the formulas:

xn1  10  xn yn

57  yn
yn  1 
3 xn
Answer: 2
x  xy  10
2
y  3 xy  57

Initial guess:
x 0  1 .5
y 0  3 .5
Nonlinear systems may also be solved
using the Newton-Raphson method for
multiple variables.
For a two-variable system, we recall
the Taylor series approximation and
Newton-Raphson equation.
Recall: (for one equation, one unknown)
Find the root of f(x)=0
The 1st order Taylor series.
f  xn  1   f  xn   f  xn  x n  1  xn 

 The Newton-Raphson equation.


f  xn 
xn 1  xn 
f  x n 
For nonlinear system:
Find the solution u x , y   0
v x, y   0
The Taylor series.
ui ui
ui  1  ui  ( xi  1  xi )  ( yi  1  yi )  0
x y
v i v i
vi 1  vi  ( xi 1  xi )  ( yi  1  yi )  0
x y
The root of the equation occurs at the
value of x and y where ui+1=0 and vi+1=0
Rearrange to solve for xi+1 and yi+1

ui ui ui ui


xi 1  yi 1  ui  xi  yi
x y x y
vi vi vi vi
xi 1  yi 1  vi  xi  yi
x y x y
Since xi, yi, ui, and vi ui
vi are all known at ui
y
 vi
y
the i th iteration, xi 1  xi  u v u v
this represents a
i i
 i i
x y y x
set of two linear
equations with two
ui vi
unknowns, vi  ui
yi 1  yi  x x
xi+1 and yi+1 ui vi ui vi

x y y x
To facilitate memorization, we use
Jacobian matrix.
 ui ui   ui ui 
 x y   xi 1  ui   x y   xi 
          
 vi vi   yi 1   
vi   vi vi   yi 
 x y   x y 

 ui ui 
 x y 
Jacobian   
 vi vi 
 x y 
To facilitate memorization, we use
Jacobian matrix.
vi ui
ui  vi
y y  Solution for the two-
xi 1  xi  equation version of the N-R Method
ui vi ui vi using Cramer’s rule.

x y y x
Determinant of the Jacobian
of the system.
ui vi
vi  ui
yi 1  yi  x x
ui vi ui vi

x y y x
Example:
2
Solve the given system: x  xy  10
2
y  3 xy  57

Answer:
Rewrite the equations:
u x , y   x 2  xy  10
v  x , y   y  3 xy 2  57
Answer:
Evaluate the derivatives:
u x , y   x  xy  10
2

v  x , y   y  3 xy  57
2

u v
 2x  y  3 y2
x x
u v
x  1  6 xy
y y
Answer:
Then substitute to the formula::
Exercise:
Solve the given system:
2 2
x  y  8.5
2 2
x  3 xy  y  2.75  0

x0  1 and y0  1
 Numerical Methods Using Matlab, 4th Edition,
2004 by John H. Mathews and Kurtis K. Fink
 Holistic Numerical Methods Institute by Autar
Kaw and Jai Pau.
 Numerical Methods for Engineers by Chapra
and Canale
 Systems of Nonlinear equations by Power
show.com

You might also like