function dY=Pend1(t,Y,const) % function dY=Pend1(t,Y) is the ODE describing the nonlinear pendulum. % const(1)=g (gravity), const(2)=l, length of pendulum. dY=zeros(size(Y)); dY(1)=Y(2); dY(2)=-(const(1)/const(2))*sin(Y(1));