10.07.2015 Views

Finding Potential Sites for Small-Scale Hydro Power in Uganda: a ...

Finding Potential Sites for Small-Scale Hydro Power in Uganda: a ...

Finding Potential Sites for Small-Scale Hydro Power in Uganda: a ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

To get an overview of how the algorithm is designed, Figure 4.7 shows the differentsteps on which the algorithm is based on.The needed <strong>in</strong>put data <strong>for</strong> the algorithm is a raster <strong>in</strong> float<strong>in</strong>g data <strong>for</strong>mat, conta<strong>in</strong><strong>in</strong>griver cells where the cell values illustrate absolute elevation. The algorithm beg<strong>in</strong>s byread<strong>in</strong>g the <strong>in</strong>put data <strong>in</strong>to a matrix called “DATA”, where the number of rows andcolumns depends on the resolution and the size of the area of <strong>in</strong>terest. An example isshown <strong>in</strong> Figure 4.8a.The next step <strong>in</strong> the algorithm is to extract all cellsconta<strong>in</strong><strong>in</strong>g a value other than zero, and save them<strong>in</strong>to the array “RIVERCELLS” (see Figure 4.8b).These values are then ranked by height and stored<strong>in</strong>to another array called “ORDER”, see theexample <strong>in</strong> Figure 4.8c. The arrays consist of threecolumns, conta<strong>in</strong><strong>in</strong>g the river cell’s coord<strong>in</strong>atesand height values. The number of rows <strong>in</strong> thesearrays is equal to the number of river cells <strong>in</strong>“DATA”. This operation is done <strong>in</strong> order to makeour algorithm more time effective, s<strong>in</strong>ce sort<strong>in</strong>gone column (“RIVERCELLS”, z) is done muchfaster than alternative solutions.In order to f<strong>in</strong>d a head of 20 meters over adistance of 100 meters, the algorithm locates ten <strong>in</strong>a row connected cells and calculates theiraccumulated height difference. It is possible <strong>for</strong>the river cells to connect diagonally, which meansthat the accumulated distance of ten cells canreach a maximum of 141 meters.Figure 4.7 Flowchart show<strong>in</strong>g thecha<strong>in</strong> of processes <strong>in</strong> the algorithm.41

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!