MATLAB Answers

How to solve coupled (differential) equations of motion using matlab?

2 ビュー (過去 30 日間)
Noah Wilson
Noah Wilson 2019 年 12 月 8 日
編集済み: Stephan 2019 年 12 月 8 日
I am trying to solve three equations of motion and then plot the displacement in 3-D but am having trouble figuring out how to do this through Matlab. The equations of motion are the following:
(1) m*x''(t) = -b*x'(t)
(2) m*y''(t) = -w*z'(t) - b*y'(t)
(3) m*z''(t) = w*y'(t) - b*z'(t) - mg
Intial conditions:
x'(0) = v_xo
y'(0) = 0
z'(0) = v_zo
These equations describe the trajectory of a soccer ball under the influence of drag and the magnus force so I am hoping to also plot the resulting trajectory in a three dementional plot. Thank you for your help if you are able to help I greatly appreciate it as I have been stuck on this problem for months now.

  0 件のコメント

サインイン to comment.

採用された回答

Stephan
Stephan 2019 年 12 月 8 日
編集済み: Stephan 2019 年 12 月 8 日
Whta is the problem? There is an analytical solution (here assumed that vx0 and vz0 are equal to 1):
syms w b g m x(t) y(t) z(t)
assume([w, b, g, m],'real')
Dx = diff(x,t);
Dy = diff(y,t);
Dz = diff(z,t);
eq(1) = m*diff(x,t,2) == -b*Dx;
eq(2) = m*diff(y,t,2) == -w*Dz - b*Dy;
eq(3) = m*diff(z,t,2) == w*Dy - b*Dz - m*g;
conds = [Dx(0)==1, Dy(0)==0, Dz(0)==1, x(0)==0, y(0)==0, z(0)==0];
[solx, soly, solz] = (dsolve(eq,conds))

  0 件のコメント

サインイン to comment.

その他の回答 (0 件)

サインイン してこの質問に回答します。

製品


リリース

R2019a

Translated by