Solving system of ODEs using Octave
<p>I am trying to solve a system of two ODEs using Octave, and in particular the function lsode.</p>

<p>The code is the following:</p>

<pre><code>function xdot = f (x,t)

a1=0.00875;
a2=0.075;
b1=7.5;
b2=2.5;
d1=0.0001;
d2=0.0001;
g=4*10^(-8);
K1=5000;
K2=2500;
n=2;
m=2;

xdot = zeros(2,1);

xdot(1) = a1+b1*x(1)^n/(K1^n+x(1)^n)-g*x(1)*x(2)-d1*x(1);
xdot(2) = a2+b2*x(1)^m/(K2^m+x(1)^m)-d2*x(2);

endfunction

t = linspace(0, 5000, 200)';
x0 = [1000; 1000];
x = lsode ("f", x0, t);

set term dumb;
plot(t,x); 
</code></pre>

<p>I am getting continuously the same error, that "x" is not defined, and I do not know why. The error is the following:</p>

<pre><code>warning: function name 'f' does not agree with function file name '/home /Simulation 1/sim.m'
error: 'x' undefined near line 17 column 17
error: called from
    sim at line 17 column 9
</code></pre>

<p>It would we great that any of you could help me with this code. </p>