function dy = EA321diffEq(t, u, omega)
%differential equations giving EA 321 time derivatives

alpha1 = u(1);
alpha2 = u(2);
alpha3 = u(3);

output = ...
[ 1, (sin(alpha1)*sin(alpha2))/cos(alpha2), (cos(alpha1)*sin(alpha2))/cos(alpha2);
  0,                           cos(alpha1),                          -sin(alpha1);
  0,               sin(alpha1)/cos(alpha2),               cos(alpha1)/cos(alpha2)]*omega;

alpha1_dot = output(1);
alpha2_dot = output(2);
alpha3_dot = output(3);

dy = [alpha1_dot; alpha2_dot; alpha3_dot];

end

