function dx = pend_ode(x, u, a1, a2, a3) % x(1) - theta % x(2) - Dtheta dx = [x(2); -a2*x(2) - a1*sin(x(1)) + a3*u]; end