# Ill Conditioning

In the vast majority of cases the solver will give a correct solution to the problem. However, some problems are by nature ill-conditioned in which case small changes in the input data can lead to more significant changes in the results.

Taking a simple example to look at ill-conditioning; consider a simple two spring system, where the springs are connected in series. The stiffness of the first spring is $k_{1}$ and that of the second is $k_{2}$ and we assume that $k_{2}$ is much greater than $k_1$ $\left( k_{2} > > k_{1} \right)$.

In this case the equations describing the system is

$\begin{Bmatrix} 0 \\ f_{2} \\ \end{Bmatrix} = \begin{bmatrix} k_{1} + k_{2} & - k_{2} \\ - k_{2} & k_{2} \\ \end{bmatrix}\begin{Bmatrix} u_{1} \\ u_{2} \\ \end{Bmatrix}$

As in a solver based on a Gaussian elimination technique, we use these equations to arrive at a relationship between $u_{2}$ and $u_{1}$

$u_{2} = \frac{f_{2} + k_{2}u_{1}}{k_{2}}$

which when substituted in the other equation gives:

$\left( k_{1} + k_{2} \right)u_{1} - k_{2}\left( \frac{f_{2} + k_{2}u_{1}}{k_{2}} \right) = 0$

or

$\left\lbrack k_{1} + \left( k_{2} - k_{2} \right) \right\rbrack u_{1} = f_{2}$

With exact arithmetic the term $\left( k_{2} - k_{2} \right)$would be zero, however, if $k_{2}$ is large compared with $k_{1}$ and due to limited precision, some error will be introduced in the calculation. If this error is denoted by $e$, then the equation we have is

$\left\lbrack k_{1} + e \right\rbrack u_{1} = f_{2}$

We have then a system as shown below where the error is like adding a third spring, which acts in parallel with $k_{1}$.

The expected reaction is $f_{2}$, but the reaction that is calculated is

$r = k_{1}u_{1} = \frac{k_{1}f_{2}}{k_{1} + e}$

Thus the reaction is in error by a factor

$\frac{k_{1}}{k_{1} + e}$