Discussion:
ode23
mochzeen
2018-12-05 08:47:48 UTC
Permalink
Hi,

I have installed the latest Octave 4.4.1 which includes ode23. When I tried
my old ode example code which worked previously, it gave me an error of

error: structure has no member 'OutputSave'
error: called from
ode23 at line 166 column 3

My code is vdpol.m
trange=[0 0.5];
x0=[1;0];
ode23(@myproblemm,trange,x0)

with myproblemm.m
function dxdt=myproblemm(t,x)
dx1dt=x(2);
dx2dt=5-3*x(2)-x(1);
dxdt=[dx1dt; dx2dt];

I Googled the error message but no luck. Please help.



--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html
Carlo De Falco
2018-12-05 13:33:36 UTC
Permalink
Post by mochzeen
Hi,
I have installed the latest Octave 4.4.1 which includes ode23. When I tried
my old ode example code which worked previously, it gave me an error of
error: structure has no member 'OutputSave'
error: called from
ode23 at line 166 column 3
My code is vdpol.m
trange=[0 0.5];
x0=[1;0];
with myproblemm.m
function dxdt=myproblemm(t,x)
dx1dt=x(2);
dx2dt=5-3*x(2)-x(1);
dxdt=[dx1dt; dx2dt];
I Googled the error message but no luck. Please help.
Hi,

I cannot reproduce your issue, your example works for me with no error ...

Are you using ode23 form odepkg or the built-in implementation?
What do you see if you type "pkg list, which ode23"?

c.
Mohsin Mohd Sies
2018-12-06 03:54:43 UTC
Permalink
It's from the standard Octave package. I didn't install odepkg. Should I be
using it instead? That would be a little bit uncool in terms of the better,
upgraded standard Octave
Post by Carlo De Falco
Post by mochzeen
Hi,
I have installed the latest Octave 4.4.1 which includes ode23. When I
tried
Post by mochzeen
my old ode example code which worked previously, it gave me an error of
error: structure has no member 'OutputSave'
error: called from
ode23 at line 166 column 3
My code is vdpol.m
trange=[0 0.5];
x0=[1;0];
with myproblemm.m
function dxdt=myproblemm(t,x)
dx1dt=x(2);
dx2dt=5-3*x(2)-x(1);
dxdt=[dx1dt; dx2dt];
I Googled the error message but no luck. Please help.
Hi,
I cannot reproduce your issue, your example works for me with no error ...
Are you using ode23 form odepkg or the built-in implementation?
What do you see if you type "pkg list, which ode23"?
c.
Carlo De Falco
2018-12-06 06:04:12 UTC
Permalink
Hi,

Please don't use "top posting",
put your answers below the questions
so that the whole discussion becomes
more readable for someone else joinng
the discussion later or reading it in
the archives
Post by Carlo De Falco
Post by mochzeen
Hi,
I have installed the latest Octave 4.4.1 which includes ode23. When I tried
my old ode example code which worked previously, it gave me an error of
error: structure has no member 'OutputSave'
error: called from
ode23 at line 166 column 3
My code is vdpol.m
trange=[0 0.5];
x0=[1;0];
with myproblemm.m
function dxdt=myproblemm(t,x)
dx1dt=x(2);
dx2dt=5-3*x(2)-x(1);
dxdt=[dx1dt; dx2dt];
I Googled the error message but no luck. Please help.
Hi,
I cannot reproduce your issue, your example works for me with no error ...
Are you using ode23 form odepkg or the built-in implementation?
What do you see if you type "pkg list, which ode23"?
c.
It's from the standard Octave package. I didn't install odepkg. Should I be using it instead? That would be a little bit uncool in terms of the better, upgraded standard Octave
Hmmm, on second look, it seems that it is under odepkg which is now bundled with the standard Octave? Am I correct?
Instead of guessing, could you please just type the command suggested above :

pkg list, which ode23

then paste the results in this discussion?

The point here is that I don't see the same results as
you reported in your initial message, neither I nor anyone
else can help you with that error until we see the same error
occurring on our installation so that we can investigate
why it is happening.

c.
Mohsin Mohd Sies
2018-12-06 06:40:36 UTC
Permalink
This post might be inappropriate. Click to display it.
Mohsin Mohd Sies
2018-12-09 01:28:40 UTC
Permalink
A little update. My setup is Octave 4.4.1 on Windows 10. On curiosity, I
ran my code on Octave on Linux, and it ran! (Octave 4.2.2, Ubuntu 18.04).
I'm suspecting Octave on Windows still has some bugs.

Mohsin Mohd Sies
2018-12-06 03:58:01 UTC
Permalink
Hmmm, on second look, it seems that it is under odepkg which is now bundled
with the standard Octave? Am I correct?
Post by Carlo De Falco
Post by mochzeen
Hi,
I have installed the latest Octave 4.4.1 which includes ode23. When I
tried
Post by mochzeen
my old ode example code which worked previously, it gave me an error of
error: structure has no member 'OutputSave'
error: called from
ode23 at line 166 column 3
My code is vdpol.m
trange=[0 0.5];
x0=[1;0];
with myproblemm.m
function dxdt=myproblemm(t,x)
dx1dt=x(2);
dx2dt=5-3*x(2)-x(1);
dxdt=[dx1dt; dx2dt];
I Googled the error message but no luck. Please help.
Hi,
I cannot reproduce your issue, your example works for me with no error ...
Are you using ode23 form odepkg or the built-in implementation?
What do you see if you type "pkg list, which ode23"?
c.
Mohsin Mohd Sies
2018-12-06 04:54:34 UTC
Permalink
In addition, I just noticed another weird error of the ode23 function. I
followed the example given in
https://octave.org/doc/v4.4.1/Ordinary-Differential-Equations.html,
specifically

Here is an example of solving a set of three differential equations using
lsode. Given the function

## oregonator differential equation
function xdot = f (x, t)

xdot = zeros (3,1);

xdot(1) = 77.27 * (x(2) - x(1)*x(2) + x(1) ...
- 8.375e-06*x(1)^2);
xdot(2) = (x(3) - x(1)*x(2) - x(2)) / 77.27;
xdot(3) = 0.161*(x(1) - x(3));

endfunction

and the initial condition x0 = [ 4; 1.1; 4 ], the set of equations can be
integrated using the command

t = linspace (0, 500, 1000);

y = lsode ("f", x0, t);

lsode ran as expected as per below;

octave:7> function xdot = f (x, t)
xdot = zeros (3,1);
xdot(1) = 77.27 * (x(2) - x(1)*x(2) + x(1) ...
- 8.375e-06*x(1)^2);
xdot(2) = (x(3) - x(1)*x(2) - x(2)) / 77.27;
xdot(3) = 0.161*(x(1) - x(3));
endfunction
octave:8> x0 = [ 4; 1.1; 4 ];
octave:9> t = linspace (0, 500, 1000);
octave:10>
octave:10> y = lsode ("f", x0, t);
octave:11>
octave:11>

But when I tried it using ode23, it gave an error (I have exchanged the
position of trange and x0 as needed between lsode and ode23 as required)

octave:11> y = ode23 ("f", t, x0);
error: x(2): out of bound 1
error: called from
f at line 5 column 11
starting_stepsize at line 46 column 5
ode23 at line 192 column 25
octave:11>

Regards.
Hmmm, on second look, it seems that it is under odepkg which is now
bundled with the standard Octave? Am I correct?
Post by Carlo De Falco
Post by mochzeen
Hi,
I have installed the latest Octave 4.4.1 which includes ode23. When I
tried
Post by mochzeen
my old ode example code which worked previously, it gave me an error of
error: structure has no member 'OutputSave'
error: called from
ode23 at line 166 column 3
My code is vdpol.m
trange=[0 0.5];
x0=[1;0];
with myproblemm.m
function dxdt=myproblemm(t,x)
dx1dt=x(2);
dx2dt=5-3*x(2)-x(1);
dxdt=[dx1dt; dx2dt];
I Googled the error message but no luck. Please help.
Hi,
I cannot reproduce your issue, your example works for me with no error ...
Are you using ode23 form odepkg or the built-in implementation?
What do you see if you type "pkg list, which ode23"?
c.
Loading...