function xdot=Inverted_pendulum_eq(t,x) global g A omega R; %x(1)=angle %x(2)=angle time derivative xdot(1)=x(2); xdot(2)=1/R*(g-A*omega^2*sin(omega*t))*sin(x(1)); xdot=xdot';