I'm attempting to add a "water level" to "flow" rating table to a campbell CR850/800.
I guess this could be best done with an equation. Has anyone done this before or have any suggestions or exaples of how to do this?
Cheers
Hi GenesisHydrology,
It all depends on the type of flume you are using.
I found some sites that might help.
http://www.lmnoeng.com/Flumes/flumes.htm
http://www.brighthub.com/engineering/civil/articles/51435.aspx
Regards,
Hi There,
I am measuring rivers in an open channel flow situation. I think I need to convert the rating table to a 3rd order polynomial and then enter the resulting equations into the logger and have the logger lookup which equation to use for the corresponding water level.
Many equations would be needed so that the error is reduced.
I still have no progress. Is there a way??
Regards
If I understand what you are asking, you should be able to use cascading If ElseIf statements to have the program select the equation you want to use:
If Stage > 10 Then
Flow = n(Stage)^3 + n(Stage)^2 + n(Stage) + n
ElseIf Stage > 5 Then
Flow = n(Stage)^3 + n(Stage)^2 + n(Stage) + n
ElseIf Stage > 1 Then
Flow = n(Stage)^3 + n(Stage)^2 + n(Stage) + n
Else
Flow = n(Stage)^3 + n(Stage)^2 + n(Stage) + n
EndIf
Gidday GenesisHydrology,
This is relatively straightforward, once you get the hang of it. I’ve just built and loaded a dozen rating tables into CR800’s today.
The first thing you need to do is generate one or more polynomials from your rating table. I find the easiest way to do this is to import the rating table into Excel. Create a chart of level versus flow, making sure level is on the X axis and flow on the Y, and add a trendline to get the equation of the curve. Generally a polynomial will give you the best fit, but not always.
Then create a table of level versus [i]calculated[i] flow to check the accuracy the calculations against the rating table. It may be necessary to split your rating table into several sections to get the required accuracy. With weirs, channels, etc you might get away with just one equation but rivers and streams almost always require two or more equations.
One other thing I always do is offset the Excel table so that 0.000 water level = 0.000 flow (i.e. subtract cease to flow from water level). This makes the polynomial coefficients smaller and easier to deal with.
Once you’ve done this you can program your logger as per Dizbert’s suggestion. I’ve included a portion of code I wrote and tested today, just to illustrate how I do this.
------------------------------------------------------------
Public Level_Mtr
Public Level_CTF, Flow_Cumecs, Level_Poly
BeginProg
Level_CTF=0.220
Scan (10,Sec,0,0)
'Read sensor code here
'Flow Calculations
Level_Poly=Level_Mtr-Level_CTF
If Level_Poly>1.820 Then
Flow_Cumecs=99999
ElseIf Level_Poly>=1.000 Then
Flow_Cumecs=(1014.7*Level_Poly^3)+(722.1*Level_Poly^2)-(2485.4*Level_Poly)+1429
ElseIf Level_Poly>=0.400 Then
Flow_Cumecs=(6998.5*Level_Poly^5)-(25604*Level_Poly^4)+(36546*Level_Poly^3)-(23373*Level_Poly^2)+(6850.5*Level_Poly)-743.44
ElseIf Level_Poly>=0.000 Then
Flow_Cumecs=(-29910*Level_Poly^6)+(35779*Level_Poly^5)-(15934*Level_Poly^4)+(3288*Level_Poly^3)-(230.39*Level_Poly^2)+(6.1499*Level_Poly)
Else
Flow_Cumecs=0.00
EndIf
------------------------------------------------------------
I always add code to force flow=0 when level=<0 and also to set flow=99999 when level is above the rating/polynomial to prevent strange flow rates being produced.
Cheers
We operates thousands of sites monitoring rivers which have varying degrees of complicated stream rating tables. We tried with polynomials for a long time but found that to get the accuracy for natural stream rating table you needed numerous 4th & 5 th order polynomials. Also, to maintian update these became a bit of a nightmare when working with so many sites.
Our solution:
We created a file lookup system. We load in rating tables with up to 1500 level v's flowrate points in a text file. Every time we measure our level sensor (5mins) we also do a file lookup for flowrate. The code actually goes one step further and does a linear interpolation between points which provides a very accurate answer. In our rating table file we have 10mm increments so doing a linear interp between these is pretty fine resolution. Now when we want to update our ratings we just load a new file and we do this remotely via ftp. All automated and works really nice. The rating files we generate are just text files and produced by our environmental data managemeent software called Kisters Hydstra.
This was just an example I made that a customer eventually expanded on and improved.
Public Depth, Flow
Public DepthRoundLow, DepthRoundHigh
Public RoundLowIndex, RoundHighIndex
Public FlowRoundLow, FlowRoundHigh
Public Slope, Offset
Public LookUp_Depth(6) = {0,.41,1.33,2.73,3.72,4.56}
Public LookUp_Flow(6) = {330.21,500,1000,2000,3000,4000}
Sub FlowRating(Depth,Flow)
DepthRoundLow = INT(Depth)
DepthRoundHigh = DepthRoundLow + 1
For RoundLowIndex = 6 To 1 Step - 1
If DepthRoundLow >= LookUp_Depth(RoundLowIndex) Then Exit For
Next
FlowRoundLow = LookUp_Flow(RoundLowIndex)
For RoundHighIndex = 6 To 1 Step -1
If DepthRoundHigh >= LookUp_Depth(RoundHighIndex) Then Exit For
Next
FlowRoundHigh = LookUp_Flow(RoundHighIndex)
Slope = (FlowRoundHigh - FlowRoundLow) / (DepthRoundHigh - DepthRoundLow)
Offset = FlowRoundLow - Slope * DepthRoundLow
Flow = Depth * Slope + Offset
EndSub
BeginProg
Scan (1,Min,3,0)
'Depth = 'Measurement
Call FlowRating(Depth,Flow)
NextScan
EndProg