Making difficult equations easier, Scaling – HP 15c User Manual

Page 88

Advertising
background image

88

Section 4: Using Matrix Operations

88

)

10

log(

log

carried

digits

of

number

digits

decimal

correct

of

number

n









1

A

A

where n is the dimension of A. For the HP-15C, which carries 10 accurate digits,

(number of correct decimal digits) ≥ 9 − log(||A|| ||A

−1

||) − log(10n).

In many applications, this accuracy may be adequate. When additional accuracy is desired,
the computed solution Z can usually be improved by iterative refinement (also known as
residual correction).

Iterative refinement involves calculating a solution to a system of equations, then improving
its accuracy using the residual associated with the solution to modify that solution.

To use iterative refinement, first calculate a solution Z to the original system AX = B. Z is
then treated as an approximation to X, in error by E = XZ. Then E satisfies the linear
system AE = AXAZ = R, where R is the residual for Z. The next step is to calculate the
residual and then to solve AE = R for E. The calculated solution, denoted by F, is treated as
an approximation to E = XZ and is added to Z to obtain a new approximation to X:
F + Z ≈ (XZ) + Z = X.

In order for F + Z to be a better approximation to X than is Z, the residual R = BAZ must
be calculated to extended precision. The HP-15C's >6 operation does this. The system
matrix A is used for finding both solutions, Z and F. The LU decomposition formed while
calculating Z can be used for calculating F, thereby shortening the execution time. The
refinement process can be repeated, but most of the improvement occurs in the first
refinement.

(Refer to Applications at the end of this section for a program that performs one iteration of
refinement.)

Making Difficult Equations Easier

A system of equations EX = B is difficult to numerically solve accurately if E is ill-
conditioned (nearly singular). Even iterative refinement can fail to improve the calculated
solution when E is sufficiently ill-conditioned. However, instances arise in practice when a
modest extra effort suffices to change difficult equations into others with the same solution,
but which are easier to solve. Scaling and preconditioning are two processes to do this.

Scaling

Bad scaling is a common cause of poor results from attempts to numerically invert ill-
conditioned matrices or to solve systems of equations with ill-conditioned system matrices.
But it is a cause that you can easily diagnose and cure.

Suppose a matrix E is obtained from a matrix A by E = LAR, where L and R are scaling
diagonal matrices whose diagonal elements are all integer powers of 10. Then E is said to be
obtained from A by scaling. L scales the rows of A, and R scales the columns. Presumably
E

−1

= R

−1

A

−1

L

−1

can be obtained either from A

−1

by scaling or from E by inverting.

Advertising