bugGNU Octave - Bugs: bug #49402, Output of odeXY must be transposed...

 
 

bug #49402: Output of odeXY must be transposed when returning a structure

Submitted by:  Sebastian <sschoeps>
Submitted on:  Fri 21 Oct 2016 10:26:16 AM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: 4.2.0-rc2Operating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Fri 21 Oct 2016 10:42:58 PM UTC, comment #5:

@Sebastion: I filed a new bug report #49410 to track the hermitian/ordinary transpose question. Yes, if you could take a look at the report that would help.

Rik <rik5>
Project Administrator
Fri 21 Oct 2016 09:54:20 PM UTC, comment #4:

You are right. I should have used .' I never tried to solve complex valued ODEs with Octave but it should be possible. @Carlo: did you ever test this?

Shall I prepare another changeset?

Sebastian <sschoeps>
Fri 21 Oct 2016 09:42:19 PM UTC, comment #3:

@Sebastian: The new patch applied just fine. It was only a diff file, rather than a changeset, so I added a changelog entry and checked it in to Mercurial under your name since you did the work. See http://hg.savannah.gnu.org/hgweb/octave/rev/bc61ed076549.

One additional question, is there ever a way to get complex numbers from an ODE? I notice that we are using Hermitian transpose, single ', when most of the time what we really require is just a physical transpose with no complex conjugation, .' operator. It doesn't matter, of course, for real-valued matrices.

This is fixed and I'm going to close the report.

Rik <rik5>
Project Administrator
Fri 21 Oct 2016 08:49:22 PM UTC, comment #2:

The previous patch was for 4.2.0r2. The current patch should be applicable to devel.
I have fixed ode23 and ode45; also the help text is refined.

Seb.

Sebastian <sschoeps>
Fri 21 Oct 2016 07:41:18 PM UTC, comment #1:

The patch does not apply cleanly to the stable branch so I could not commit it. However, the approach is generally correct.

I would suggest a few things. First, the transpose when nargout == 1 is correct. Second, the documentation needs to be updated to mention this really odd Matlab compatibility hack. Third, the solution needs to be extended to ode45.m as well.

I can review such a patch as soon as it is ready and push it to stable before the 4.2.0 release date.

Rik <rik5>
Project Administrator
Fri 21 Oct 2016 10:26:16 AM UTC, original submission:

Output of odeXY must be transposed when returning a structure.

This es example says everything:
fvdb = @(vt,vy) [vy(2); (1 - vy(1)^2) * vy(2) - vy(1)];
sol=ode23(fvdb,[0 40],[2 0]);
size(sol.x)
%[309 1] instead of [1 309] in Matlab
size(sol.y)
%[309 2] instead of [2 309] in Matlab

Patch for ode23 is attached.

Sebastian <sschoeps>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #38790:  ode_sol_trans2.patch added by sschoeps (11KiB - application/octet-stream)
file #38783:  ode_sol_trans.patch added by sschoeps (5KiB - application/octet-stream)

 

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 sschoeps (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
    Fri 21 Oct 2016 09:42:32 PM UTCrik5StatusConfirmed=>Fixed
      Open/ClosedOpen=>Closed
    Fri 21 Oct 2016 08:47:14 PM UTCsschoepsAttached File-=>Added ode_sol_trans2.patch, #38790
    Fri 21 Oct 2016 07:41:18 PM UTCrik5StatusNone=>Confirmed
    Fri 21 Oct 2016 10:26:16 AM UTCsschoepsAttached File-=>Added ode_sol_trans.patch, #38783

    Back to the top


    Powered by Savane 3.1-cleanup1