# Guidance sought with numerical ODE solution

1. Apr 27, 2010

### groston

The following image is from an old heat transfer book - my problem is quite similar. Note that for this discussion, only equation 4-6 need be considered.
[PLAIN]http://www.pairofdocs.net/images/eq.jpg [Broken]

Consider the case when the liquid is being added to the tank at a constant rate, and without loss of generality, assume that the temperature of the liquid is higher than that of the container.

Equation 4.6 can be simplified for the purpose of my question to this:

$$K = -m\dot{T_{1}}$$

We know from physics that the temperature of the liquid will never be lower than the temperature of the container. However, if the value for m is sufficiently small, then $$\dot{T_{1}}$$ times the time step for the numerical integrator (dt) will yield a result such that:

$$T_{1}-\dot{T_{1}}dt<T_{2}$$

and this is clearly not possible. How can this happen? Quite simply by using a RK routine which automatically adjusts the step size. (And, needless to say, when this happens, the routine blows up.)

It occurred to me that one work-around is to not allow the value of m be reduced to less than some value, perhaps

$$m=\frac{K dt}{T_{1}-T_{2}}$$

Does this seem reasonable? Can you suggest another approach to solving this problem?

Last edited by a moderator: May 4, 2017