bugGNU Octave - Bugs: bug #50192, ode15s does not work when the...

 
 

bug #50192: ode15s does not work when the initial value is a row

Submitted by:  Marco Caliari <caliari>
Submitted on:  Tue 31 Jan 2017 10:15:12 AM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Unexpected Error
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

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

Wed 06 Sep 2017 04:09:18 PM UTC, comment #10:

Thanks for the review. I changed the text in this cset (http://hg.savannah.gnu.org/hgweb/octave/rev/3d65720cd68a).

Rik <rik5>
Project Administrator
Wed 06 Sep 2017 03:26:30 PM UTC, comment #9:

@Rik: in the second testif you added in ode15s.m (or, last line of ode15s.m) YP0 should be replaced by Y0.

Marco Caliari <caliari>
Project Member
Tue 05 Sep 2017 06:50:11 PM UTC, comment #8:

@Marco: I committed a modified version of your patch here (http://hg.savannah.gnu.org/hgweb/octave/rev/6e7bb85e32b8). I decided not to rename y0 and yp0 since those are the names that Matlab uses and many users may be familiar with them.

Thus, the change was principally to check_default_input which now validates y0 and yp0 more carefully, and then transforms them to column vectors.

Perhaps you could pull and then run

and see if everything still passes. I don't have SUNDIALS so these tests are all skipped on my computer.

Rik <rik5>
Project Administrator
Thu 09 Feb 2017 10:37:55 AM UTC, comment #7:

The new patch for check_default_input.m now checks for nonnumeric or nonvector init or initp and transform them into columns. I changed y0 into init and y0p into initp everywhere (or should I have changed init into y0 in both ode45 and ode23?). I added tests for initial row vectors (now allowed) and nonvector initial values (an initial value as a square matrix produces a segfault, without this patch).

Should be ode23 and ode45 modified in order to use check_dafault_input?

(file #39709)

Marco Caliari <caliari>
Project Member
Wed 08 Feb 2017 05:25:14 PM UTC, comment #6:

Good point, I will modify the patch.

Marco Caliari <caliari>
Project Member
Wed 08 Feb 2017 04:42:17 PM UTC, comment #5:

This time the patch uploaded correctly. I have a question, would it not be better to check that the initial conditions are vectors, and then force them to be column vectors? This is what is doen in ode23.m as shown below:

The current patch changes private/check_default_input.m

This will allow matrices through because they will be turned into column vectors, when in fact the user has probably made some mistake by using a matrix as input.

Rik <rik5>
Project Administrator
Wed 08 Feb 2017 07:47:24 AM UTC, comment #4:

I try again to upload the patch.

(file #39702)

Marco Caliari <caliari>
Project Member
Wed 08 Feb 2017 05:18:55 AM UTC, comment #3:

I'm unable to download the patch you attached. This might be something wrong with Savannah, or it might be that your upload was corrupted. Could you try putting the file on Savannah again?

Rik <rik5>
Project Administrator
Sun 05 Feb 2017 05:20:08 PM UTC, comment #2:

Done. I allowed ode15i to work with both y0 and y0p row vectors, as written in the documentation, although the following

does not work in Matlab R2014b.
Moreover, in all the integrators I see a sentence like

This is true, but it is true also if @var{init} is a column vector.

(file #39673)

Marco Caliari <caliari>
Project Member
Sun 05 Feb 2017 03:37:55 PM UTC, comment #1:

Can you prepare a cset for this with a few BIST tests? The solution seems quite simple.

Rik <rik5>
Project Administrator
Tue 31 Jan 2017 10:15:12 AM UTC, original submission:

The following code

does not work, while it works in Matlab and works in Octave with ode23 and ode45 instead of ode15s. I guess it is enough to change y0 to y0(:) around lines 56 and 59 of check_default_input.m (probably the same with yp0).

Marco Caliari <caliari>
Project Member

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #39709:  ode15s.diff added by caliari (14KiB - application/x-tex)
file #39702:  ode15s.diff added by caliari (5KiB - application/x-tex)
file #39673:  ode15s.diff added by caliari (5KiB - application/x-tex)

 

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 caliari (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 06 Sep 2017 04:09:18 PM UTCrik5StatusPatch Reviewed=>Fixed
    Wed 06 Sep 2017 03:26:30 PM UTCcaliariStatusFixed=>Patch Reviewed
    Tue 05 Sep 2017 06:50:11 PM UTCrik5StatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Thu 09 Feb 2017 10:37:55 AM UTCcaliariAttached File-=>Added ode15s.diff, #39709
    Wed 08 Feb 2017 07:47:24 AM UTCcaliariAttached File-=>Added ode15s.diff, #39702
    Sun 05 Feb 2017 05:20:08 PM UTCcaliariAttached File-=>Added ode15s.diff, #39673

    Back to the top


    Powered by Savane 3.1-cleanup1