How can i get analytical solution
Afficher commentaires plus anciens
I can't use ode45 or dsolve
this is the Question we are given my code (sorry for not adding any comments)
clear
%PARAMETERS
m = 8000; %kg
v = 80; %m/s
r = 250; %m
gravity = 9.81; % m/s^2
%rate_of_turn = ((2*pi)/time);
%t_360 = 2*(((pi)*turn_radius)/speed);
t_180=(pi*r)/v;
dt=0.001;
t=0:dt:t_180;
x=zeros(1,length(t));
y=zeros(1,length(t));
dVx = zeros(1,length(t));
dVy= zeros(1,length(t));
x(1) = 0;
y(1)=0;
Velcoity_x(1) =0;
Velocit_y(1)=0;
F= (m*(v^2))/r;
for i=2:length(t)
angle(i)=angle(i-1) +t_180*dt;
Velcoity_x(i)=v*cos(angle(i));
Velocit_y(i)=v*sin(angle(i));
dx(i)=Velcoity_x(i)*dt;
dy(i)=Velocit_y(i)*dt;
x(i)=x(i-1)+dx(i);
y(i)=y(i-1)+dy(i);
dVx(i)=(Velcoity_x(i)-Velcoity_x(i-1))/dt;
dVy(i)=(Velocit_y(i)-Velocit_y(i-1))/dt;
Force_x=dVx(i)*m;
Force_y=dVy(i)*m;
F(i)=((Force_x^2)+(Force_y^2))^0.5;
end
plot(x,y)
grid on
please help
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Programming dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!