SOLUTIONS
,Table of Contents
Acknowledgments ......................................................................................................................... iii
Table of Contents .......................................................................................................................... iv
CHAPTER 1. INTRODUCTION ................................................................................................... 1
1.2 Analytical Versus Numerical Analysis .................................................................................. 1
1.4 Applications .......................................................................................................................... 1
Computer Programs .................................................................................................................... 6
CHAPTER 2. MATRICES............................................................................................................. 9
2.1 Introduction........................................................................................................................... 9
2.2 Matrix Operations ............................................................................................................... 11
2.3 Vectors ............................................................................................................................... 14
2.4 Determinants. ...................................................................................................................... 17
2.5 Rank of a Matrix ................................................................................................................. 18
2.6 Applications ........................................................................................................................ 19
CHAPTER 3. INTRODUCTION TO NUMERICAL METHODS. ............................................... 20
3.1 Introduction......................................................................................................................... 20
3.2 Accuracy, Precision, and Bias ............................................................................................. 20
3.3 Significant Figures .............................................................................................................. 22
3.4 Analysis of Numerical Errors .............................................................................................. 23
CHAPTER 4. ROOTS OF EQUATIONS ..................................................................................... 27
4.1 Introduction......................................................................................................................... 27
4.2 Eigenvalue Analysis ............................................................................................................ 30
4.3 Direct-Search Method ......................................................................................................... 30
4.4 Bisection Method. ............................................................................................................... 32
4.5 Newton-Raphson Iteration. .................................................................................................. 35
4.6 Secant Method .................................................................................................................... 50
4.8 Synthetic Division ............................................................................................................... 55
4.9 Multiple Roots .................................................................................................................... 70
4.10 Systems of Nonlinear Equations ........................................................................................ 70
CHAPTER 5. SIMULTANEOUS LINEAR EQUATIONS........................................................... 72
5.2 Gaussian Elimination. ......................................................................................................... 72
5.3 Gauss-Jordan Elimination.................................................................................................... 74
5.5 LU Decomposition .............................................................................................................. 76
5.6 Iterative Equation-Solving Methods. ................................................................................... 81
5.6.1 Jacobi Iteration ........................................................................................................................................ 81
5.6.2 Gaussian-Seidel Iteration.......................................................................................................................... 85
5.6.3 Convergence Consideration of the Iterative Methods................................................................................. 90
5.7 Use of Determinants ............................................................................................................ 94
5.8 Matrix Inversion.................................................................................................................. 99
5.9 Applications ...................................................................................................................... 101
Computer Programs ................................................................................................................ 103
CHAPTER 6. NUMERICAL INTERPOLATION ...................................................................... 105
6.2 Method of Undetermined Coefficients ............................................................................... 105
6.3 Gregory-Newton Interpolation Method .............................................................................. 109
6.4 Finite Difference Interpolation .......................................................................................... 112
6.5 Newton’s Method.............................................................................................................. 114
6.6 Lagrange Polynomials ....................................................................................................... 119
6.7 Interpolation Using Splines ............................................................................................... 124
6.9 Multi-Dimensional Interpolation ....................................................................................... 133
CHAPTER 7. DIFFERENTIATION AND IN @@T
SeSE G
iesimiciR
sm iicsioA
sloaltT
aiotinI
oO
n N ......................................................... 135
, 7.1 Numerical Differentiation.................................................................................................. 135
7.2. Numerical Integration....................................................................................................... 142
CHAPTER 8. Differential Equations .......................................................................................... 150
8.1 Introduction....................................................................................................................... 150
8.2 Taylor Series Expansion .................................................................................................... 150
8.3 Euler’s Method.................................................................................................................. 154
8.4 Modified Euler’s Method .................................................................................................. 157
8.5 Runge-Kuta Methods ........................................................................................................ 159
8.6 Predictor-Corrector Methods ............................................................................................. 164
8.7 Least-Squares Method ....................................................................................................... 167
8.8 Garlekin Method ............................................................................................................... 170
8.9 Higher-Order Differential Equations ................................................................................. 172
8.10 Boundary Value Problems ............................................................................................... 172
8.11 Integral Equations ........................................................................................................... 176
CHAPTER 9. Data Description and Treatment ........................................................................... 177
9.2 Classification of Data ........................................................................................................ 177
9.3 Graphical Description of Data ........................................................................................... 177
9.5 Histograms and Frequency Diagrams ................................................................................ 185
9.6 Descriptive Measures ........................................................................................................ 187
CHAPTER 10. Curve Fitting and Regression Analysis ............................................................... 190
10.1 Introduction..................................................................................................................... 190
10.2 Correlation Analysis ........................................................................................................ 190
10.3 Introduction to Regression............................................................................................... 200
10.4 Principle of Least Squares ............................................................................................... 201
10.5 Reliability of the Regression Equation............................................................................. 204
10.8 Correlation Versus Regression......................................................................................... 207
10.9 Application of Bivariate Regression Analysis .................................................................. 209
10.8 Multiple Regression Analysis .......................................................................................... 213
10.9 Regression Analysis of Nonlinear Models ....................................................................... 220
CHAPTER 11. Numerical Optimization ..................................................................................... 238
11.1 Introduction..................................................................................................................... 238
11.2 The Response Surface Analysis ....................................................................................... 238
11.3 Numerical Least Squares ................................................................................................. 239
11.4 Steepest Descent Method ................................................................................................ 247
@LECTSOLUTIONSTUVIA
v
,
,CHAPTER 1. INTRODUCTION
1.2 Analytical Versus Numerical Analysis
Problem 1-1.
Solution not provided.
Problem 1-2.
The two methods differ on the basis of their respective algorithms. The analytical method is based
on analytical calculus while the numerical method is based on finite differences arithmetic.
Analytical approaches provide direct solutions and will result in exact solutions if they exist.
Analytical methods usually require less time to find a solution. Analytical solution procedure
becomes considerably more complex when constraints are involved. Numerical analysis, on the
other hand, can be used to find solutions of moderately complex problems, and it is quite easy to
include constraints on the unknowns in the solutions. However, numerical methods most often
require a considerable number of iterations in order to find a solution with a reasonable accuracy.
The solution provided by the numerical methods is usually not exact. Therefore, error analysis and
error estimations are required.
1.4 Applications
Problem 1-3.
2
cos( x) 1 x x4 .......
2! 4!
For h = 0.1
x = x0 + h = 0 + 0.1 = 0.1
cos(0.1) 1.00000000 (one term)
(0.1) 2
cos(0.1) 1 (two terms)
0.99500000 2
(0.1) 2 (0.1) 4
cos(0.1) 1 (three terms)
0.99500417
2 24
True value = 0.99500417
The following table summarizes the results for h = 0.1 to 1.0 in an increment of 0.1:
, f (x 0+h ) f (x 0+h ) f (x 0+h )
x h True value
one term two terms three terms
0.1 0.1 1.00000000 0.99500000 0.99500417 0.99500417
0.2 0.2 1.00000000 0.98000000 0.98006667 0.98006658
0.3 0.3 1.00000000 0.95500000 0.95533750 0.95533649
0.4 0.4 1.00000000 0.92000000 0.92106667 0.92106099
0.5 0.5 1.00000000 0.87500000 0.87760417 0.87758256
0.6 0.6 1.00000000 0.82000000 0.82540000 0.82533561
0.7 0.7 1.00000000 0.75500000 0.76500417 0.76484219
0.8 0.8 1.00000000 0.68000000 0.69706667 0.69670671
0.9 0.9 1.00000000 0.59500000 0.62233750 0.62160997
1.0 1.0 1.00000000 0.50000000 0.54166667 0.54030231
From the table above, it is clear that as the terms of the Taylor series are added incrementally, the
accuracy improves as compared with the true values. This is specially true as the separation
distance increases.
Problem 1-4.
3
sin( x) x x x5 .......
3! 5!
For h = 0.1
x = x0 + h = 0 + 0.1 = 0.1
sin(0.1) 0.100000000 (one term)
(0.1)3
sin(0.1) 0.1 (two terms)
0.09983333 6
(0.1) 3 (0.1)5
sin(0.1) 0.1 (three terms)
0.09983342
6 120
True value = 0.09983342
The following table summarizes the results for h = 0.1 to 1.0 in an increment of 0.1:
f (x 0+h ) f (x 0+h ) f (x 0+h )
x h True value
one term two terms three terms
0.1 0.1 0.10000000 0.09983333 0.09983342 0.09983342
0.2 0.2 0.20000000 0.19866667 0.19866933 0.19866933
0.3 0.3 0.30000000 0.29550000 0.29552025 0.29552021
0.4 0.4 0.40000000 0.38933333 0.38941867 0.38941834
0.5 0.5 0.50000000 0.47916667 0.47942708 0.47942554
0.6 0.6 0.60000000 0.56400000 0.56464800 0.56464247
0.7 0.7 0.70000000 0.64283333 0.64423392 0.64421769
0.8 0.8 0.80000000 0.71466667 0.71739733 0.71735609
0.9 0.9 0.90000000 0.77850000 0.78342075 0.78332691
1.0 1.0 1.00000000 0.83333333 0.84166667 0.84147098
From the table above, it is clear that as the terms of the Taylor series are added incrementally, the
accuracy improves as compared with the true values. This is specially true as the separation
distance increases.
,Problem 1-5.
x2
ex 1 x .......
2!
For h = 0.1
x = x0 + h = 0 + 0.1 = 0.1
e(0.1) 1.00000000 (one term)
(0.1)
e 1.0 0.1 (two terms)
1.10000000
(0.1) 2
e(0.1) 1.0 0.1 (three terms)
1.10500000
2
True value = 1.10517092
The following table summarizes the results for h = 0.1 to 1.0 in an increment of 0.1:
f (x 0+h ) f (x 0+h ) f (x 0+h )
x h True value
one term two terms three terms
0.1 0.1 1.00000000 1.10000000 1.10500000 1.10517092
0.2 0.2 1.00000000 1.20000000 1.22000000 1.22140276
0.3 0.3 1.00000000 1.30000000 1.34500000 1.34985881
0.4 0.4 1.00000000 1.40000000 1.48000000 1.49182470
0.5 0.5 1.00000000 1.50000000 1.62500000 1.64872127
0.6 0.6 1.00000000 1.60000000 1.78000000 1.82211880
0.7 0.7 1.00000000 1.70000000 1.94500000 2.01375271
0.8 0.8 1.00000000 1.80000000 2.12000000 2.22554093
0.9 0.9 1.00000000 1.90000000 2.30500000 2.45960311
1.0 1.0 1.00000000 2.00000000 2.50000000 2.71828183
From the table above, it is clear that as the terms of the Taylor series are added incrementally, the
accuracy improves as compared with the true values. This is specially true as the separation
distance increases.
Problem 1-6.
f ( x) = x 3 3x 2 5x f (2) = 16
10
f ' (2) = 5
f ' ( x) = 3x 2 6x 5 f '' (2) = 6
f '' ( x) = 6x 6
f ''' (2) = 6
f ''' ( x) = 6
f '''' (2) = 0
f '''' ( x) = 0
Referring to Eq. 1-1 in the textbook, the value of the function, f(x), can be approximated by:
f(x0 + h) 16 + 5h + 3h2 + h3
where x0 = 2
For h = 0.1
f(2.1) 16 (one term)
f(2.1) 16 + 5(0.1) = 16.5 (two terms)
f(2.1) 16 + 5(0.1) + 3(0.1)2 = 16.530 (three terms)
2 3
f(2.1) 16 + 5(0.1) + 3(0.1) + (0.1) = 16.531 (four terms)
,The following table summarizes the results for h = 0.1 to 1.0 in an increment of 0.1:
, f (x 0+h ) f (x 0+h ) f (x 0+h ) f (x 0+h )
x h True value
one term two terms three terms four terms
2.1 0.1 16.0000 16.5000 16.5300 16.5310 16.5310
2.2 0.2 16.0000 17.0000 17.1200 17.1280 17.1280
2.3 0.3 16.0000 17.5000 17.7700 17.7970 17.7970
2.4 0.4 16.0000 18.0000 18.4800 18.5440 18.5440
2.5 0.5 16.0000 18.5000 19.2500 19.3750 19.3750
2.6 0.6 16.0000 19.0000 20.0800 20.2960 20.2960
2.7 0.7 16.0000 19.5000 20.9700 21.3130 21.3130
2.8 0.8 16.0000 20.0000 21.9200 22.4320 22.4320
2.9 0.9 16.0000 20.5000 22.9300 23.6590 23.6590
3.0 1.0 16.0000 21.0000 24.0000 25.0000 25.0000
From the table above, it is clear that as the terms of the Taylor series are added incrementally, the
accuracy improves as compared with the true values. This is specially true as the separation
distance increases.
Problem 1-7.
f ( x) = x5 5x 4 x2 f (2) = -38
6
f ' ( x) = 5x 4 20x 3 2x f ' (2) = -76
f '' ( x) = 20x 3 60x 2 + 2 f '' (2) = -78
f ''' ( x) = 60x 2 - 120x f ' '' (2) = 0
f '''' ( x) = 120x 120 f '''' (2) = 120
f ''''' ( x) = 120 f ''''' (2) = 120
Referring to Eq. 1-1 in the textbook, the value of the function, f(x), can be approximated by:
f(x0 + h) -38 - 76h - 39h2 + 5h4 + h5
where x0 = 2
For h = 0.1
f(2.1) -38 (one term)
f(2.1) -38 - 76(0.1) = -45.6 (two terms)
f(2.1) -38 - 76(0.1) - 39(0.1)2 = -45.990 (three terms)
2 4
f(2.1) -38 -76(0.1) - 39(0.1) + 5(0.1) = -45.98950 (four terms)
f(2.1) -38 -76(0.1) - 39(0.1)2 + 5(0.1)4 + (0.1)5 = -45.98949 (five terms)
The following table summarizes the results for h = 0.1 to 1.0 in an increment of 0.1:
, f (x 0+h ) f (x 0+h ) f (x 0+h ) f (x 0+h ) f (x 0+h )
x h True value
one term two terms three terms four terms five terms
2.1 0.1 -38.00000 -45.60000 -45.99000 -45.98950 -45.98949 -45.98949
2.2 0.2 -38.00000 -53.20000 -54.76000 -54.75200 -54.75168 -54.75168
2.3 0.3 -38.00000 -60.80000 -64.31000 -64.26950 -64.26707 -64.26707
2.4 0.4 -38.00000 -68.40000 -74.64000 -74.51200 -74.50176 -74.50176
2.5 0.5 -38.00000 -76.00000 -85.75000 -85.43750 -85.40625 -85.40625
2.6 0.6 -38.00000 -83.60000 -97.64000 -96.99200 -96.91424 -96.91424
2.7 0.7 -38.00000 -91.20000 -110.31000 -109.10950 -108.94143 -108.94143
2.8 0.8 -38.00000 -98.80000 -123.76000 -121.71200 -121.38432 -121.38432
2.9 0.9 -38.00000 -106.40000 -137.99000 -134.70950 -134.11901 -134.11901
3.0 1.0 -38.00000 -114.00000 -153.00000 -148.00000 -147.00000 -147.00000
From the table above, it is clear that as the terms of the Taylor series are added incrementally, the
accuracy improves as compared with the true values. This is especially true as the separation
distance increases.
Problem 1-8.
f ( x) = x 2 5x 0.5 f (2) = 2.92893
6 f ' ( x) = 2 x 2.5x f ' (2) = 2.23223
0.5
f '' ( x) = 2 f '' (2) = 2.44194
1.5
1.25x f '''(2) = -0.33146
2.5
f ''' ( x) = 1.875x f '''' (2) = 0.41432
3.5
f '''' ( x) = 4.68750x
f ''''' (2) = -0.72506
4.5
f ''''' ( x) = -16.40625x
. .
. .
.
f n ( x) ................................................................................f (n) (2) .......
Referring to Eq. 1-1 in the textbook, the value of the function, f(x), can be approximated by:
f(x0 + h) 2.92893 + 2.23223h + 1.27097h2 - 0.05524h3 + 0.01726h4
where x0 = 2
For h = 0.1
f(2.1) 2.92893 (one term)
f(2.1) 2.92893 + 2.23223(0.1) = 3.15215 (two terms)
2
f(2.1) 2.92893 + 2.23223(0.1) + 1.27097(0.1) = 3.16486 (three terms)
f(2.1) 2.92893 + 2.23223(0.1) + 1.27097(0.1)2 - 0.05524(0.1)3 = 3.16481 (four terms)
f(2.1) 2.92893 + 2.23223(0.1) + 1.27097(0.1)2 - 0.05524(0.1)3 + 0.01726(0.1)4 = 3.16481
(five terms)
The following table summarizes the results for h = 0.1 to 1.0 in an increment of 0.1: