function yprime = InvPend(t,y) % Usage: yprime = InvPend(t,y) % % This function defines the inverted pendulum differential equation % transformed from the second order ode. % % Variables; % t time, scalar % y a 2-vector, where % % y(1) = theta(t) and y(2) = (d/dt)theta(t) % % where theta(t) is the angle in the inverted pendulum problem.l % parameters global L; global A; global w; % constant, gravitation global g; yprime(1,1) = y(2); yprime(2,1) = 3*(g - A*w*w*sin(w*t))*sin(y(1))/(2*L);