I need to express force exerted on a body due to aerodynamic drag mathematically as vector in matrix form. Let $F_f$ be the exerted force, $k_{lf}$ the aerodynamic constant and $\vec{V} = [u, v, w]^T$ the velocity vector. $[u, v, w]^T$ can either be positive or negative and $F_f$ is proportional to $\vec{V}^2$ but directed opposite. Writing:
$F_f = -k_{lf} \begin{bmatrix} u^2 \\ v^2 \\ w^2 \end{bmatrix}$
is wrong, as $u^2$ is always positive. What's the correct form of the above equation in matrix form, to preserve $u, v, w$ sign? Is using $sgn(x)$ the right choice?
PS. Does wrinting $\vec{V}^2$ preserve sign, i.e. is the below true?
$\vec{V}^2 = \begin{bmatrix} sgn(u) u^2 \\ sgn(v) v^2 \\ sgn(w) w^2\end{bmatrix}$
If I understand your question right, could you write: $$ F_f = \left| -k_{lf} \begin{bmatrix} u^2 \\ v^2 \\ w^2 \end{bmatrix}\right| \frac{-\vec{V}}{\lvert \vec{V}\lvert}\quad ? $$ So the $\lvert \cdot\lvert$ are the magnitude of the vectors. And $\frac{-\vec{V}}{\lvert \vec{V}\lvert}$ is a unit vector in the direction of $F_f$.
Now, of course you can rewrite this by actually writing what the magnitudes are: $$ F_f = \lvert k_{lf}\lvert \sqrt{u^4 + v^4 + w^4} \frac{1}{\sqrt{u^2 + v^2 + w^2}}\begin{bmatrix} -u \\ -v \\ -w \end{bmatrix} $$
The idea here is that any vector $\vec{v}$ can be written as the magnitude times a unit vector giving the direction: $$ \vec{v} = \lvert\vec{v}\lvert\frac{\vec{v}}{\lvert\vec{v}\lvert.} $$