function ode03_demo(t_end)
%
  if nargin==0, t_end = 10; end
    
  [t, x] = ode45(@test2, [0 t_end], [0 1]);
  plot(t, x, '+-', 'linewidth', 2)
  title('The solution to x1'' = x2 - x1^2 and x2'' = -x1 -2*x1*x2')
  xlabel('t')
  ylabel('x')
  grid
  fprintf('Press <Enter> to continue\n')
  pause
  plot(x(:,1), x(:,2), '+-', 'linewidth', 2)
  grid
  pause
  plot3(x(:,1), x(:,2), t, '+-', 'linewidth', 2)
  grid
end

function xpr = test2(t, x)
%
  xpr(1) =  x(2) - x(1)^2;
  xpr(2) = -x(1) - 2*x(1)*x(2);
  xpr = xpr';
end
