1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
| clear
close all
% Methode ODE45
t0=0;
tf=10.5;
samp=200;
t=linspace(t0,tf,samp);
v0 = input(' Quelle est la Vitesse initiale V0 ? ')
y0=[0,v0*cos(pi/6),0,v0*sin(pi/6)]; % Conditions initiales sur y'
[t,y]=ode45('f5test',t,y0);
subplot(2,1,1)
plot(y(:,1),y(:,3));
grid
title('Trajectoire de la balle');
xlabel('Y1');
ylabel('Y3');
% Methode théorique
g=9.81; % gravité
V0=100; % Vitesse initiale en m/s
x=0:1000;
y=-(g)*x.^2/(2*(V0^2)*cos(pi/6)^2)+ tan(pi/6).*x; % Trajectoire
subplot(2,1,2)
plot(x,y,'r') % représentation graphique
grid
title('Trajectoire de la balle Théorique');
xlabel('Y1');
ylabel('Y3'); |
Partager