#!/user/bin/python import math from math import degrees #inputs print ("---- Step 0: Input Values.") width = float(raw_input("Width in meters? >>")) print (width) depth = float(raw_input("Depth in meters? >>")) print (depth) slopeDeg = float(raw_input("Slope in degrees? >>")) slopeRad = math.radians(slopeDeg) print (slopeDeg) print ("Slope in radians >> %s" %slopeRad) Qkleinhans = float(raw_input("Kleinhans Discharge (Q) in m^3/s? >>")) print (Qkleinhans) #1st we find the hydraulic radius: print ("----Step 1/5: Finding the hydraulic radius of the wetted perimeter.") hydraulicradius_value = width * depth / (2 * depth + width) print ("R (hydraulic radius) = [width]x[depth]/[[2x[depth]+[width]]") print ("R (hydraulic radius) = %s m" %hydraulicradius_value) #2nd we find the mean value of the Strickler coefficient: print ("----Step 2/5: Finding the K sub m, or mean value of Strickler coefficient for the wetted perimeter.") Km_beforeQ = depth * (hydraulicradius_value ** 0.667) * (slopeRad ** 0.5) print ("Km = Q / [depth]x[R^0.667]x[S^0.5]") print ("Km = Q / %s" %Km_beforeQ) #compute the value of Qcorrect Qcorr_value = 18 Km = Qcorr_value/Km_beforeQ print ("Km = %s" %Km) print ("Q Corrected = [[Qkleinhans in m^2/s]x[width in m]x[110^1.5 in m^0.33/s]]/[[width in m]x[110^1.5 in m^0.33/s]+2x[depth in m]x[km in m^0.33/s] = m^2/s") print ("Q Corrected = %s" %Qcorr_value) #3rd we find the Strickler coefficient without wall drag print ("----Step 3/5: Finding the K sub s, or Strickler coefficient without wall drag.") Ks = (((width ** 0.667) * (Km) * 110) / ((((width * (110 ** 1.5)) + 2 * depth * ((110 ** 1.5) - ((Km) ** 1.5))) ** 0.667)) print ("Ks = %s" %Ks)
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question