bugGNU Octave - Bugs: bug #47654, ode23/ode45 do not allow zero...

 
 

bug #47654: ode23/ode45 do not allow zero value for tolerance

Submitted by:  Carlo de Falco <cdf>
Submitted on:  Sat 09 Apr 2016 04:11:36 AM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: FixedAssigned to: Carlo de Falco <cdf>
Originator Name: Open/Closed: Closed
Release: devOperating System: Any

Discussion locked!

 

(Jump to the original submission Jump to the original submission)

Wed 23 Nov 2016 10:19:35 AM UTC, comment #6:

Octave 4.2:

Matlab 2016a

The behaviour looks compatible to me, I think we can close this item.

Carlo de Falco <cdf>
Project MemberIn charge of this item.
Wed 23 Nov 2016 04:28:07 AM UTC, comment #5:

The current Octave code allows setting AbsTol or RelTol to 0. However, ode23 will not allow a 0 for either tolerance.

This is Matlab compatible. Is that good enough and we can close this report?

Testing was done on the development branch with cset 86bb7c37a1b9.

Rik <rik5>
Project Administrator
Sat 09 Apr 2016 03:32:14 PM UTC, comment #4:

I have version R2016a, but I was wrong: Matlab is able to construct odeset with AbsTol or/and RelTol equal to zero.

What Matlab doesn't allow to do is to use inside ode23 and ode45 these options.
The output I posted was an error from the call to ode23 and ode45 and was not regarding odeset, that had correctly constructed the option struct.

The changeset I prepared fix the bug in odeset but allow ode23 and ode45 to receive AbsTol or RelTol equal to zero as input. This could be considered as an extension of Matlab code, or as an incompatibility. If this is the case, I will modify the code of these solvers in order to give the same output as Matlab (an error).

Francesco Faccio <francesco_faccio>
Sat 09 Apr 2016 02:30:53 PM UTC, comment #3:

Hi Francesco, thanks for looking into this.
In Matlab 2005b I get:

what version of Matlab did you try on?

Carlo de Falco <cdf>
Project MemberIn charge of this item.
Sat 09 Apr 2016 02:01:07 PM UTC, comment #2:

Let me explain better the second point of the previous post: that warning appears when I set both AbsTol and RelTol to zero, because in function AbsRel_Norm there is an element by element division and the denominator depends on these two parameters. So for any index of the vectors AbsRel and AbsTol, there must be at most one element equal to zero.

I have checked the latest version of Matlab and if I set the options using opt=odeset('AbsTol', 0, 'RelTol', 1e-3) I get:

or, if I set RelTol to zero:

In the latest version of Matlab it's not allowed to set one of these options to zero, so this may not be considered a bug anymore.

Francesco Faccio <francesco_faccio>
Sat 09 Apr 2016 12:25:54 PM UTC, comment #1:

Dear Carlo,

I have modified the file ode_struct_value_check.m and now it is allowed to set RelTol=0 or AbsTol=0 (the changeset is in the file odestructvaluecheck.diff, I hope to have written it in the correct way).

While I was testing the code I discovered this

so I have put an error message in the file AbsRel_Norm.m in order to check if almost one of the elements of the two vectors AbsTol and RelTol is set to zero. This changeset is in AbsRelNorm.diff

Should I write also some tests in ode23 and ode45?

Best regards,

Francesco Faccio

(file #36872, file #36873)

Francesco Faccio <francesco_faccio>
Sat 09 Apr 2016 04:11:36 AM UTC, original submission:

In Matlab, odeset allows to set either 'AbsTol' or 'RelTol'
to 0, which is useful in order to disable one of the two
error checks.

In Octave this is not allowed:

Carlo de Falco <cdf>
Project MemberIn charge of this item.

 

Attached Files
file #36873:  AbsRelNorm.diff added by francesco_faccio (941B - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by francesco_faccio (Updated the item)
  • -unavailable- added by cdf (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 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 23 Nov 2016 10:19:35 AM UTCcdfStatusNeed Info=>Fixed
      Open/ClosedOpen=>Closed
      Discussion LockUnlocked=>Locked
    Wed 23 Nov 2016 04:28:07 AM UTCrik5StatusIn Progress=>Need Info
      Summaryodeset does not allow zero value for tolerance=>ode23/ode45 do not allow zero value for tolerance
    Sat 09 Apr 2016 12:25:54 PM UTCfrancesco_faccioAttached File-=>Added odestructvaluecheck.diff, #36872
      Attached File-=>Added AbsRelNorm.diff, #36873

    Back to the top


    Powered by Savane 3.1-cleanup1