Professional Documents
Culture Documents
%football
clear all
m=0.411; Ia=0.0019; It=0.0032; g=9.8;
I=[Ia;It;It];
%a x=[p;q;r;the;psi]
Omega=63;
A=[0 0 0 0 0;
0 0 -Ia*Omega/It 0.325 0;
0 Ia*Omega/It 0 0 0.325;
0 1 0 0 0;
0 0 1 0 0];
eig(A);
%b
J = @(phi,the,psi) [1 tan(the)*sin(phi) tan(the)*cos(phi);
0 cos(phi) -sin(phi);
0 cos(phi)/cos(the) sin(phi)/cos(the)];
V = @(x) R(x(4),x(5),x(6))*[x(7);x(8);x(9)];
theV = @(x) atan2(norm(cross(V(x),[1;0;0])),dot(V(x),[1;0;0]));
M = @(x) cross(V(x),[1;0;0])/norm(cross(V(x),[1;0;0]))*theV(x)*3;
F = @(x)
cross([1;0;0],cross(V(x),[1;0;0]))/norm(cross([1;0;0],cross(V(x),[1;0;0
])))*theV(x)*0.325;
[T,X]=ode45(sim,[0 2.5],x);
figure
plot(atan2(X(:,9),X(:,7)),atan2(X(:,8),X(:,7)));
xlabel('\alpha')
ylabel('\beta')
figure
plot3(X(:,10),X(:,11),-X(:,12));
title('trajectory')
figure
plot(T,X(:,5))
title('\theta(t)')
ylabel('\beta')
1.4
1.2
0.8
-
0.6
0.4
0.2
0
-0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
,
trajectory
2
z
0 30
-1 25
20
-2
15
30
25 10
20
15 5
10 x
5 0
y 0
3(t)
1
0.5
-0.5
-1
-1.5
0 0.5 1 1.5 2 2.5