![]()
MATH566 Lesson 3: Programming for numerical analysis
|
Types of numerical approximation and their coding
Array operations
![]()
Aspects of numerical approximation
|
Numerical methods constructs approximation sequences to converge to the solution of a mathematical problem , .
Numerical analysis studies the convergence behavior: conditions for convergence, order and rate of convergence.
Computation theory constructs algorithms within some model of computation and studies the behavior of these algorithms, in particular the computational effort required for each step of the algorithm
![]()
Numerical method example: Newton's method for square root
|
|
|
![]()
Numerical analysis example: Newton's method for square root
|
Suppose , signifying that is “-close” to . Then, from obtain
For choose such that in which case , hence is a Cauchy sequence in , and converges.
![]()
Computation theory example: Newton's method
|
Newton's method for square root extraction:
At each iteration carry out 1 addition and two multiplications. Computational effort is FLOPs (floating point operations)
Newton's method for finding zeros of ,
At each iteration carry out 1 evaluation of and 1 evaluation of . Computational effort is -evals, and -evals.
![]()
Approaches to approximation sequence construction
|
Additive corrections
Multiplicative corrections
![]()
Approaches to approximation sequence construction
|
Continued fractions
![]()
Array operations: Matrix addition and scaling
|
Definition. The sum of matrices
is the matrix with components
Definition. The scalar multiplication of matrix by is
![]()
Array operations: matrix multiplication
|
Definition. Consider matrices , and The matrix product is a matrix with column vectors given by the matrix vector products
A matrix-matrix product is simply a set of matrix-vector products, and hence expresses multiple linear combinations in a concise way.
The dimensions of the matrices must be compatible, the number of rows of must equal the number of columns of .
A matrix-vector product is a special case of a matrix-matrix product when .
We often write in terms of columns as
![]()
Array operations: componentwise matrix multiplication
|
Definition. Consider matrices , and The matrix product is a matrix with components
![]()
Array operations: Transpose of matrix columns
|
contains column vectors with components each
The transpose switches rows and columns
has rows and columns
![]()
Array operations: block matrix operations
|
Matrix block addition
Matrix block multiplication
Matrix block transposition