# Resolution of the linear system of the correcting equations

Three unknown variables are attached to each reach n°*i*:

- in terms of water elevation: at the upstream node
- in terms of water elevation: at the downstream node
- in terms of discharge: anywhere in the reach

Let *N* be the number of reaches in the loop. It is possible to solve the linear system composed of the 3*N* equations. But an entire backwater curve computation will be necessary, after correction of the discharges, in order to get the water elevation in each cross section of the reaches.

Therefore, the directly interesting unknowns are the variables.

If the equations are written in a judicious order, some (*N*.*N*) blocs appear:

Matrix . Vector = Constant

That can be written: **[8]**

*D*, *F* are diagonal matrices

*I* is the unity matrix

*H* is an upper triangular matrix with a nil principal diagonal

The discharge continuity equations at the nodes which are not downstream nodes of a loop, are placed in the first block line of the linear system (filling the *A* block). We then complete the block line with the equality relations between the water elevations at the distributory nodes (filling the *B* and *C1* blocks).

The condensation equations are placed in the second block line.

The downstream boundary conditions at the downstream reaches of the loop, and the equality relations between the upstream and the downstream water elevations of the reaches at the nodes that are not downstream nodes of a loop, are placed in the third block line.

By multiplying **[8]** with a proper transition matrix *P*:

we get a *N* equations system in the variable:

**[9]**

with:

This method can only be applied if the matrix can be inverted. Fortunately this matrix can always be transformed into a triangular superior matrix with the diagonal only composed of 1. Therefore can easily be inverted through the Gauss - Jordan method. The system **[9]** is solved through the Gauss method with a partial Gauss elimination.