bugGNU Octave - Bugs: bug #49190, no return to prompt by ode45()...

 
 

bug #49190: no return to prompt by ode45() when blowup of solution occurs

Submitted by:  Andreas Stahel <sha1>
Submitted on:  Mon 26 Sep 2016 11:58:22 AM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: NoneAssigned to: Carlo de Falco <cdf>
Originator Name: Open/Closed: Closed
Release: 4.2.0-rc2Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 27 Sep 2016 12:37:26 PM UTC, comment #5:

Andreas,

The 'problem dependence' is given by the fact
that the choice of minimum time step for which
to stop integrating is given by the location of
the blow up, i.e., for

x'= 1+x^2 => blowup at t=pi/2

the integration will stop when the
estimated dt = eps(pi/2) = 2.2204e-16

for

x'= 2*(1+x^2) => blowup at t=pi/4

the integration will stop when the
estimated dt = eps(pi/4) = 1.1102e-16

AFAIU, in the old version the minimum time
step was computed as eps (tspan(2) - tspan(1))
which would have been eps (2) = 4.4409e-16
in both cases.

the choice made by matlab also depends on the
problem (i.e. it depends on the location of
the blow-up) but the value that matlab chooses
is consistently larger than mine and I couldn't
find anywhere documentation of its particular choice

c.

Carlo de Falco <cdf>
Project MemberIn charge of this item.
Tue 27 Sep 2016 08:51:25 AM UTC, comment #4:

Hello Carlo

Thank you for the quick fix.
This is Open Source at its best!

The "feature" might not be problem dependent after all.
The exact solutions blow up at different times

x'= 1+x^2 with x(0)=0 solved by x(t) = tan(t), blowup at t=pi/2
x'= 2(1+x^2) with x(0)=0 solved by x(t) = tan(2t), blowup at t=pi/4
If the stepsize is made smaller and smaller, (since x(t) is larger and larger), the solvers will slow down. With a minimal step size, it will stop.

Thank you for the patch

Andreas

Andreas Stahel <sha1>
Tue 27 Sep 2016 08:46:15 AM UTC, comment #3:

Hi,

I pushed this changeset that should solve the issue:
http://hg.savannah.gnu.org/hgweb/octave/rev/21c89e691804

Actually the push was unintentional because the minimum
value for the timestep now used for stopping the integration
is much smaller than what is used in matlab and I suspect this
may sometimes not work, anyway it is an improvement and should
do no harm (all existing tests still pass) so I don't see a
problem with getting this into the 4.2 release.

Carlo de Falco <cdf>
Project MemberIn charge of this item.
Mon 26 Sep 2016 03:01:36 PM UTC, comment #2:

It seems the old version was using

which is not the same as Matlab and is not dependent
on the particular problem beinf solved.

Carlo de Falco <cdf>
Project MemberIn charge of this item.
Mon 26 Sep 2016 02:38:29 PM UTC, comment #1:

Hi,

Thanks for reporting this.

I tested the same example in Matlab
and it seems what happens there is
that the simulation is stopped issuing
a warning when the timestep becomes too
small.

I was not able to find documentation
of the value being set for the minimum
timestep though. Some testing seems to
indicate this is problem dependent ...

any idea what would be a reasonable to select this value?

c.

Carlo de Falco <cdf>
Project MemberIn charge of this item.
Mon 26 Sep 2016 11:58:22 AM UTC, original submission:

Dear developers

when calling
[t,x]=ode45(@(t,x)1+x.^2,[0,2],0)
Octave does not return to prompt at all
while
[t,x]=ode45(@(t,x)1+x.^2,[0,1],0)
leads to a correct result
The exact solution of the ODE is x(t) = tan(t)
Thus the failing situation is running into a blowup of the solution.

The "old" package odepkg solves the problem with an appropriate warning message.

Andreas Stahel <sha1>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by cdf (Posted a comment)
  • -unavailable- added by cdf
  • -unavailable- added by cdf
  • -unavailable- added by cdf
  • -unavailable- added by sha1 (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 27 Sep 2016 12:37:55 PM UTCcdfOpen/ClosedOpen=>Closed
    Mon 26 Sep 2016 02:38:29 PM UTCcdfAssigned toNone=>cdf
      Carbon-Copy-=>Added -unavailable-
      Carbon-Copy-=>Added -unavailable-
      Carbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup1