How to solve coupled (differential) equations of motion using matlab?
11 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
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 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!