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