function d=pendulum(t,y)
% pendulum(t,Y) provides the right side for the pendulum equation 
%                  y''+a*y'+b*sin(y)=0, 
% converted to a system in the standard way: Y=[y,y'].  
% parameter=[a,b] (global).

global parameter                                   
d=[y(2);-(parameter(1)*y(2) + parameter(2)*sin(y(1)))];
% M. Day, June 4, 2005
