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

 採用された回答

Walter Roberson
Walter Roberson 2020 年 4 月 29 日

0 投票

You get an analytic solution by working through the calculas on paper.
By definition a numeric solution is never an analytic solution, so no numeric approach can ever find the analytic answer.
That leaves you with the choice of working it out by hand on paper (or equivalent), or else of using symbolic software such as dsolve(). But your other question says you are not permitted to use dsolve(), so that leaves you using paper (or equivalent)

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeProgramming についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by