Tharon said:
I believe this may end up being a calculus based equation.....
I agree as it seems the poster wants to calculate the VOLUME of fluid in the tank, not just a simple 0 - 100% level.
If for example the tank's cross section is not circular, one could then split the tank into two upper and lower portions.
If you define the function for the lower portion based on the tank size in question you could then use integration to calculate the area under the curve from 0 to X (X being the level feedback), as the level rises calculate the area using integration, then multiply by the horizontal length of the tank to get the volume. Now that is some-what easy for the lower portion, with the upper you'll have to do the math a little different, just off the top of my head integrate from X to 100, subtract the result from the total area of the upper portion to get the actual area in the upper portion that is being filled, multiply again by the horizontal tank length and add that to the volume of the lower portion of the tank to get the total volume.
Now, it's been 5+ years since I've had to do much of the calculus myself, I'm pretty sure that I'm on the right track, but I'm questioning myself because I would be integrating along the y-axis rather then the x-axis....which seems to be throwing me for a loop right now. Is this were double integration comes into play? I vaguely remember triple integration for calculating the x-y axis area then the z-axis area??
It's true, you don't use it you lose it!
Regardless, it's complicated math that would be hard to do in a PLC. I always relied on my trusty TI-89