Hello -
I have a family of curves representing flow through a gate with various elevations and head. My table is designed like so:
<table border = "1">
<tr>
<th></th>
<th>1 ft</th>
<th>2 ft</th>
<th>3 ft</th>
<th>4 ft</th>
<th>5 ft</th>
</tr>
<tr>
<td>100</td>
<td>1 cfs</td>
<td>2 cfs</td>
<td>4 cfs</td>
<td> 7 cfs</td>
<td>11 cfs</td>
</tr>
<tr>
<td>200 </td>
<td>2 cfs</td>
<td>3.5 cfs</td>
<td>7 cfs</td>
<td>14 cfs</td>
<td>23 cfs</td>
</tr>
<tr>
<td>300</td>
<td>4 cfs</td>
<td>9 cfs</td>
<td>15 cfs</td>
<td>29 cfs</td>
<td>48 cfs</td>
</tr>
<tr>
<td>400</td>
<td>8 cfs</td>
<td>16 cfs</td>
<td>32 cfs</td>
<td>56 cfs</td>
<td>91 cfs </td>
</tr>
<tr>
<td>500</td>
<td>16 cfs</td>
<td>32 cfs</td>
<td>64 cfs</td>
<td>112 cfs</td>
<td>176 cfs</td>
</tr>
</table>
Various elevations are in the rows and various gate openings are in the columns - the cells in the middle show corresponding flows. Things to note:
I have written an interpolation function that can use an elevation and gates setting and interpolate between to get a flow. It works. I would also like a function that can use an elevation and desired flow and do an inverse lookup to find the appropriate gate setting - something like:
I see a path to do this in vba, but it involves lots of loops and temporary arrays and will be a pain to write - I guess I am hoping that someone out there has already done this and would be willing to share.
Anyone?
I have a family of curves representing flow through a gate with various elevations and head. My table is designed like so:
<table border = "1">
<tr>
<th></th>
<th>1 ft</th>
<th>2 ft</th>
<th>3 ft</th>
<th>4 ft</th>
<th>5 ft</th>
</tr>
<tr>
<td>100</td>
<td>1 cfs</td>
<td>2 cfs</td>
<td>4 cfs</td>
<td> 7 cfs</td>
<td>11 cfs</td>
</tr>
<tr>
<td>200 </td>
<td>2 cfs</td>
<td>3.5 cfs</td>
<td>7 cfs</td>
<td>14 cfs</td>
<td>23 cfs</td>
</tr>
<tr>
<td>300</td>
<td>4 cfs</td>
<td>9 cfs</td>
<td>15 cfs</td>
<td>29 cfs</td>
<td>48 cfs</td>
</tr>
<tr>
<td>400</td>
<td>8 cfs</td>
<td>16 cfs</td>
<td>32 cfs</td>
<td>56 cfs</td>
<td>91 cfs </td>
</tr>
<tr>
<td>500</td>
<td>16 cfs</td>
<td>32 cfs</td>
<td>64 cfs</td>
<td>112 cfs</td>
<td>176 cfs</td>
</tr>
</table>
Various elevations are in the rows and various gate openings are in the columns - the cells in the middle show corresponding flows. Things to note:
- Across each row and down each column, the values are strictly increasing.
- The functions across each row and down each column are non-linear, but my datapoints are dense (50x50) , and can be assumed to be linear locally
- I am putting in the units to make it easier to understand the table, but my table is really only numeric.
I have written an interpolation function that can use an elevation and gates setting and interpolate between to get a flow. It works. I would also like a function that can use an elevation and desired flow and do an inverse lookup to find the appropriate gate setting - something like:
Code:
reverseinterp(350 ft, 9.25 cfs) = 1.5 ft
I see a path to do this in vba, but it involves lots of loops and temporary arrays and will be a pain to write - I guess I am hoping that someone out there has already done this and would be willing to share.
Anyone?
Last edited: