function [ddx,ddq] = autoGen_cartPoleDynamics(q,dq,u,m1,m2,g,l)
%AUTOGEN_CARTPOLEDYNAMICS
%    [DDX,DDQ] = AUTOGEN_CARTPOLEDYNAMICS(Q,DQ,U,M1,M2,G,L)

%    This function was generated by the Symbolic Math Toolbox version 6.2.
%    24-Nov-2015 15:13:31

t2 = cos(q);
t3 = sin(q);
t4 = t2.^2;
t5 = m1+m2-m2.*t4;
t6 = 1.0./t5;
t7 = dq.^2;
ddx = t6.*(u+g.*m2.*t2.*t3+l.*m2.*t3.*t7);
if nargout > 1
    ddq = -(t6.*(t2.*u+g.*m1.*t3+g.*m2.*t3+l.*m2.*t2.*t3.*t7))./l;
end
