Sign up ×
Physics Stack Exchange is a question and answer site for active researchers, academics and students of physics. It's 100% free.

I just saw the continuity equation, in a manuscript, written as $$\frac{\partial \log \rho }{\partial t} + \vec v \cdot \nabla \log \rho= - \nabla \cdot \vec v.$$ Now, just calculating the derivatives of $\log$, and multiplying by $\rho$, this comes back to the familiar $$\frac{\partial \rho }{\partial t} + \nabla \cdot (\rho \vec v)= 0.$$ But I am curious: what would be the reason to write it in that log-form?

The log-form also appears on page 53 (pdf page 69) in this manual. And page 2 here explains about the same as tpg2114's answer.

share|cite|improve this question
It would probably be easier to determine if we saw the context in which this was written. –  kleingordon Oct 5 '12 at 6:23

3 Answers 3

up vote 11 down vote accepted

Without seeing the manuscript in question, the most obvious reason why is when extremely large ranges of density are expected. If the density varies by orders of magnitude, say in an astrophysics setting, then the log form would keep the numbers in similar scale making it more numerically tractable.

Similar treatment is done for the partial density equations in chemically reacting flows.

share|cite|improve this answer

I) The first equation in the question(v1) shows that the material derivative of $\ln\rho $ satisfies

$$ \frac{D \ln\rho }{D t} ~=~ - \nabla \cdot \vec v. $$

In particular, in an incompressible fluid, the velocity field is divergence-free $$\nabla \cdot \vec v~=~0.$$

Why the variable $\ln\rho$ as opposed to $\rho$?

II) In addition to tpg2114's correct argument that the density may vary over several decades, there is also the argument that in numerical calculations, it is preferred to work with a real variable $\ln\rho\in \mathbb{R}$ (as opposed to a positive variable $\rho>0$), because if one uses $\rho$ as a variable in a computer code, then small numerical errors may accidentally conspires to yield a faulty negative density $\rho<0$, while working with the variable $\ln\rho$ in a computer code would automatically guarantee a manifestly positive density.

share|cite|improve this answer
I updated the answer. –  Qmechanic Oct 5 '12 at 16:52

In addition to the two great answers above, there's one more context I've encountered in which the log representation is useful.

Often in self-similar problems, some analytical solutions may be obtained by guessing a solution that has the form of a power law in some self-similar variable. The log representation makes it possible to manipulate the equations with ease, allowing one to find the exponents and thus the solution.

If you're interested, have a look at the following, There are several analytic solutions for the case of the point explosion with density profile $\rho=\kappa r^{-\omega}$ for specific values of $\omega$ (Can't find the reference to the textbooks it shows up in, sorry)

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.