How do i transform this equation system in to three dimensions?

1 次查看(过去 30 天)

回答(1 个)

Bjorn Gustavsson
Bjorn Gustavsson 2021-12-9
Since this looks like the equations of motion for a solid body falling in a constant gravitational field with some velocity-dependent drag you only have to realize that the motion will be in a vertical plane, Therefore you can always select a coordinate-system such that one of the two horizontal components (both position and velocity) are identical to zero. Conversely, since the horizontal propagation-direction remains constant you can simply convert the x and vx into two components in an arbitrarily rotated coordinate system. Just integrate the 2-D equations of motion (I'd shift the initial x-coordinate to zero). Then it should be as simple as:
phi0 = pi/sqrt(3);
r0v0_original = [0,1,3,4*cos(phi0),4*sin(phi0),5];
r0v0_for2D = [0,r0v0_original(3),sqrt(r0v0_original(4)^2+r0v0_original(5)),r0v0_original(6)];
[t,rv] = ode45(... % etc
x1 = r0v0_original(1) + rv(:,1)*cos(phi0);
x2 = r0v0_original(2) + rv(:,2)*sin(phi0);
vx1 = rv(:,4)*cos(phi0);
vx2 = rv(:,5)*sin(phi0);
Here I've assumed that you have the position-components as the first 3 (2 in the eqs-of-motion function) and the velocity-components as the last 3 (last 2 in the equation-of-motion).
HTH

类别

Help CenterFile Exchange 中查找有关 Assembly 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by