ode23

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

ode23

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];
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


Reply | Threaded
Open this post in threaded view
|

Re: ode23

Carlo de Falco-2


> On 5 Dec 2018, at 09:47, mochzeen <[hidden email]> wrote:
>
> 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.



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.





Reply | Threaded
Open this post in threaded view
|

Re: ode23

mochzeen

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 

On Wed, 5 Dec 2018, 21:33 Carlo De Falco <[hidden email] wrote:


> On 5 Dec 2018, at 09:47, mochzeen <[hidden email]> wrote:
>
> 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.



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.





Reply | Threaded
Open this post in threaded view
|

Re: ode23

mochzeen
In reply to this post by Carlo de Falco-2
Hmmm, on second look, it seems that it is under odepkg which is now bundled with the standard Octave? Am I correct? 

On Wed, 5 Dec 2018, 21:33 Carlo De Falco <[hidden email] wrote:


> On 5 Dec 2018, at 09:47, mochzeen <[hidden email]> wrote:
>
> 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.



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.





Reply | Threaded
Open this post in threaded view
|

Re: ode23

mochzeen
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.

On Thu, Dec 6, 2018 at 11:58 AM Mohsin Mohd Sies <[hidden email]> wrote:
Hmmm, on second look, it seems that it is under odepkg which is now bundled with the standard Octave? Am I correct? 

On Wed, 5 Dec 2018, 21:33 Carlo De Falco <[hidden email] wrote:


> On 5 Dec 2018, at 09:47, mochzeen <[hidden email]> wrote:
>
> 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.



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.





Reply | Threaded
Open this post in threaded view
|

Re: ode23

Carlo de Falco-2
In reply to this post by mochzeen
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

>> > On 5 Dec 2018, at 09:47, mochzeen <[hidden email]> wrote:
>> >
>> > 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.
>>
>>

>> On Wed, 5 Dec 2018, 21:33 Carlo De Falco <[hidden email] wrote:
>> 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.

> On 6 Dec 2018, at 04:54, Mohsin Mohd Sies <[hidden email]> wrote:
>
> 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

> On 6 Dec 2018, at 04:58, Mohsin Mohd Sies <[hidden email]> wrote:
>
> 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.



Reply | Threaded
Open this post in threaded view
|

Re: ode23

mochzeen


On Thu, Dec 6, 2018 at 2:04 PM Carlo De Falco <[hidden email]> wrote:
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

>> > On 5 Dec 2018, at 09:47, mochzeen <[hidden email]> wrote:
>> >
>> > 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.
>>
>>

>> On Wed, 5 Dec 2018, 21:33 Carlo De Falco <[hidden email] wrote:
>> 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.

> On 6 Dec 2018, at 04:54, Mohsin Mohd Sies <[hidden email]> wrote:
>
> 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

> On 6 Dec 2018, at 04:58, Mohsin Mohd Sies <[hidden email]> wrote:
>
> 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.

Here it is

octave:1> pkg list, which ode23
Package Name         | Version | Installation directory
---------------------+---------+-----------------------
     communications  |   1.2.1 | C:\Octave\OCTAVE~1.1\share\octave\packages\communications-1.2.1
            control  |   3.1.0 | C:\Octave\OCTAVE~1.1\share\octave\packages\control-3.1.0
     data-smoothing  |   1.3.0 | C:\Octave\OCTAVE~1.1\share\octave\packages\data-smoothing-1.3.0
           database  |   2.4.3 | C:\Octave\OCTAVE~1.1\share\octave\packages\database-2.4.3
          dataframe  |   1.2.0 | C:\Octave\OCTAVE~1.1\share\octave\packages\dataframe-1.2.0
              dicom  |   0.2.1 | C:\Octave\OCTAVE~1.1\share\octave\packages\dicom-0.2.1
          financial  |   0.5.1 | C:\Octave\OCTAVE~1.1\share\octave\packages\financial-0.5.1
               fits  |   1.0.7 | C:\Octave\OCTAVE~1.1\share\octave\packages\fits-1.0.7
fuzzy-logic-toolkit  |   0.4.5 | C:\Octave\OCTAVE~1.1\share\octave\packages\fuzzy-logic-toolkit-0.4.5
                 ga  |  0.10.0 | C:\Octave\OCTAVE~1.1\share\octave\packages\ga-0.10.0
            general  |   2.1.0 | C:\Octave\OCTAVE~1.1\share\octave\packages\general-2.1.0
      generate_html  |   0.3.1 | C:\Octave\OCTAVE~1.1\share\octave\packages\generate_html-0.3.1
           geometry  |   3.0.0 | C:\Octave\OCTAVE~1.1\share\octave\packages\geometry-3.0.0
                gsl  |   2.1.1 | C:\Octave\OCTAVE~1.1\share\octave\packages\gsl-2.1.1
              image  |   2.8.0 | C:\Octave\OCTAVE~1.1\share\octave\packages\image-2.8.0
 instrument-control  |   0.3.1 | C:\Octave\OCTAVE~1.1\share\octave\packages\instrument-control-0.3.1
           interval  |   3.2.0 | C:\Octave\OCTAVE~1.1\share\octave\packages\interval-3.2.0
                 io  |  2.4.11 | C:\Octave\OCTAVE~1.1\share\octave\packages\io-2.4.11
     linear-algebra  |   2.2.2 | C:\Octave\OCTAVE~1.1\share\octave\packages\linear-algebra-2.2.2
               lssa  |   0.1.3 | C:\Octave\OCTAVE~1.1\share\octave\packages\lssa-0.1.3
              ltfat  |   2.3.1 | C:\Octave\OCTAVE~1.1\share\octave\packages\ltfat-2.3.1
            mapping  |   1.2.1 | C:\Octave\OCTAVE~1.1\share\octave\packages\mapping-1.2.1
      miscellaneous  |   1.2.1 | C:\Octave\OCTAVE~1.1\share\octave\packages\miscellaneous-1.2.1
                nan  |   3.1.4 | C:\Octave\OCTAVE~1.1\share\octave\packages\nan-3.1.4
             netcdf  |  1.0.12 | C:\Octave\OCTAVE~1.1\share\octave\packages\netcdf-1.0.12
              nurbs  |  1.3.13 | C:\Octave\OCTAVE~1.1\share\octave\packages\nurbs-1.3.13
                ocs  |   0.1.5 | C:\Octave\OCTAVE~1.1\share\octave\packages\ocs-0.1.5
             odepkg  |   0.8.5 | C:\Octave\OCTAVE~1.1\share\octave\packages\odepkg-0.8.5
              optim  |   1.5.3 | C:\Octave\OCTAVE~1.1\share\octave\packages\optim-1.5.3
        optiminterp  |   0.3.5 | C:\Octave\OCTAVE~1.1\share\octave\packages\optiminterp-0.3.5
         quaternion  |   2.4.0 | C:\Octave\OCTAVE~1.1\share\octave\packages\quaternion-2.4.0
           queueing  |   1.2.5 | C:\Octave\OCTAVE~1.1\share\octave\packages\queueing-1.2.5
             signal  |   1.4.0 | C:\Octave\OCTAVE~1.1\share\octave\packages\signal-1.4.0
            sockets  |   1.2.0 | C:\Octave\OCTAVE~1.1\share\octave\packages\sockets-1.2.0
          sparsersb  |   1.0.6 | C:\Octave\OCTAVE~1.1\share\octave\packages\sparsersb-1.0.6
            specfun  |   1.1.0 | C:\Octave\OCTAVE~1.1\share\octave\packages\specfun-1.1.0
            splines  |   1.3.2 | C:\Octave\OCTAVE~1.1\share\octave\packages\splines-1.3.2
         statistics  |   1.4.0 | C:\Octave\OCTAVE~1.1\share\octave\packages\statistics-1.4.0
                stk  |   2.5.1 | C:\Octave\OCTAVE~1.1\share\octave\packages\stk-2.5.1
            strings  |   1.2.0 | C:\Octave\OCTAVE~1.1\share\octave\packages\strings-1.2.0
             struct  |  1.0.15 | C:\Octave\OCTAVE~1.1\share\octave\packages\struct-1.0.15
             tisean  |   0.2.3 | C:\Octave\OCTAVE~1.1\share\octave\packages\tisean-0.2.3
                tsa  |   4.4.5 | C:\Octave\OCTAVE~1.1\share\octave\packages\tsa-4.4.5
              video  |   1.2.4 | C:\Octave\OCTAVE~1.1\share\octave\packages\video-1.2.4
            windows  |   1.3.0 | C:\Octave\OCTAVE~1.1\share\octave\packages\windows-1.3.0
             zeromq  |   1.3.0 | C:\Octave\OCTAVE~1.1\share\octave\packages\zeromq-1.3.0
'ode23' is a function from the file C:\Octave\OCTAVE~1.1\share\octave\4.4.1\m\ode\ode23.m