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

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

[Octave-bug-tracker] [bug #59416] ode15s produce results with inconsesta


From: Hg200
Subject: [Octave-bug-tracker] [bug #59416] ode15s produce results with inconsestance size when compared to other ode solver or matlab.
Date: Fri, 6 Nov 2020 08:01:25 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:81.0) Gecko/20100101 Firefox/81.0

Follow-up Comment #9, bug #59416 (project octave):

I have converted the BISTs of ode15s.m to Matlab and checked with R2018b. I
found a few more problems, but i have also good news ;-)

1.)

++
## Events option add further elements in sol
%!testif HAVE_SUNDIALS
%! opt = odeset ("Events", @feve, "Mass", @massdensefunstate,
%!               "MStateDependence", "none");
%! sol = ode15s (@rob, [0, 100], [1; 0; 0], opt);
%! assert (isfield (sol, "ie"));
%! assert (sol.ie, [0;1]);
%! assert (isfield (sol, "xe"));
%! assert (isfield (sol, "ye"));
%! assert (sol.x(end), 10, 1);
-

In Matlab "assert (sol.ie, [0;1])" fails because ode15s returns [1;2] instead
of [0;1]. But, here we have bug #59063 and Rik already provided a patch for
this. Applying Rik's patch --> Problem is solved.

2.)

++
sol = 

  struct with fields:

     solver: 'ode15s'
    extdata: [1x1 struct]
          x: [1x38 double]
          y: [3x38 double]
         xe: [10.0000 10.0000]
         ye: [3x2 double]
         ie: [2x1 double]
      stats: [1x1 struct]
      idata: [1x1 struct]
--

This is from the example above in Matlab. I think sol.xe and sol.ie must be
also transposed -> TODO??

3.)

++
## Refine
%!testif HAVE_SUNDIALS
%! opt2 = odeset ("Refine", 3, "Mass", @massdensefunstate,
%!                "MStateDependence", "none");
%! opt1 = odeset ("Mass", @massdensefunstate, "MStateDependence", "none");
%! [t, y] = ode15s (@rob, [0, 100], [1; 0; 0], opt1);
%! [t2, y2] = ode15s (@rob, [0, 100], [1; 0; 0], opt2);
%! assert (numel (t2), numel (t) * 3, 3);
--

This fails in Matlab because 

++
numel (t2)
ans =
   163
numel (t)*3
ans =
   165
--

But i think this issue is acceptable for Octave?

I have attached a patch for ode15s. The patch will only pass if fix from bug
#59063 is applied.

ode15i still open.

(file #50215)
    _______________________________________________________

Additional Item Attachment:

File name: patch_ode15s.diff              Size:6 KB
    <https://file.savannah.gnu.org/file/patch_ode15s.diff?file_id=50215>



    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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