(* Automatic verification of Problem 9.1.3 in Strogatz    *)
(* Simply run these lines and convince yourself that      *)
(* the output {0,0,0} is verifying the change of variable *)
 
alpha = K nu/(pi g r);
beta = -K nu/(pi g r);
sigma = nu/(K I);
nu = (pi g q1)/(K^2);  
b = 1; 
 
a1 = alpha y;
b1 = beta z + q1/K;
omega= K x;
 
xdot = sigma (y-x);
ydot = r x - x z - y;
zdot = x y - b z;
 
a1dot= alpha ydot;
b1dot= beta zdot;
omegadot = K xdot;
 
E1=K a1dot-(omega b1 - K a1); 
E2=K b1dot-(-omega a1 + q1 - K b1); 
E3=K omegadot -(-nu omega/I + pi g r a1/I); 
 
{Simplify[E1], Simplify[E2], Simplify[E3]}

