help-octave
[Top][All Lists]

## dassl

 From: stein Subject: dassl Date: Thu, 18 Jun 1998 17:40:28 +0200 (MET DST)

```Hi,

this is some question relating dassl. I've formulated a simple
differential-algebraic problem. At a singularity, dassl crashes
and leaves octave completely. So I end up with the following
question:

How can such a crashing be avoided? (Perhaps there is a bugfix

Anyway, I tried to set the following hint from the handbook into operation:

"The fifth argument {to dassl} is optional, and may be used to specify a set of
times that the DAE solver should not integrate past. It is useful for avoiding
difficulties with singularities and points where there is a discontinuity in
the derivative."

But I failed because I didn't find any example of how to specify
a set of times that the DAE solver should not integrate past.

Can anybody give me a clue?

Thank you very much,

Benno

-----------------------------------------------------------------------------

# Example problem:

octave.bin:1> function res = f(x,xdot,t)
> res(1) = xdot(1)-x(2);
> res(2) = 16 - x(1) - sign(x(2)) * x(2) * x(2);
> end

# Dassl works fine for t<8 or t>8:

octave.bin:3> p = dassl("f",[0;4],[4;0],(t=linspace (0, 8)'));
octave.bin:4> gplot p(:,1)
octave.bin:5> gplot p(:,2)
octave.bin:6> p = dassl("f",[16;0],[0;0],(t=linspace (8, 16)'));

# However, at time point t=8, x(2) is not differentiable - and octave
# crashes completely when integrating beyond that point:

octave.bin:9> p = dassl("f",[0;4],[4;0],(t=linspace (0, 10)'));
***MESSAGE FROM ROUTINE DDASSL IN LIBRARY SLATEC.
***POTENTIALLY RECOVERABLE ERROR, PROG ABORTED, TRACEBACK REQUESTED
*  AT T =    8.000001E+00  AND STEPSIZE H =    1.098303E-14  THE CORRECTOR
*  FAILED TO CONVERGE REPEATEDLY OR WITH ABS(H)=HMIN
*  ERROR NUMBER = -7
*
***END OF MESSAGE

***JOB ABORT DUE TO UNRECOVERED ERROR.
0          ERROR MESSAGE SUMMARY
LIBRARY    SUBROUTINE MESSAGE START             NERR     LEVEL     COUNT
SLATEC     DDASSL     AT T =    8.000001E+        -7         1         1

error: exception encountered in Fortran subroutine ddassl
error: unrecoverable error in dassl
error: segmentation violation -- stopping myself...
attempting to save variables to `octave-core'...
save to `octave-core' complete

```