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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

%"highest_value" and if the cell coord<strong>in</strong>ates are not the same as%previous ->temp1=((highest_value-(data((x-1),(y-1))))/(sqrt(200)));%sets the variable "temp1" to the slope to the exam<strong>in</strong>ed cell.next(1,1)=(x-1);next(1,2)=(y-1);%writes the coord<strong>in</strong>ates of the exam<strong>in</strong>ed cell <strong>in</strong>to "next".cell_height=(highest_value-data((x-1),(y-1)));%sets the variable "cell_height" to the height difference%to the exam<strong>in</strong>ed cell.done=1;%logical expression is per<strong>for</strong>med.endif data(x,(y-1))>0 & data(x,(y-1))temp2=( (highest_value-(data(x,(y-1))))/(10));%sets the variable "temp2" to the slope to the exam<strong>in</strong>ed cell.if temp2>temp1;temp1= temp2;%if the newly exam<strong>in</strong>ed cell ("temp2") has greater slope%than the <strong>for</strong>mer ("temp1"), the variable "temp1" is set to% the value of variable "temp2".next(1,1)=(x);next(1,2)=(y-1);%writes the coord<strong>in</strong>ates of the exam<strong>in</strong>ed cell <strong>in</strong>to "next".cell_height=(highest_value-data((x),(y-1)));%sets the variable "cell_height" to the height difference%to the exam<strong>in</strong>ed cell.done=1;%logical expression is per<strong>for</strong>med.endend% the follow<strong>in</strong>g if-statements are as above.if data((x+1),(y-1))>0 & data((x+1),(y-1))temp1;temp1=temp2;next(1,1)=(x+1);78

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

Saved successfully!

Ooh no, something went wrong!