# bug #49410: ode solvers use Hermitian conjugate where ordinary transpose is desired

 Submitted by: Rik Submitted on: Fri 21 Oct 2016 10:41:57 PM UTC Category: Octave Function Severity: 3 - Normal Priority: 5 - Normal Item Group: None Status: Fixed Assigned to: None Originator Name: Open/Closed: Closed Release: 4.2.0-rc2 Operating System: Any

Add a New Comment

You are not logged in

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

## Discussion

Sun 23 Oct 2016 10:15:19 AM UTC, comment #6:

Thanks, you are to fast for me :)

Sebastian <sschoeps>
Sun 23 Oct 2016 03:34:00 AM UTC, comment #5:

I changed the additional instances I found in comment #4 and then checked in all of the changes here (http://hg.savannah.gnu.org/hgweb/octave/rev/6b134d294d61).

Rik <rik5>
Sat 22 Oct 2016 08:34:01 PM UTC, comment #4:

Seems correct.  What about these additional instances in ode_event_handler?

private/ode_event_handler.m:91:    evt = evt(:)'; term = term(:)'; dir = dir(:)';
private/ode_event_handler.m:118:        ynew = (y - (t - tnew) * (y - yold) / (t - told))';
private/ode_event_handler.m:145:    evtold = evtold(:)'; told = t; yold = y;

Rik <rik5>
Sat 22 Oct 2016 08:16:24 PM UTC, comment #3:

A patch for this is attached.
It also adds a test in both ode23 and ode45.
I also spotted an additional instance in
runge_kutta_inerpolate.m.

Carlo de Falco <cdf>
Sat 22 Oct 2016 07:27:05 PM UTC, comment #2:

As further confirmation consider the following example

[sol] = ode45 (@(t, x) 1, [0 1], 1i);

the exact solution should be

sol.y = 1i + sol.x

but the actual solution has the wrong sign for the imaginary part.

Carlo de Falco <cdf>
Sat 22 Oct 2016 06:30:42 AM UTC, comment #1:

@Rik

I think this should all be .' and not '

c.

Carlo de Falco <cdf>
Fri 21 Oct 2016 10:41:57 PM UTC, original submission:

Attached is a list of the Hermitian conjugates used in the scripts/ode directory.

@Sebastion: If you could take a look at each instance and decide whether ' or .' is appropriate that would be great.

ode23.m:236:                       solution.x(end,:)', "done", odeopts.funarguments{:});
ode23.m:259:    varargout{1}.x = solution.t';   # Time stamps are saved in field x (row vector)
ode23.m:260:    varargout{1}.y = solution.x';   # Results are saved in field y (row vector)
ode45.m:227:                       solution.x(end,:)', "done", odeopts.funarguments{:});
ode45.m:250:    varargout{1}.x = solution.t';   # Time stamps are saved in field x (row vector)
ode45.m:251:    varargout{1}.y = solution.x';   # Results are saved in field y (row vector)
private/ode_event_handler.m:91:    evt = evt(:)'; term = term(:)'; dir = dir(:)';
private/ode_event_handler.m:118:        ynew = (y - (t - tnew) * (y - yold) / (t - told))';
private/ode_event_handler.m:145:    evtold = evtold(:)'; told = t; yold = y;
private/runge_kutta_interpolate.m:25:      u_interp = interp1 (z, u', t, "linear");

Rik <rik5>

## Attached Files

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

Attach Files:

Comment:

Attached Files
file #38796:  open_l3DBTYkm.txt added by cdf (4KiB - text/plain)

## Dependencies

Depends on the following items: None found

Items that depend on this one: None found

## Mail Notification Carbon-Copy List

Carbon-Copy List
• -email is unavailable- added by sschoeps (Posted a comment)
• -email is unavailable- added by cdf (Posted a comment)
• -email is unavailable- added by rik5 (Submitted the item)
• -email is unavailable- added by rik5
•

Do you think this task is very important?
If so, you can add your encouragement to it.
This task has 0 encouragements so far.

Only project members can vote.

## History

Follow 5 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2016-10-23 rik5 StatusPatch Submitted Fixed
Open/ClosedOpen Closed
2016-10-22 cdf StatusConfirmed Patch Submitted
2016-10-22 cdf Attached File- Added open_l3DBTYkm.txt, #38796
2016-10-21 rik5 Carbon-Copy- Added sschoeps