MathGroup Archive 2003

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Re: Animation: sphere filling with water

  • To: mathgroup at smc.vnet.net
  • Subject: [mg38872] Re: [mg38840] Re: Animation: sphere filling with water
  • From: Dr Bob <majort at cox-internet.com>
  • Date: Thu, 16 Jan 2003 03:21:50 -0500 (EST)
  • References: <200301150721.CAA23461@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Just to clarify things (because it puzzled me a bit), Here's how to figure 
out what solution to use, and what the value of 'tf' has to be.

The derivative of fill level with respect to time is inversely proportional 
to the area of the water's top surface (A).  The operative word is 
"proportional", and answers are a trifle simpler if we leave out the Pi, 
so:

Off[DSolve::"bvnul"]
Needs["Graphics`Colors`"]
answers = DSolve[{L'[t] == With[{A = (1 - L[t]^2)}, 1/A], L[0] == -1}, 
L[t], t]

(ugly answers deleted)

To choose between the solutions, look at the derivatives at 0.  You can't 
use L'[0] to do this, but this works:

Clear[L1, L2]
L1[t_] = L[t] /. answers[[1]];
L2[t_] = L[t] /. answers[[2]];
Chop@N[L1'[10^-10]]
Chop@N[L2'[10^-10]]

50000.166667708305
-49999.83333437496

Both are actually indeterminate at 0, but L2 would have the empty tank's 
fill level dropping even lower.

Solve for the time required to fill the sphere and plot the graph.

Solve[L1[t] == 1]
tf = t /. %[[1]];
Plot[Evaluate[L1[t]], {t, 0, tf}];

{{t -> 4/3}}

When graphing,we use Re to get rid of imaginary complex parts that can 
appear in the function value.  We draw the tank completely full in Blue, 
cover up the unfilled part with a White rectangle, and finally draw the 
circle in Black.  We can make the sphere fill in any desired period of time 
(if that's important).

time = 7;
Table[
   Show[
      Graphics[
           {   Blue, Disk[{0, 0}, 1],
               White, Rectangle[{-1, Re@L1[t*tf/time]}, {1, 1}],
               Black, Circle[{0, 0}, 1]
            },
           AspectRatio -> Automatic]],
   {t, 0, time, time/50}];

Bobby

On Wed, 15 Jan 2003 02:21:11 -0500 (EST), Tom Burton <tburton at brahea.com> 
wrote:

> Hello,
>
> After I posted a hasty reply showing the level rising at a constant rate, 
> it
> occurred to me that the sphere is more likely to fill at a constant
> volume-flow rate. Here is a simulation of the filling of a unit sphere by 
> a
> unit volume-flow rate.
>
> Tom Burton
>
> Needs["Graphics`Colors`"]
>
> tf = 4 \[Pi]/3
>
> answers = DSolve[{L'[t]==With[{A = \[Pi](1-L[t]^2)},1/A], L[0]==-1}, L, 
> t]
>
> L2 = L/.answers[[2]]
>
> Plot[Evaluate[ Re[L2[t]] ],{t,0,tf}]
>
> Table[ Show[Graphics[{
> Blue,Disk[{0,0},1],
> White,Rectangle[{-1,Re[L2[t]]},{1,1}],
> Black,Circle[{0,0},1]
> },AspectRatio->Automatic]],
> {t,0,tf,tf/50}];
>
>
>



-- 
majort at cox-internet.com
Bobby R. Treat



  • Prev by Date: RE: Asymptote mystery...
  • Next by Date: Re: Why is Mathematica incredible slow?
  • Previous by thread: Re: Animation: sphere filling with water
  • Next by thread: Re: Animation: sphere filling with water