At least dh can be found neatly: dh=dV/(π(2rh-h^2))
]]>You want to solve a cubic equation. There is a formula for this but it's not easy to use. Perhaps the following will help.
So
And I can simplify further by setting r = 1. This is ok because you can always re-scale so it is true and adjust back once you've got a value for h.
So consider the graph y = 3x^2 - x^3
The graph of y against x is increasing in the range we are interested in . Translate the graph by -k in the y direction, so it crosses the x axis at (h,0) Our problem is to find h.
This makes the graph
There is a numerical way to find h using the Newton-Raphson method.
If a is an approximation for h then
is a better approximation.
where f' means differentiate once.
so the better 'guess' is found by evaluating
Repeated iterations of this calculation quickly 'home in' on the required value h. For an initial value x = 0.5 will work quite well.
To test this I chose k = 0.7 and a = 0.5
First iteration: b = 0.533333 f(x) = 0.00163
second iteration: b = 0.532639, f(x) smaller than 0.000001
Subsequent iterations left b unchanged to 10 decimal places.
Check in original problem: y evaluates to 0.700000675 which is not bad for just two iterations.
Bob
]]>Obviously it is simple to find V as a function of height. What is not so easy is finding h as a function of V. I have been using a Newton approximation to find h which works fine. However that approximation function needs to be different for each value of V. This makes finding h or dh for a changing volume seem impractical outside of using a computer script. I have also had wolfram ‘solve’ for h(V) but that solution is uglier than the newton approximation. Any genius out there know how to swap independent and dependent variables for this case? As in making V(h) into h(V). Or is this just a case where a computer is necessary to be practical?
]]>