Hello, all!
I work on a ship (hello from the middle of the North Pacific!) and am trying to use a spreadsheet to automate calculations for the amount of water in our ballast tanks. I'm nearly there but there's one devilish interpolation I'd like to automate. I have figured out one way to do it, but it is cumbersome. Perhaps another mind out there can offer insight.
Here is the situation: we sound the tanks (put a measuring stick and read how deep the water is), and that corresponds to a certain volume/mass of liquid. That part is done. However, there is a series of small corrections to make based on the trim (that's how far down by the bow or stern we are) and heel (how far we're leaning to the port or starboard side because of our load) conditions.
Stated another way, the tables equating the sounding depth with the volume/tonnage of liquid assume we're on an even keel. But often, our stern (or bow) may be deeper for one reason or another. Additionally, we could have a list to either side. In such cases, the values in the tables need to be modified to be accurate.
The screenshots show a section of these "Heel / Trim Corrections Tables". As an example:
- The white background shows one *subset* of corrections.
- The blue background shows columns corresponding to Trim - further to the right, the stern sits deeper than the bow
- The orange background shows rows corresponding to Heel - the middle row is an even keel, and above and below, the ship is leaning to one side or another.
The values are only for certain intervals. They need to be interpolated in both directions in case Trim and Heel fall between the given integers heading the columns/rows.
The trouble is this: there is a data subset (i.e., the white background), for every meter of soundings (in each of 19 tanks), because the tanks are random shapes and the correction values will not be uniform.
So, if the *Sounding* - the light green backgrounds running down the left side of the screenshots - falls between whole numbers (and it will)... then the doubly-interpolated correction value from the subset *below* the sounding needs to be interpolated with a doubly-interpolated correction value from the subset *above* the sounding. For an example, see the second screenshot:
- Assuming a Sounding of 3.50 meters,
- We need to pull data from the dark green background subset, which is for 3.00 meters.
- We also need to pull data from the brown background subset, which is for 4.00 meters.
- The results from each of those tables need to be interpolated, as the answer will lie halfway between the 3.00m and 4.00m results.
- But those results are *each* the result of two more interpolations: for Trim and Heel, within each subset.
Make sense so far? :)
I can definitely do this the long way: creating Heel/Trim interpolation calculations for each subset of data, and then making the spreadsheet interpolate those results when it's given a Sounding value. But there may be a way to do this by nesting commands, or organizing the data differently. I'm not sure.
If anyone out there likes a challenge as much as I do, your input is appreciated! No worries, we can still do this the old-fashioned way, and we're not in any apparent danger of capsizing. 👍
Thank you for reading this far! :)
FLOT