%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Simple ODE system for damped pendulum, with sinusoidal forcing %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function dx_dt = f3(t,x) x1 = x(1); %theta x2 = x(2); %theta_dot global alpha w02 input = 5*sin(10*t); dx_dt = [x2; -alpha*x2-w02*sin(x1)+input];