13.07.2015 Views

Mathematical Methods for Physics and Engineering - Matematica.NET

Mathematical Methods for Physics and Engineering - Matematica.NET

Mathematical Methods for Physics and Engineering - Matematica.NET

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

NUMERICAL METHODSappreciate how this would apply in (say) a computer program <strong>for</strong> a 1000-variablecase, perhaps with un<strong>for</strong>seeable zeros or very small numbers appearing on theleading diagonal.◮Solve the simultaneous equations(a) x 1 +6x 2 −4x 3 = 8,(b) 3x 1 −20x 2 +x 3 = 12,(c) −x 1 +3x 2 +5x 3 = 3.(27.22)Firstly, we interchange rows (a) <strong>and</strong> (b) to bring the term 3x 1 onto the leading diagonal. Inthe following, we label the important equations (I), (II), (III), <strong>and</strong> the others alphabetically.A general (i.e. variable) label will be denoted by j.(I) 3x 1 −20x 2 +x 3 = 12,(d) x 1 +6x 2 −4x 3 = 8,(e) −x 1 +3x 2 +5x 3 = 3.For (j) = (d) <strong>and</strong> (e), replace row (j) byrow (j) − a j1× row (I),3where a j1 is the coefficient of x 1 in row (j), to give the two equations(II)( )6+20 x23+ ( )−4 − 1 x33= 8− 12 3(f)( )3 −20 x23+ ( )5+ 1 x33= 3+ 12 3Now |6+ 2020| > |3 − | <strong>and</strong> so no interchange is required be<strong>for</strong>e the next elimination. To3 3eliminate x 2 ,replacerow(f)by( )−113row (f) − × row (II).This gives[(III) 16] (−13) x3 =7+ 11 3 38 338Collecting together <strong>and</strong> tidying up the final equations, we have(I) 3x 1 −20x 2 +x 3 = 12,(II) 38x 2 −13x 3 = 12,(III) x 3 = 2.Starting with (III) <strong>and</strong> working backwards, it is now a simple matter to obtainx 1 =10, x 2 =1, x 3 =2. ◭38327.3.2 Gauss–Seidel iterationIn the example considered in the previous subsection an explicit way of solvinga set of simultaneous equations was given, the accuracy obtainable being limitedonly by the rounding errors in the calculating facilities available, <strong>and</strong> the calculationwas planned to minimise these. However, in some situations it may be thatonly an approximate solution is needed. If, <strong>for</strong> a large number of variables, this is996

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!