Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.

Log in or register to post/reply in the forum.

Value when 2criteria are met

SWeather Feb 2, 2024 05:08 AM


I am working on a reservoir/spillway/flow project. I am measuring gate opening in .1ft. Also measuring reservoir elevation in .01ft. I have a table that states when opening is x and res elevation is x flow is x.  In more detail, if opening is .1ft and reservoir elevation is 4780ft then spillway flow is 84cfs. 

The table has 10 colums for elevation and 15 rows for opening. 

i am looking for a better programing solution for this than multipul if then statments 

JDavis Feb 2, 2024 05:18 PM

One approach is to find the equation for the gate, and program the equation into your program rather than a lookup table. The table was probably generated from a standard equation, unless you have tailwater effects. The SOP for the dam probably has the equation as a footnote on the table. US Bureau of Reclamation has a published flow measurement manual for different types of gates.

I have helped with a lookup table on other projects. Ultimately, you need to get all the data into a 2D array. Once the data in is the array, you can look up values. You can also do linear interpolation for values between cells in the table. Loading all the values into the array can be a bit tedious to set up. Since the table won't change, you can code it into the program. Look at the help for the Data() command.

Log in or register to post/reply in the forum.