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

 
 

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

Submitter:  Sebastian <sschoeps>
Submitted:  Fri 21 Oct 2016 10:26:16 AM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 4.2.0-rc2 Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

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>
Group 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>
Group 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>
Group 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 Files:
   
   
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
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by sschoeps (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-10-21 rik5 StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2016-10-21 sschoeps Attached File- Added ode_sol_trans2.patch, #38790
    2016-10-21 rik5 StatusNone Confirmed
    2016-10-21 sschoeps Attached File- Added ode_sol_trans.patch, #38783

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code