Height as a function of volume problem?

irspow

New member
Joined
Dec 31, 2020
Messages
19
Using revolutions of a solid I derived a function relating the volume of liquid within a sphere with the height of that fluid within the sphere. However it is a cubic function which I don’t know how to swap the dependent and independent variables. I’ll try to explain better my problem.

V=(pi/3)(3rh^2-h^3)

It’s clearly easy to determine the volume at a given height. My problem is that solving for height for a given volume is an ugly cubic. I have resorted to using a Newton approximation to solve for height. Which works but is a bit tedious and a ‘new approximation’ equation must be used for each different volume. In short, is there a way to transform this V(h) function into a h(V) function?
 
That's the nature of the beast. Why is it a problem that it is "tedious". Code it in your favorite programming environment and it will stop being tedious.
 
Cubics can in principle be solved exactly, but I would never do that to try to invert a function like yours. We generally use numerical methods, just as you have already done.

On the other hand, here is the solution. Observe you'll want only the first of three answers shown.
 
Thank you all, I was starting to think I was crazy for not figuring it out. I guess a python script with the appropriate newton approximation is an easy way out.
 
Using revolutions of a solid I derived a function relating the volume of liquid within a sphere with the height of that fluid within the sphere. However it is a cubic function which I don’t know how to swap the dependent and independent variables. I’ll try to explain better my problem.

V=(pi/3)(3rh^2-h^3)

It’s clearly easy to determine the volume at a given height. My problem is that solving for height for a given volume is an ugly cubic. I have resorted to using a Newton approximation to solve for height. Which works but is a bit tedious and a ‘new approximation’ equation must be used for each different volume. In short, is there a way to transform this V(h) function into a h(V) function?
Go to wolframalpa.com and type in:

solve a*x^3 + b*x^2 +c =0​

You will get a "solution"!
 
Top