0
votes

I want to use "PDToolbox" from Matlab under octave. I'm using the version from https://github.com/carlobar/PDToolbox_matlab, but I have tried the release v1 too. I'm using octave 4.2.2 under ubuntu 18.04.

After installation of the toolbox I first tried to run the tests in the test directory. Some of them work well (sometimes after replacing ole113 by ole23), but all the tests with more than one population give essentially the same error message. For test2.m for instance:

>> test2
Running rd dynamics
error: ode45: INIT must be a numeric vector

I tried to load the package octave-odepkg (0.8.5). (Which gives warnings about shadowing of core libery functions.) After that I get a slightly different error message:

>> test2
Running rd dynamics
error: Third input argument must be a valid numerical value

I don't have access to matlab, so my first question would be whether the same kind of errors appear with matlab. But my main question is of course, how to get past those errors.

1

1 Answers

1
votes

Use debug_on_error(1) to force octave to drop into debugging mode on error.

From that you will see that in line 47 of run_game, it's trying to pass the initial state G.x0 to ode45, but this is a 2x2 matrix.

Ode45 line 133 tries to ensure that the initial state is in the form of a vector, hence the error.

I tried converting this initial state to a vector in the test2.m file itself (e.g. I did x0 = x0(:)) to see if that fixes the problem, but then the package complains that other things don't have the same shape, which means you'd have to hunt for all the places where this matters.

In any case, it doesn't sound like this toolbox will necessarily be incompatible with octave, as long as you use vectors rather than matrices as inputs. But given the tests use matrices, you may have to tweak them a bit first in order to find out for sure.