cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

solving differential equations

ptc-1996077
1-Newbie

solving differential equations

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

7 REPLIES 7

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.

No problem!

(I didn't try for Odesolve)

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.

Capture.JPG

Limit h to positive or the radical to real:

Top Tags