function dzdt=fp1eq(t,z,a,c,f,omega) %FP1EQ Forced pendulum equations (version 1). % DZDT=FP2EQ(T,Z,A,C,F,OMEGA) evaluates % % dx/dt = y % dy/dt = -A^2*sin(x) - C*y + F*sin(OMEGA*t) % % at (x,y)=Z and t=T. % Francisco J. Beron-Vera, 2006/10/09 n=length(z); dzdt=zeros(n,1); x=z(1:2:end-1); y=z(2:2:end); dzdt=[y;-a^2*sin(x)-c*y+f*sin(omega*t)]; dzdt=reshape(dzdt,[n/2 2])'; dzdt=dzdt(:);