function  [sys, x0]  = vdpm(t,x,u,flag)
% VDPM Vanderpol equation as an M-file.
%	Copyright (c) 1990-94 by The MathWorks, Inc.
if nargin~=4
    if nargin==0
        flag = 0;
    else
        error('??? Wrong number of input arguments.');
    end
end
if abs(flag) == 1,
    % Return rates
    sys(1) = x(1) .* (1 - x(2).^2) - x(2);
    sys(2) = x(1);
elseif flag  == 0, 
    % Return initial conditions 
    sys = [2;0;0;0;0;0]; 
    x0 =  [0.25; 0.25];
else 
    sys = [];
end
