Use Euler\'s equations of motion for principal axes in state variable form. Writ
ID: 3816853 • Letter: U
Question
Use Euler's equations of motion for principal axes in state variable form. Write a MATLAB program to integrate Euler's equations of motion and solve for omega_x (t), omega_y (t), omega_z (t) and for H_x(t), H_y(t), and H_z(t) in body-fixed coordinates for an axisymmetric spacecraft with the following PMOIs: I_xx = 2887 kg-m^2 I_yy = 2887 kg-m^2 I_zz = 5106 kg-m^2 Assume there no moments (so M_x = M_y = M_z = 0) and that the ICs are omega_x (0) = 0.6 radians/second, omega_y (0) = 0, and omega_z (0) = 1.1 radians/second. a. Make plots of omega_x (t), omega_y (t), and omega_z (t) versus time. (You may show all three curves on one plot.) b. Make a plot of omega_y (t) on the vertical axis versus omega_x (t) on the horizontal axis. c. Make plots of H_x (t), H_y (t), and H_z (t) versus time. (You may show all three curves on one plot.) d. Make a plot of H_y (t) on the vertical axis and H_x (t) on the horizontal axis. e. Describe in words the dynamics of omega_x (t), omega_y (t), omega_z(t), H_x(t), H_y(t), and H_z(t) relative to the body axes. Explain why your results make (or don't make) sense.Explanation / Answer
Main Code:
%----------------BEGIN CODE-----------------------------
clear all
close all
clc
% PMOIs (units: kg*m2)
Ix = 2887;
Iy = 2887;
Iz = 5106;
% Initial Conditions
IC = [0.6 0 1.1];
t = [0 20];
%% Use ode 45 to numerically integrate
options = odeset ('RelTol', 2.22045E-14, 'AbsTol', 2.22045E-14);
[t, state] = ode45(@myfunc, t, IC, options, Ix, Iy, Iz);
% Angular velocities rad/s
omegax = state(:,1);
omegay= state(:,2);
omegaz = state(:,3);
% Angular momentum
Hx = Ix . *omegax;
Hy = Iy . *omegay;
Hz = Iz . *omegaz;
%% Figures
%a
figure(1)
subplot(211)
plot(t, omegax, 'r', t, omegay, '--b', t, omegaz, '-.m', 'LineWidth', 2);
axis( [ 0 20 -0.7 1.2 ] )
title( 'Question 1a')
legend( 'omegax', 'omegay', 'omegaz')
xlabel( 'Time (s)')
ylabel( 'omegai (rad/s)' )
grid on
%b
subplot(212)
plot( omegax, omegay, 'r', 'LineWidth', 2);
title(' Question 1b')
xlabel( 'omegax (rad/s)' )
ylabel(' omegay (rad/s)' )
grid on
axis equal
%c
figure(2)
subplot(211)
plot(t, Hx, 'r', t, Hy, '--b', t, Hz, '-.m', 'LineWidth', 2);
axis ( [ 0 20 -3000 6500 ] )
title(' Question 1c ')
legend( 'Hx', 'Hy', 'Hz')
xlabel(' Time (s) ')
ylabel( 'Hi (kg*m2/s)' )
grid on
%d
subplot(212)
plot( Hx, Hy, 'r', 'LineWidth', 2)
title( ' Question 1d ' )
xlabel( ' Hx (kg*m2/s) ' )
ylabel( ' Hy (kg*m2/2) ' )
grid on
axis equal
%-----------------------------END OF CODE-------------------------------------
omega_x = state(:,1);
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.