[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #60748] lsode throws an unexpected and ill-fou
From: |
David Leipold |
Subject: |
[Octave-bug-tracker] [bug #60748] lsode throws an unexpected and ill-founded error |
Date: |
Mon, 7 Jun 2021 17:15:44 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36 Edg/91.0.864.41 |
URL:
<https://savannah.gnu.org/bugs/?60748>
Summary: lsode throws an unexpected and ill-founded error
Project: GNU Octave
Submitted by: dleipold
Submitted on: Mon 07 Jun 2021 09:15:42 PM UTC
Category: Octave Function
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Unexpected Error or Warning
Status: None
Assigned to: None
Originator Name:
Originator Email:
Open/Closed: Open
Release: 6.2.0
Discussion Lock: Any
Operating System: Microsoft Windows
_______________________________________________________
Details:
I encountered a strange "inconsistent sizes for state and derivative vectors
error" while composing a large system of odes joining several vector valued
functions.
I could boil the problem down to the (quite constructed) case below: Two
functions that are numerically perfectly identical, proven by assert on a
random vector. The obscure definition of g triggers something in lsodes cores.
I would expect lsode to call f exclusively with numerically valued vectors of
size(x0), so this is a bug for me. Workaround is possible but very nasty -> I
seem to have to un-vectorize the function?
x0=[1,0];
f=@(x) [-x(2),x(1)];%some vector function
slnf=lsode(f,x0,[0,pi]);%correct
g=@(x) circshift(x,1).*linspace(-1,1,length(x));%strange but
xr=rand(1,2);
assert(g(xr)==f(xr)); %they are perfectly equal in 2D
slng=lsode(g,x0,[0,pi]); %error: inconsistent sizes for state and derivative
vectors
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?60748>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #60748] lsode throws an unexpected and ill-founded error,
David Leipold <=