# Help with filling container simulation

Caio shared this question 4 years ago

Hi everyone, I'm trying to create a filling container simulation and plotting the function that correlate height and time. To do that I created the "container" and put two points on the "walls" that travel up to the top until reach the top of the container, the points follow an formula speed defined by (x(D)-x(A)-2)/x(J)-x(I), this formula is used to simulate the slow filling in the middle of the container, the time is calculated through the formula: PathParameter(J)*9.42/ {speed of the two points}, 9.42 is the total length of the semi circle (this is the way that I found to measure the distance traveled by the points). However the result wasn't as I expected I'll insert an image here to clarify what is happen, hope someone could help me.

2

1

Sorry for the delay, I made some little changes but the file is here.

thank you for trying to help

1

1

You may need to use some calculus. Maybe this file helps.

Notice that this object has a different shape. But you can figure out how to make it for any other shape.

I recommend you this text: https://www.researchgate.ne...

1

Thank you so much for providing this file I'll try my best to understand the logic behind this.

1

Do you know if is possible to make this simulation '2d' as I'm trying to do?

1

Here is a 2d version:

Although it makes more sense to have it in three dimensions since we are talking about volume, not area. You have to make clear that in your applet.

Download the files I shared. Open them in your desktop and open the Algebra view. Then look for the button with name button1 (Setup). Use your mouse right click to open the Object Properties of this button and look for the Scripting tab. There you can find all the logic for the two versions (2d and 3d) to build this animation.

Send me a message to see your final result. Ciao...

1

Okay, I'll message you, thank you!

1

@Juan I'm struggling to make the "filling simulation" inside a sphere do you know how to do this? Thanks in advance.

1

1

First, check section 4 of this document.

I now it is in spanish but the math is universal. Cheers!

1

Exactly the math is universal! Also I have to say that I'm happy to have you supporting me :-). Actually I'm participating on a project that aims to teach calculus through simulations, or problems more "realistics", but I can't use the Geogebra properly (because I was trying to fill the sphere but I don't even know if it's possible to do this), I'm looking for recommendations about courses or something that makes me learn Geogebra and his functionalities if you have any suggestions I'd be happy to hear. Thanks!

1

Hi,

How is it going? Have you tried already? Did you read the document? I have to tell you that I just found a typo. In page 13, the function should be g(x) = sqrt(R^2-(x-R)^2), which makes a big difference in the calculations. :(

Although the calculation for the case of the sphere is incorrect, the general method is correct and works for any kind of function.

Well, now I have to fixed all the math in my document :) which is cool, since I have not checked this document for a long time.

Show me what you have done, I'll have something new maybe next week.

Cheers!

1

Hi again,

I just checked the math and it seems everything is fine. The calculations are correct. It was just a typo in the function I mentioned before. Great. These are good news :)

Cheers!

1

Hello, I did not get any result yet I was on my test period, sorry about the late to answer :-(

I don't know exactly where to start so I first tried to think about my "recipient" form and I conclude that I have to make an parallelepiped and inside that put a sphere (even though this isn't the faithful approach), I don't know if it's the right way but this is what I thought thus I tried to make the "filling simulation" on the sphere but I couldn't do it. About your document I made a dynamically reading but now I'm going to my summer vacation so I'll reserve one week to understand your calculations Thank you again about everything :)

1

You have to solve the equation

`pi*(h^2*r-1/3*h^3)=C*t`
for h(t) to get a real number function from t=0 to pi*4/3*r^3/C. I am not sure if that is possible.

One other way is to solve it numerical with the differential equation

`dh/dt = C/pi/(2*h*r-h^2)`
which will lead you to the difficulty of choosing the appropriate starting point and/or the appropriate differential solver.

cheers

`SolveODE(C/ pi/(2*y*r-y^2)+x*0,0,0.001,pi*4/3r^3/C,0.001)`

1

It is possible to solve the equation (it is even possible to plot it from GGb in it implicit form). I got the solution from this PDF.

1

Thank you @-Loco-!! When I get any result I'll publish here

1

Do you know if exists an English version of this document?

2

I don not think so it is from an Swiss professor (https://www.phbern.ch/beat.jaggi). As Juan said the math is universal though.

1

Okay that's truth.. I looked the geogebra file that you provided looks like very complete I believe that it will be very useful thanks a lot!

1

@-Loco-, could you explain how Δt is working in your ggb file? I was trying to make something similar to your example, but I didn't understand how the Δt are updating the time Slider, sorry I'm newbie in Geogebra. Thanks in advance;

1

Hello everyone,

I am back. I am sorry for the late reply. I was pretty busy. Great resources @-Loco- You have implemented the general solution in GeoGebra. I love the animation.

I also made a version, but it just shows the trace. Here is the link: https://ggbm.at/vrzaj6rr

Hope this file is useful.

Cheers!

1

@Caio that Δt has nothing to do with the time slider. It could be linked with it although i did it not. It is only a solving variable to solve the ODE numerically (time step for solving). The numerical solving is not necessary for this file, i let it in there for the sake of completeness.

1

Hello @Juan, don't worry all of us have a lot of things to do in this time of the year, I'm sure that this file will be useful, again thank you so much for the help :)

@-Loco- Got it, I thought that was linked with the time slider because the increment has Δt as value. Did you notice that after putting the fluid the geogebra become very slow? Do you think there is some way to improve this? Also, thank you so much for the help!

Good end of the year for you guys!

2

@Caio do it in 2D, use only lines instead of surfaces or try the method of Juan.

2

Have great holidays!