Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X
Solving Torricelli's Law for the flow out of a cylindrical tank through a round hole is pretty straight forward. It can be done by direct integration. However, when trying to solve it numerically with rkfixed or odesolve I ran into some unexpected problems.
rkfixed gave the message: D(t,h) must be real ! odesolve would not not converge to the efflux time corresponding to h = o. With the substitution u = sq. root h, it was smooth sailing to use either program. Is this a tolerence issue? Something else? It it a pretty straight forward linear 1st degree differential equation after all!
WSU1963
I think your problem is that your equation may be trying to reach ln(0) which is not possible. When you changed to the sq root of h, it is trying to reach 0, which it can do. If I'm not correct, then supply the differential equation that you are trying to solve.
And where the ODE itself?
Please attach your Mathcad worksheet to the message.
Nice work Fred
Wayne
Fred,
If you extend the problem beyond the empty time (1015 s), the integration fails, both for rkfixed and Rkadapt. The fix is to limit the value of h to a positive value.
The snip below shows the failure of rkfixed without the h limit and a solution with the limit. Since the time to empty is usually not known, this eliminates trial and error. This may explain the error Donald was getting.