octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #54729] odeset: 'AbsTol' must be a column-vect


From: Kai Torben Ohlhus
Subject: [Octave-bug-tracker] [bug #54729] odeset: 'AbsTol' must be a column-vector
Date: Tue, 25 Sep 2018 16:41:18 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36

URL:
  <https://savannah.gnu.org/bugs/?54729>

                 Summary: odeset: 'AbsTol' must be a column-vector
                 Project: GNU Octave
            Submitted by: siko1056
            Submitted on: Tue 25 Sep 2018 10:41:17 PM CEST
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Matlab Compatibility
                  Status: None
             Assigned to: siko1056
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.4.1
        Operating System: Any

    _______________________________________________________

Details:

According to the Matlab documentation, the "odeset" parameter 'AbsTol' is
allowed to be a vector:

  
https://www.mathworks.com/help/matlab/ref/odeset.html#namevaluepairarguments

As the following example shows, this vector must be a column vector to work
properly in Octave.  This is not required in Matlab and undocumented in
Octave:

  
https://octave.org/doc/interpreter/Matlab_002dcompatible-solvers.html#XREFodeset


f = @(t,y) [y(2); (1 - y(1).^2) .* y(2) - y(1)];

[t, v] = ode45 (f, [0, 10], [3; -3]);
options = odeset ('RelTol', 1e-12, 'AbsTol', [1e-12 1e-12]);
[s, w] = ode45 (f, [0, 10], [3; -3], options);
## ERROR in previous line due to options.AbsTol being a column-vector:
##
## error: starting_stepsize: operator /: nonconformant arguments (op1 is 1x1,
op2 is 1x2)
## error: called from
##     starting_stepsize at line 72 column 8
##     ode45 at line 192 column 25
##     odeset_bug at line 5 column 6

options = odeset ('RelTol', 1e-12, 'AbsTol', [1e-12; 1e-12]);  ## WORKS
[s, w] = ode45 (f, [0, 10], [3; -3], options);


An easy fix would be to ensure the vector orientation via "AbsTol(:)" in the
function "AbsRel_norm":

  
https://hg.savannah.gnu.org/hgweb/octave/file/49734a75561f/scripts/ode/private/AbsRel_norm.m

I can apply a patch for this, if there are no objections.





    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?54729>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]