how to stop integration in IMSL_ODE ? [message #73493] |
Thu, 11 November 2010 07:05 |
christophe petit
Messages: 1 Registered: November 2010
|
Junior Member |
|
|
Good morning,
i have a problem using the IMSL_ODE routine. I would like this routine
to stop to integrate when the solution y(t) becomes negative. For the
moment, i can't make it to stop and after reaching the last positve
solution step, i have got the following error :
"IMSL Error: IMSL_ODE: Fatal error: MATH_REPEATED_ERR_TEST_FAILURE:
After
some initial success, the integration was halted by repeated error
test
failures."
I tried to use a catch block in this way :
...
CATCH, Error_status
if Error_status ne 0 then begin
CATCH, /CANCEL
PRINT, 'Error message: ', !ERROR_STATE.MSG
print, 'the integration is stopped '
plot, t, result(0,*)
return
ENDIF
result=IMSL_ODE(t,init,'f',hinit=1d-15,max_steps=n_max,toler ance=1d-15,/
double,method=1)
....
But at the execution, it says that it doesn't know "result" variable
when i call "plot, t, result(0,*)" in the catch block (to plot the
y(t) solution)
It seems that the "result" variable values are destroyed if the
IMSL_ODE routine encounters an error.
How can i make the routine to stop the integration and in the same
time, save the "result" values which have been processed before the
error ?
Thanks in advance.
|
|
|