%  This is the DAS 1 test problem of I. Cameron, Solution of differential-
%  algebraic systems using diagonally implicit Runge-Kutta methods, IMA
%  J. Num. Anal., 3 (1983) 273-289.  He attributes it to C.W. Gear, 
%  Simultaneous numerical solution of differential-algebraic equations, 
%  IEEE Trans. Circuit Theory CT-18 (1971) 89-95.  The problem is to be 
%  solved on [0 1000].  Because the solution components tend quickly to 
%  limit values, they are plotted on a much shorter interval.

% Copyright 1999, The MathWorks, Inc.

%  Consistent initial conditions.
y0 = - ones(8,1);
y0(6) =  1;
y0(7) = -2;
y0(8) = -3;

options = odeset('Mass','M');

[t,y] = ode15s('ex9ode',[0 1000],y0,options);

i = find(t <= 6);
tlast = t(max(i));
plot(t(i),y(i,:))
axis([0 tlast -80 10])
title('Gear''s Stiff Test Problem')



