COS2633_202_2_2020_A2 Solutions.pdf - COS2633 Tutorial...

This preview shows page 1 - 6 out of 23 pages.

BARCODE Define tomorrow. university of south africa Tutorial letter 202/2/2020 NUMERICAL METHODS I COS2633 Semester 2 Department of Mathematical Sciences This tutorial letter contains solutions for assignment 02. COS2633/202/2/2020
CONTENTS Page 1 Introduction ......................................................................................................................... 3 2 Marking Scheme ................................................................................................................. 3 3 Introduction ......................................................................................................................... 3 4 Model Solutions .................................................................................................................. 3 2
COS2633/202/2/2020 1 Introduction By this time you should have received the following tutorial matter: COS2633/101/3/2020 - General information about the module and the assignments COS2633/102/3/2020 - Background material COS2633/201/1/2020 - Solutions to Assignment 01 COS2633/202/1/2020 - Solutions to Assignment 02 (This Tutorial Letter) 2 Marking Scheme The following per question marks have been allocated: Question 1: 15 marks Question 2: 25 marks Question 3: 10 marks Question 4: 15 marks Question 5: 15 marks Question 6: 15 marks Question 7: 15 marks 3 Introduction This assignment is aimed at providing opportunity for you to read through the entire syllabus for this course and to practise the methods covered in the various chapters not included in Assignment 01. If you put your own effort into the assignment, it should go a long way in preparing for the exam. 4 Model Solutions Question 1 This exercise is aimed at practising the use of direct methods to solve linear systems. The given system is a very stable system because the coefficients are fairly comparable and hence it should solve reasonably well due to less error propagation. It is worth pointing out that when carrying out computations manually it is advisable to retain about five decimal places to reduce round off error. A rough guide for the number of decimal places to retain is that if the numbers given have at least four decimal places, you should retain that many decimal places also. 3
(1.1) Matrix form: 0 . 050000 0 . 070000 0 . 060000 0 . 050000 0 . 070000 0 . 100000 0 . 080000 0 . 070000 0 . 060000 0 . 080000 0 . 100000 0 . 090000 0 . 050000 0 . 070000 0 . 090000 0 . 100000 x 1 x 2 x 3 x 4 = 0 . 23 0 . 32 0 . 33 0 . 31 (1.2) The true solution of the system (long format computer arithmetic) is x = ( x 1 , x 2 , x 3 , x 4 ) = (1 , 1 , 1 , 1) , obtainable by the Matlab/Octave command x = A \ b . (a) Augmented matrix [ A | b ] is 0 . 050000 0 . 070000 0 . 060000 0 . 050000 0 . 230000 0 . 070000 0 . 100000 0 . 080000 0 . 070000 0 . 320000 0 . 060000 0 . 080000 0 . 100000 0 . 090000 0 . 330000 0 . 050000 0 . 070000 0 . 090000 0 . 100000 0 . 310000 NB: Basic Gaussian elimination without pivoting means no row exchanges. Multipliers (these are useful in working question 1.2(c)): m 21 = a 21 /a 11 = 1 . 4; m 31 = a 31 /a 11 = 1 . 2; m 41 = a 41 /a 11 = 1 Reducing using these: R 2 = R 2 - m 21 R 1 ; R 4 = R 4 - m 41 R 1 to get C (1) = 0 . 0500 0 . 0700 0 . 0600 0 . 0500 0 . 2300 0 0 . 0020 - 0 . 0040 0 - 0 . 0020 0 - 0 . 0040 0 . 0280 0 . 0300 0 . 0540 0 0 0 . 0300 0 . 0500 0 . 0800 whose multipliers are: m 32 = a 32 /a 22 = - 2 . 0; m 42 = a 42 /a 22 = 0 Reduction using these: R 3 = R 3 - m 32 R 2 ; R 4 = R 4 - m 42 R 2 , C (2) = 0 . 0500 0 . 0700 0 . 0600 0 . 0500 0 . 2300 0 0 . 0020 - 0 . 0040 0 - 0 . 0020 0 0 0 . 0200 0 . 0300 0 . 0500 0 0 0 . 0300 0 . 0500 0 . 0800 The last multiplier is m 43 = a 43 /a 33 = 1 . 5 . Reducing R 4 leads to C (3) = 0 . 0500 0 . 0700 0 . 0600 0 . 0500 0 . 2300 0 0 . 0020 - 0 . 0040 0 - 0 . 0020 0 0 0 . 0200 0 . 0300 0 . 0500 0 0 0 0 . 0050 0 . 0050 Back substitution leads to ( x 1 , x 2 , x 3 , x 4 ) = (1 , 1 , 1 , 1) . 4
COS2633/202/2/2020 (b) For Gaussian elimination with scaled partial pivoting we begin with computing s i = max {| A ( i, j ) , i = 1 : 4 } s = { s 1 , s 2 , s 3 , s 4 } = { 0 . 07 , 0 . 10 , 0 . 10 , 0 . 10 } . These values will be used in all the compu- tations that follow, in the order that will be determined by necessary row interchanges.

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture