calculate drag in 3D

873 Views Asked by At

I'm trying to make a simple explicit dynamic solver for projectile motion in 3D, including drag and gravity, and suspect I'm doing something basically wrong.

Drag force is given by $D = 0.5 \rho V^2 C_d A$

I thought about it, and decided that I could just calculate the components of the drag in ny global axes, i.e. $D_x, D_y, D_z$ by using the components velocity components i.e. $V_x, V_y, V_z$.

However when I try this with an initial velocity of say $(5, 1, 5)$, I can see that in the $x$-$y$ plane I have a curve, not a straight line. That's clearly wrong, cause without a "side wind" I wouldn't expect the projectile to move away from it's initial path in that plane. Yet I guess it is the correct result of taking components! So I think I have to calculate the length of the vector $(V_x, V_y, V_z)$, calculate $D$ as a scalar, then generate a vector of length $D$ in the same direction as $(V_x, V_y, V_z)$ etc, which will be much slower.

Where am I going wrong in thinking I can just calculate $D_x, D_y, D_z$ using $V_x, V_y, V_z$?

1

There are 1 best solutions below

1
On BEST ANSWER

You don't say how you calculate $D_x$ from the velocity components, but I would guess you are putting $V_x$ into the drag equation. That means that the components of $D$ are proportional to the squares of the components of $V$. In your example, with $V_x=5,V_y=1$, that gives $D_x=25, D_y=1$, which is not the $5$ to $1$ ratio you want. You are correct with the process you want.