# How to calculate the change in water level height after each step in a water displacement simulation?

I'm trying to write a very simple simulation of volume/water displacement. Every timestep a sphere gets lowered a bit further into a cylindrical container filled with water. While the physics behind this should be quite clear, I just can't wrap my head around how I would go about calculating the change in water height per timestep.

If the sphere is lowered by $$y$$ below the initial water level, then the water level will rise by $$h$$, resulting in the sphere being submerged by $$y + h$$, which would in turn mean it would displace more water, making the water level rise some more and so on and so on... This of course is wrong somewhere, but I fail to come up with a better idea. So, where do I err?

Assume $$r_{C}$$to be the radius of the cylindrical container, $$h_{0}$$the original water level without a sphere in it, $$h_{n}$$ the water level after the nth step $$r_{S}$$the radius of the sphere and $$y_{n}$$ how high the spherical cap of the submerged part (below the original water level) of the sphere is after step $$n$$.

From the balance of volumes before and after insertion for step 1 we get $$V_{o}=V_{1}-V_{S}$$ with $$V_{0}$$ being the original water volume, $$V_{1}$$ the volume after inserting part of the sphere in the first step, and $$V_{S}$$ the volume of the inserted spherical cap.

$$V_{0}=r_{C}^{2}\pi h_{0}\\ V_{1}=r_{C}^{2} \pi h_{1}\\ V_{S}=\frac{\pi}{3}h_{1}^{2}(3h_{1}-h_{1})$$

this is fine on its own and can be solved by solving a cubic equation, but nowhere in this does $$y_{n}$$ appear, and that's the part where I get hung up. How to transform these equations into something dependent on $$y_{n}$$, e. g. how to transform them into something dependent on how much of the sphere is below the original water level?

New contributor
Johann Gruber is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
• You'll need to solve a cubic equation to find the water level in terms of the sphere position. May 25 at 14:30
• Welcome to Scicomp. Start with the math you have. What are the equations for the water body volume without the sphere? define your radii and your coordinate system etc. Sketch a plot what you'd expect the water level to look like depending on the depth of insertion. Give us something to work with:-) May 26 at 12:44
• @MPIchael, thank you for your answer, I edited my post, I hope this clarifies things? May 27 at 13:29