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.

& any([(x-1),(y+1)]~=[prev(1,1),prev(1,2)]);temp2=((highest_value-(data((x-1),(y+1))))/(sqrt( 200)));if temp2>temp1;temp1=temp2;next(1,1)=(x-1);next(1,2)=(y+1);cell_height=(highest_value-data((x-1),(y+1)));done=1;endendif data((x-1),(y))>0 & data((x-1),(y))temp1;temp1=temp2;next(1,1)=(x-1);next(1,2)=(y);cell_height=(highest_value-data((x-1),(y)));done=1;endendif done==1%if any of the above if-statements are true ->prev(1,1)=x;prev(1,2)=y;%gives the array "prev" the coord<strong>in</strong>ates of current cell.height=height+cell_height;%the current height difference is added to the accumulated%height difference <strong>in</strong> the variable "height".height_value(m,1)= x;height_value(m,2)=y;%the current coord<strong>in</strong>ates are saved <strong>in</strong> the matrix "height_value"%at row "m".x=next(1,1);y=next(1,2);%gives "x" & "y" the coord<strong>in</strong>ates of the next cell to go to.elsebreak%if none of the above if-statemnets are true, the loop will end%and cont<strong>in</strong>ue at the cell next <strong>in</strong> order.80

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

Saved successfully!

Ooh no, something went wrong!