Re: Runge-Kutta question



Tom wrote:
Hi,
I am stuck with what first seemed a straightforward Runge-Kutta (4th
order) integration of an ODE of the form dT/dp=C(p,T) T used to
describe an adiabat; T and p are temperature and pressure,
respectively, and C(p,T) are p,T-dependent material parameters. The
problem seems to arise when I try to introduce phase transitions,
which induce kinks in the adiabat, i.e. T is continuous, but its
derivative is not, although the jumps are not always large. I can
calculate how dT/dp has to be modified in the regions of phase
transformation, which are of finite and sometimes substantial width,
but the kinks are of course there and cause the solution to misbehave
in various ways, depending on how narrow the region is. Is there a
recommended way of dealing with such kinks, or in other words, do I
have to integrate piecewise, and how do I do that best?

Try to solve only up to the point in time where C is not smooth.
Then do any modifications on C and restart at that point in time
until the next time where C is not smooth, and so on.

E.g. in Scilab (www.scilab.org) there is a function ode_root
where you can specify a (nonlinear) condition for stopping the
integration.


--
Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany
.



Relevant Pages

  • Re: Runge-Kutta question
    ... point of phase transitions) and, therefore, a numerical solution goes crazy. ... Try regularizing the heat capacity by replacing the jump with a steep, ... Your ODE will then have an analytical ... the integration step to really small values. ...
    (sci.math.num-analysis)
  • Re: Runge-Kutta question
    ... but the kinks are of course there and cause the solution to misbehave ... restart the integration there. ... or, at least, you use a very small tolerance and integrate using stepsize control. ... in this case the integrator will detect the discontinuity itself by reducing the ...
    (sci.math.num-analysis)