comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: LSODE status=-1
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: LSODE status=-1 [message #82874] Mon, 21 January 2013 16:35
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
On Monday, January 21, 2013 4:42:39 PM UTC-5, hal...@yahoo.com wrote:
> On Monday, January 21, 2013 4:17:00 PM UTC-5, Craig Markwardt wrote:
>
>> On Monday, January 21, 2013 2:48:08 PM UTC-5, hal...@yahoo.com wrote:
>
>>
>
>>> On Monday, January 21, 2013 2:28:54 PM UTC-5, Craig Markwardt wrote:
>
>>
>
>>>
>
>>
>
>>>> If you call LSODE with the exact same inputs, I don't think it's a surprise that you get the exact same results.
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> My suggestion: Instead of calling LSODE with the exact same inputs, move on to the next desired integration interval. A status value of -1 indicates "success with some difficulty" which means you should just carry onwards.
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> Also, you might consider trying my DDEABM integrator:
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> http://www.physics.wisc.edu/~craigm/idl/math.html#DDEABM
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> I can't guarantee it will work any better, but it might.
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> Craig
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>> Thanks for the reply. The thing is, I have found that the results are unreliable when status=-1. The wording of the IDL help page makes me think that the computation was interrupted at an incomplete stage and can be resumed somehow. The help page for LSODE says that if you set the input status to 2 then that means "This is not the first call. The calculation is to continue normally." I am setting the input status to 2 after it comes back as -1. If you set the status to 1 then it means "initializations will occur."
>
>>
>
>>
>
>>
>
>> I don't think it means what you think it means. My understanding is that STATUS=-1 means the routine things it completed with a reliable answer, but it was expensive. You can proceed to the next interval if you wish. If your judgement tells you the result is unreliable, then you probably have to restart the integration or use a different algorithm.
>
>>
>
>>
>
>>
>
>>> I downloaded DDEABM a few days ago, but I would like to try to get LSODE to work if possible. The reason for status=-1 might have to do with "stiffness" in the system of differential equations. DDEABM documentation says it isn't intended for stiff equations, but my work-around for that will just be to keep subdividing the interval automatically until there aren't any stiffness errors.
>
>>
>
>>
>
>>
>
>> Fair enough. Incidentally, DDEABM performs automatic subdivision. According to the original documentation, it can handle mildly stiff equations.
>
>>
>
>>
>
>>
>
>> Craig
>
>
>
> DDEABM will still work for stiff equations, but the problem is that it is inefficient, right?

I'm not sure. I think for for truly stiff equations DDEABM will not function properly.

> The notes in DDEABM refer to "DDEBDF in DEPAC" for stiff equations. There is no IDL code for DDEBDF, right?

Right, and right.

LSODE, the original ODEPACK FORTRAN subroutine, has a flag which allows the user to tell it which method to use (stiff or not stiff). LSODE, the IDL routine, does not have this. I'm not sure what this means.

It could mean that LSODE, the IDL routine, has some kind of automatic detection code that the FORTRAN subtroutine does not, which picks which method to use based on the user's derivative function. Or, it could mean that the IDL developers made a choice for you ahead of time (stiff only; or non-stiff only).

If you read carefully archived discussions of the IDL routine, you will see that there are several complaints about this routine being an unexplained black box.

Craig
Re: LSODE status=-1 [message #82876 is a reply to message #82874] Mon, 21 January 2013 13:42 Go to previous message
hal_k3 is currently offline  hal_k3
Messages: 3
Registered: January 2013
Junior Member
On Monday, January 21, 2013 4:17:00 PM UTC-5, Craig Markwardt wrote:
> On Monday, January 21, 2013 2:48:08 PM UTC-5, hal...@yahoo.com wrote:
>
>> On Monday, January 21, 2013 2:28:54 PM UTC-5, Craig Markwardt wrote:
>
>>
>
>>> If you call LSODE with the exact same inputs, I don't think it's a surprise that you get the exact same results.
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>> My suggestion: Instead of calling LSODE with the exact same inputs, move on to the next desired integration interval. A status value of -1 indicates "success with some difficulty" which means you should just carry onwards.
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>> Also, you might consider trying my DDEABM integrator:
>
>>
>
>>>
>
>>
>
>>> http://www.physics.wisc.edu/~craigm/idl/math.html#DDEABM
>
>>
>
>>>
>
>>
>
>>> I can't guarantee it will work any better, but it might.
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>> Craig
>
>>
>
>>
>
>>
>
>> Thanks for the reply. The thing is, I have found that the results are unreliable when status=-1. The wording of the IDL help page makes me think that the computation was interrupted at an incomplete stage and can be resumed somehow. The help page for LSODE says that if you set the input status to 2 then that means "This is not the first call. The calculation is to continue normally." I am setting the input status to 2 after it comes back as -1. If you set the status to 1 then it means "initializations will occur."
>
>
>
> I don't think it means what you think it means. My understanding is that STATUS=-1 means the routine things it completed with a reliable answer, but it was expensive. You can proceed to the next interval if you wish. If your judgement tells you the result is unreliable, then you probably have to restart the integration or use a different algorithm.
>
>
>
>> I downloaded DDEABM a few days ago, but I would like to try to get LSODE to work if possible. The reason for status=-1 might have to do with "stiffness" in the system of differential equations. DDEABM documentation says it isn't intended for stiff equations, but my work-around for that will just be to keep subdividing the interval automatically until there aren't any stiffness errors.
>
>
>
> Fair enough. Incidentally, DDEABM performs automatic subdivision. According to the original documentation, it can handle mildly stiff equations.
>
>
>
> Craig

DDEABM will still work for stiff equations, but the problem is that it is inefficient, right?

The notes in DDEABM refer to "DDEBDF in DEPAC" for stiff equations. There is no IDL code for DDEBDF, right?

Thanks,
Hal
Re: LSODE status=-1 [message #82877 is a reply to message #82876] Mon, 21 January 2013 13:17 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
On Monday, January 21, 2013 2:48:08 PM UTC-5, hal...@yahoo.com wrote:
> On Monday, January 21, 2013 2:28:54 PM UTC-5, Craig Markwardt wrote:
>
>> If you call LSODE with the exact same inputs, I don't think it's a surprise that you get the exact same results.
>
>>
>
>>
>
>>
>
>> My suggestion: Instead of calling LSODE with the exact same inputs, move on to the next desired integration interval. A status value of -1 indicates "success with some difficulty" which means you should just carry onwards.
>
>>
>
>>
>
>>
>
>> Also, you might consider trying my DDEABM integrator:
>
>>
>
>> http://www.physics.wisc.edu/~craigm/idl/math.html#DDEABM
>
>>
>
>> I can't guarantee it will work any better, but it might.
>
>>
>
>>
>
>>
>
>> Craig
>
>
>
> Thanks for the reply. The thing is, I have found that the results are unreliable when status=-1. The wording of the IDL help page makes me think that the computation was interrupted at an incomplete stage and can be resumed somehow. The help page for LSODE says that if you set the input status to 2 then that means "This is not the first call. The calculation is to continue normally." I am setting the input status to 2 after it comes back as -1. If you set the status to 1 then it means "initializations will occur."

I don't think it means what you think it means. My understanding is that STATUS=-1 means the routine things it completed with a reliable answer, but it was expensive. You can proceed to the next interval if you wish. If your judgement tells you the result is unreliable, then you probably have to restart the integration or use a different algorithm.

> I downloaded DDEABM a few days ago, but I would like to try to get LSODE to work if possible. The reason for status=-1 might have to do with "stiffness" in the system of differential equations. DDEABM documentation says it isn't intended for stiff equations, but my work-around for that will just be to keep subdividing the interval automatically until there aren't any stiffness errors.

Fair enough. Incidentally, DDEABM performs automatic subdivision. According to the original documentation, it can handle mildly stiff equations.

Craig
Re: LSODE status=-1 [message #82879 is a reply to message #82877] Mon, 21 January 2013 11:48 Go to previous message
hal_k3 is currently offline  hal_k3
Messages: 3
Registered: January 2013
Junior Member
On Monday, January 21, 2013 2:28:54 PM UTC-5, Craig Markwardt wrote:
> If you call LSODE with the exact same inputs, I don't think it's a surprise that you get the exact same results.
>
>
>
> My suggestion: Instead of calling LSODE with the exact same inputs, move on to the next desired integration interval. A status value of -1 indicates "success with some difficulty" which means you should just carry onwards.
>
>
>
> Also, you might consider trying my DDEABM integrator:
>
> http://www.physics.wisc.edu/~craigm/idl/math.html#DDEABM
>
> I can't guarantee it will work any better, but it might.
>
>
>
> Craig

Thanks for the reply. The thing is, I have found that the results are unreliable when status=-1. The wording of the IDL help page makes me think that the computation was interrupted at an incomplete stage and can be resumed somehow. The help page for LSODE says that if you set the input status to 2 then that means "This is not the first call. The calculation is to continue normally." I am setting the input status to 2 after it comes back as -1. If you set the status to 1 then it means "initializations will occur."

I downloaded DDEABM a few days ago, but I would like to try to get LSODE to work if possible. The reason for status=-1 might have to do with "stiffness" in the system of differential equations. DDEABM documentation says it isn't intended for stiff equations, but my work-around for that will just be to keep subdividing the interval automatically until there aren't any stiffness errors.

Hal
Re: LSODE status=-1 [message #82880 is a reply to message #82879] Mon, 21 January 2013 11:36 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Craig Markwardt writes:

> If you call LSODE with the exact same inputs, I don't think it's a surprise that you get the exact same results.

What!? But, I thought... Oh, never mind. ;-)

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: LSODE status=-1 [message #82881 is a reply to message #82880] Mon, 21 January 2013 11:28 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
On Monday, January 21, 2013 1:12:41 PM UTC-5, hal...@yahoo.com wrote:
> I am having trouble using the IDL LSODE function for solving differential equations. It returns with status=-1. The help page says "To continue, reset STATUS to a value greater than 1 and begin again (the excess work step counter will be reset to 0)." I have tried this, but I am not getting anywhere with it. Part of the problem is that it is not clear what "begin again" means. I have tried calling LSODE again with the exact same inputs, except with status set to 2 (with no modifications to Y, X, H, and Derivs since the previous call). This doesn't seem to do anything. The status keeps coming back as -1, and the result doesn't change. Am I supposed to use different input values for repeated calls? If so, which values?

If you call LSODE with the exact same inputs, I don't think it's a surprise that you get the exact same results.

My suggestion: Instead of calling LSODE with the exact same inputs, move on to the next desired integration interval. A status value of -1 indicates "success with some difficulty" which means you should just carry onwards.

Also, you might consider trying my DDEABM integrator:
http://www.physics.wisc.edu/~craigm/idl/math.html#DDEABM
I can't guarantee it will work any better, but it might.

Craig
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Imposing inverse fft to be real
Next Topic: Re: Imposing inverse fft to be real

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 17:39:49 PDT 2025

Total time taken to generate the page: 0.00636 seconds