function ode05_demo
%
% x(1) is the hare population and x(2) the lynx population

  simtime = input('enter runtime: \n');
  %acc = input('enter accuracy value');

  %initialise values of populations
  initx = [5000 100]';
  [t, x] = ode45(@fcn, [0 simtime], initx);
  plot(t,x, 'LineWidth', 2); grid
  xlabel('time'); ylabel('population');
end


function fv = fcn(~,x)
%
% fv = zeros(2,1);
% fv(1) = 2*x(1) - 0.0001*x(1)*x(2);
% fv(2) = -10*x(2)+0.002*x(1)*x(2);

  K1 = 2;
  K2 = 10;
  C  = 0.001;
  D  = 0.002;

  fv = zeros(2,1);
  fv(1) =  K1*x(1) - C*x(1)*x(2);
  fv(2) = -K2*x(2) + D*x(1)*x(2);
end
