I have a symmetric container (a hollow object of revolution) that is partially filled with liquid. When we rotate the container about any axis perpendicular to our display, the surface of liquid must be parallel to the surface of liquid in a not-rotated container.

To be more realistic, the volume of liquid must be conserved. In other words, the area of the shaded region must be invariant under this rotation.

I want to make an animation by changing the rotation angle so automatic adjustment is a must.

enter image description here





What is the easiest way to automatically keep the fluid surface horizontal and the volume of liquid conserved when the container is rotated? The top of the container is open so the angle of rotation must not make the liquid spilled out.

It is free for you to use either PSTricks or TikZ or others!

  • 6
    @Karl'sstudents: I would think you would need a function for the shape so that you can compute the vertical height to get the same area. – Peter Grill Mar 19 '13 at 19:15
  • 1
    @Karl's students: you should indicate in the picture that the top is open then. – g.kov Mar 19 '13 at 20:00
  • 4
    You mentioned preservation of "area" as a constraint. But if the body is a body of revolution, then conservation of area will not be the same as conservation of volume. – Steven B. Segletes Mar 19 '13 at 22:30
  • 1
    @Karl'sstudents I see that this question remains unanswered. Giving it more thought leads me to think the best way to do this is, given the vagaries of the container geometry (as well as the challenges of volume integration for the conic section of an unusual body of revolution), to calculate offline the fluid location as a function of the tilt angle, and then, In LaTeX, use a look-up table to plot the liquid, based on the current value of vessel tilt. – Steven B. Segletes Mar 27 '13 at 2:59
  • 2
    My thoughts: This is a mathematical question that belongs on math.sx, as you actually need to solve for the volume that is filled (and not the area). When you do have some mathematical solution for the height of the line, that height could easily be calculated and the area could easily be drawn with PSTricks or PGF. — Or do you actually only need the mathematical expression of the \pscurve? – Qrrbrbirlbel Mar 28 '13 at 4:27

this might answer your question, although I'm afraid that this will not keep the volume conserved, because it will take much more math investigated to calculate the contained water. At least this will do the first job for you - keeping the surface parallel to the non-rotated container:

Bottle http://www.x-linux.de/stackoverflow/bottle.png







Note: Don't know who is the original author, found it on PSTricks

Regards, Nick

  • The pink region will tell the history. – kiss my armpit Apr 2 '13 at 16:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.