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 that at least helps to gracefully return to the interpreter) 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 |
On 18-Jun-1998, [hidden email] <[hidden email]> wrote:
| 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 | that at least helps to gracefully return to the interpreter) I posted a patch a few weeks ago that fixes this bug. It's available from http://www.che.wisc.edu/octave/mailing-lists/bug-octave/1998/243. | 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. With the patch, your example doesn't crash Octave, but it still fails. However, I don't think the bug is in Octave. With different initial derivaties, it seems to work fine. For example, both of the following calls to dassl succeed (though the second is probably better, since it forces dassl to restart at t == 8). 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 p = dassl ("f", [0;4], [0;0], t=linspace (0, 100)'); p = dassl ("f", [0;4], [0;0], t=linspace (0, 100)', 8); jwe |
Free forum by Nabble | Edit this page |