# Math Is Fun Forum

Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫  π  -¹ ² ³ °

You are not logged in.

## #1 2021-01-02 05:00:19

irspow
Member
Registered: 2005-11-24
Posts: 1,055

### An old problem that I have never solved.

Using revolution of solids I found the relationship of the volume of fluid in a sphere to that of the height of the fluid.
Specifically:   V(h)=(pi/3)(3rh^2-h^3)

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?

I am at an age where I have forgotten more than I remember, but I still pretend to know it all.

Offline

## #2 2021-01-02 07:25:59

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,049

### Re: An old problem that I have never solved.

Here lies the reader who will never open this book. He is forever dead.
Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

## #3 2021-01-03 05:08:44

Bob
Registered: 2010-06-20
Posts: 9,607

### Re: An old problem that I have never solved.

hi irspow

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

Children are not defined by school ...........The Fonz
You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you!  …………….Bob

Offline

## #4 2021-01-03 05:37:57

irspow
Member
Registered: 2005-11-24
Posts: 1,055

### Re: An old problem that I have never solved.

Thanks for the advice guys. The cubic inversions are uglier than the newton approximations which I have used for a specific volume to find height. I am more interested in height as a function of a changing volume. The problem using newton approximation is that the approximation function is different for every different value of volume. This isn’t a problem for a computer script to grind out. I was just thinking that there might have been a way to create h(V) from the known V(h). It is pretty clear that there is no easy scribble on paper equation for h(V). Luckily we have computers to grind away instead of spending eternity with paper and pencil. Again, thanks for your time.

At least dh can be found neatly: dh=dV/(π(2rh-h^2))

Last edited by irspow (2021-01-03 07:03:36)

I am at an age where I have forgotten more than I remember, but I still pretend to know it all.

Offline