フィルターのクリア

Graph differential equations of parabolic trajectory affected by drag force

2 ビュー (過去 30 日間)
Aleem Andrew
Aleem Andrew 2020 年 2 月 2 日
コメント済み: Star Strider 2020 年 2 月 2 日
I cannot graph the solution to the following system of differential equations.
mx¨ = −C*x*sqrt(x˙^2 + y˙^2)
my¨ = −C*y* sqrt(x˙^2 + y˙^2)− mg
Initial conditions: x(0) = 0; y(0) = 0; C: 4*10^-7 (constant)
x˙ : first derivative of x position
x¨: second derivative of x position
y˙^2: square of first derivative of y position
I have tried the following code.
syms x(t) y(t)
t0 = 0;
tf = 5400;
dx=diff(x,t);
dy=diff(y,t);
eq1 = diff(x,2) == 2* dy;
eq2 = diff(y,2) == -2* dx;
vars = [x(t); y(t)];
V = odeToVectorField([eq1,eq2])
M = matlabFunction(V,'vars', {'t','Y'});
interval = [t0 tf];
ySol = ode45(M,interval,y0);
tValues = linspace(interval(1),interval(2),1000);
yValues = deval(ySol,tValues,1);
plot(tValues,yValues)
  3 件のコメント
Aleem Andrew
Aleem Andrew 2020 年 2 月 2 日
Thank you for your response
Star Strider
Star Strider 2020 年 2 月 2 日
My pleasure.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeCalculus についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by