<p>Start with the original equation. Let's first write the Hydrostatic equation: </p>

<p><span class="math-container">$$\frac{\partial p}{\partial z}=-\rho g$$</span></p>

<p>So let's prove that <span class="math-container">$$-g=c_p\theta\frac{\partial \pi}{\partial z}$$</span></p>

<p>If we use the product rule, we observe <span class="math-container">$$-g=c_p(\frac{\partial \theta \pi}{\partial z}-\pi\frac{\partial \theta}{\partial z})$$</span></p>

<p>Since <span class="math-container">$\pi=\frac{T}{\theta}$</span>, we can say that <span class="math-container">$T=\pi\theta$</span>, which makes the above equation</p>

<p><span class="math-container">$$-g=c_p(\frac{\partial T}{\partial z}-\pi\frac{\partial \theta}{\partial z})$$</span></p>

<p>It can be shown that
<span class="math-container">$$\frac{\partial \theta}{\partial z}=\frac{\theta}{T}(\frac{\partial T}{\partial z}+\frac{g}{c_p})$$</span></p>

<p>which can be rewritten as
<span class="math-container">$$\frac{\partial \theta}{\partial z}=\frac{1}{\pi}(\frac{\partial T}{\partial z}+\frac{g}{c_p})$$</span></p>

<p>Substituting this into my fourth equation
<span class="math-container">$$-g=c_p(\frac{\partial T}{\partial z}-\frac{\pi}{\pi}(\frac{\partial T}{\partial z}+\frac{g}{c_p}))$$</span></p>

<p>From here I think you can figure it out. </p>

<p>Derivation for <span class="math-container">$\frac{\partial \theta}{\partial z}$</span>
<span class="math-container">$$\theta=T(\frac{p_0}{p})^\frac{R_d}{c_p}$$</span>
<span class="math-container">$$log(\theta)=log(T)+\frac{R_d}{c_p}(log(p_0)-log(p))$$</span>
<span class="math-container">$$ \frac{1}{\theta}\frac{\partial \theta}{\partial z}=\frac{1}{T}\frac{\partial T}{\partial z}-\frac{R_d}{c_p P}\frac{\partial P}{\partial z}$$</span>
Utilizing hydrostatic equation
<span class="math-container">$$ \frac{1}{\theta}\frac{\partial \theta}{\partial z}=\frac{1}{T}\frac{\partial T}{\partial z}+\frac{R_d \rho g}{c_p P}$$</span>
<span class="math-container">$$ \frac{1}{\theta}\frac{\partial \theta}{\partial z}=\frac{1}{T}\frac{\partial T}{\partial z}+\frac{g}{c_p T}$$</span></p>

<p><span class="math-container">$$ \frac{\partial \theta}{\partial z}=\frac{\theta}{T}(\frac{\partial T}{\partial z}+\frac{g}{c_p })$$</span></p>

CC BY-SA 4.0
2020-03-26T14:24:28.597Z
Thanks already! I do not see the error. Perhaps your formula for $\dfrac{\partial \theta}{\partial z}$ has a wrong sign in the parentheses? Can you point me to a source for said formula?
chriss
CC BY-SA 4.0
2020-03-26T14:32:33.390Z
For the formula for $\frac{\partial \theta}{\partial z}$? I'll add it in.
BarocliniCplusplus
CC BY-SA 4.0
2020-03-26T14:37:09.400Z
I think the mistake in that argumentation is indeed that $\dfrac{\partial \theta}{\partial z} = \frac{1}{\pi}\left(\dfrac{\partial T}{\partial z} + \frac{g}{c_p}\right)$. This can be derived from $\theta = \frac{T}{\pi}$ by product rule. I will add the steps later. Thank you!
chriss
CC BY-SA 4.0
2020-03-26T14:42:11.800Z
I solved my negative sign and updated my answer. You're welcome!
BarocliniCplusplus
CC BY-SA 4.0
2020-03-26T13:55:31.540Z
2020-03-26T14:41:37.360Z
2020-03-26T14:41:37.360Z
BarocliniCplusplus
<p>After looking back into this I found my error to lie in the long equation </p>

<p><span class="math-container">$\dfrac{\partial \pi}{\partial z}=\left(\frac{1}{p_0}\right)^{\frac{R}{c_p}}\dfrac{\partial}{\partial z}\exp\left(\frac{R}{c_p}\log(p)\right)=\left(\frac{1}{p_0}\right)^{\frac{R}{c_p}}* \frac{T}{\theta}*{\frac{R}{c_p}}*\frac{1}{p}*\dfrac{\partial p}{\partial z}$</span>. </p>

<p>I was wrong, because <span class="math-container">$$\dfrac{\partial}{\partial z}\exp\left(\frac{R}{c_p}\log(p)\right)\neq \frac{T}{\theta}*{\frac{R}{c_p}}*\frac{1}{p}*\dfrac{\partial p}{\partial z},$$</span> but rather <span class="math-container">$$\dfrac{\partial}{\partial z}\exp\left(\frac{R}{c_p}\log(p)\right) =\left(p\right)^{\frac{R}{c_p}}*{\frac{R}{c_p}}*\frac{1}{p}*\dfrac{\partial p}{\partial z}.$$</span></p>

CC BY-SA 4.0
2020-03-30T06:50:42.503Z
2020-03-30T06:50:42.503Z
chriss
<p>The mistake is hidden in the identity <span class="math-container">${\partial \over \partial z} \log (p) = {1\over p} {\partial p \over \partial z}$</span>. </p>

<p>This formula looks harmless and would be correct if <span class="math-container">$p$</span> was a real valued function of <span class="math-container">$z$</span>, but <span class="math-container">$p$</span> is actually a pressure value and so <span class="math-container">$\log(p)$</span> is undefined. Instead, let <span class="math-container">$p^*=p/p_0$</span> be a non-dimensional pressure, and then:
<span class="math-container">$$
{\partial \over \partial z} \log(p^*) = {1\over p^*} {\partial p^*\over \partial z} = {1\over p} {\partial p\over \partial z}.
$$</span> </p>

<p>Put this in your derivation and the spurious <span class="math-container">$\left( 1 \over p_0 \right)^{R\over c_p}$</span> will disappear.</p>

CC BY-SA 4.0
2020-03-30T06:46:20.003Z
I do not think that $log(p)$ is undefined. After all, $p$ is a real value with physical dimension of pressure. See my answer, I pointed out my fault there.
chriss
CC BY-SA 4.0
2020-03-30T11:15:35.847Z
The log of the real value is defined, but the log of the dimension is not. For example, if $p = 1hPa = 100 Pa$, what do you think $log(p)$ is? But, yes,  your correction above is dealing with the critical error (which I had missed).
M Juckes
CC BY-SA 4.0
2020-04-01T08:24:03.523Z
Ah yes, I get your meaning now. But then $\left(\frac{p}{p_0}\right)^{\frac{R}{c_p}}\neq p^{\frac{R}{c_p}}\cdot\left(\frac{1}{p_0}\right)^{\frac{R}{c_p}}$, because the rhs is undefined?
chriss
CC BY-SA 4.0
2020-04-01T10:01:03.250Z
Raising units to a power is defined, so that is not the same problem. 

I suppose you could say that your approach works at a mechanistic level (with the correction you've posted in your answer), so it is OK. I'm coming from a maths background and have had it drummed into me that functions and operations which have been carefully defined to work on real values should not be applied to dimensional quantities.
M Juckes
CC BY-SA 4.0
2020-04-01T11:33:08.853Z
But the standard defintion for the expression $a^b$ for $a>0, b \in \mathbb{R}$ is that $a^b=\exp(b\log(a))$, is it not? Hence my question in the previous comment.
chriss
CC BY-SA 4.0
2020-04-01T15:56:17.077Z
Shouldn't that be: for $a, b \in \Re$?
M Juckes
CC BY-SA 4.0
2020-03-28T16:46:11.040Z
2020-03-28T16:46:11.040Z
M Juckes
<p>In chapter 13.1 in 'Mesoscale Meteorology in Midlatitudes' (Markowski and Richardson,2011) they use a Bernoulli equation and the hydrostatic equation and a lot of assumptions to derive an equation that predicts the height <span class="math-container">$z_{crit}$</span> at where an air parcel with an initial height of <span class="math-container">$z_0$</span> that is advected towards a barrier loses all horizontal velocity. In their argumentation they state the following identity
<span class="math-container">$$\dfrac{\partial p}{\partial z}(x,z) = \rho(x,z)c_p\theta(x,z)\dfrac{\partial \pi}{\partial z} (x,z)\tag{1}\label{wanted}$$</span>
where <span class="math-container">$\pi(x,z)=\left(\frac{p(x,z)}{p_0}\right)^{\frac{R}{c_p}}$</span> is the Exner function with reference pressure <span class="math-container">$p_0\in\mathbb{R}_+$</span> constant, <span class="math-container">$p$</span> is pressure, <span class="math-container">$\theta$</span> is potential temperature, <span class="math-container">$\rho$</span> is density, and <span class="math-container">$c_p$</span> and <span class="math-container">$R$</span> are constant <span class="math-container">$\in \mathbb{R}_+$</span>. </p>

<p>If I try to derive this equation by taking the partial derivative of <span class="math-container">$\pi$</span> with respect to height <span class="math-container">$z$</span> and use the identity <span class="math-container">$\pi(x,z)=\frac{T(x,z)}{\theta(x,z)}$</span> as can be found for example on wikipedia (<span class="math-container">$T$</span> is temperature), then I end up with (suppressing arguments <span class="math-container">$x$</span> and <span class="math-container">$z$</span> in favour of readability)
<span class="math-container">$$\dfrac{\partial \pi}{\partial z} =  \left(\frac{1}{p_0}\right)^{\frac{R}{c_p}}\dfrac{\partial}{\partial z}\exp\left(\frac{R}{c_p}\log(p)\right)=\left(\frac{1}{p_0}\right)^{\frac{R}{c_p}}* \frac{T}{\theta}*{\frac{R}{c_p}}*\frac{1}{p}*\dfrac{\partial p}{\partial z}.$$</span>
Multiplying this by <span class="math-container">$\rho c_p\theta$</span> we get 
<span class="math-container">$$\rho c_p \theta \dfrac{\partial \pi}{\partial z} = \left(\frac{1}{p_0}\right)^{\frac{R}{c_p}} \frac{T R \rho}{p}*\dfrac{\partial p}{\partial z}$$</span>
and because <span class="math-container">$\frac{T R \rho}{p}=1$</span> by the ideal gas law we end up with 
<span class="math-container">$$\rho c_p \theta \dfrac{\partial \pi}{\partial z} = \left(\frac{1}{p_0}\right)^{\frac{R}{c_p}}\dfrac{\partial p}{\partial z}.$$</span>
This is almost what is stated in <span class="math-container">$\eqref{wanted}$</span>, but not quite and I do not know how to get rid of the factor <span class="math-container">$\left(\frac{1}{p_0}\right)^{\frac{R}{c_p}}$</span> resp. do not see why it remains unmentioned in the textbook. Any help is appreciated.</p>

<wind><mesoscale-meteorology>
Derivative of Exner function
chriss
# Derivative of Exner function

(Asked by: username_0 on 2020-03-26)

In chapter 13.1 in 'Mesoscale Meteorology in Midlatitudes' (Markowski and Richardson,2011) they use a Bernoulli equation and the hydrostatic equation and a lot of assumptions to derive an equation that predicts the height $z\_{crit}$ at where an air parcel with an initial height of $z\_0$ that is advected towards a barrier loses all horizontal velocity. In their argumentation they state the following identity
$$\dfrac{\partial p}{\partial z}(x,z) = \rho(x,z)c\_p\theta(x,z)\dfrac{\partial \pi}{\partial z} (x,z)\tag{1}\label{wanted}$$
where $\pi(x,z)=\left(\frac{p(x,z)}{p\_0}\right)^{\frac{R}{c\_p}}$ is the Exner function with reference pressure $p\_0\in\mathbb{R}\_+$ constant, $p$ is pressure, $\theta$ is potential temperature, $\rho$ is density, and $c\_p$ and $R$ are constant $\in \mathbb{R}\_+$.

If I try to derive this equation by taking the partial derivative of $\pi$ with respect to height $z$ and use the identity $\pi(x,z)=\frac{T(x,z)}{\theta(x,z)}$ as can be found for example on wikipedia ($T$ is temperature), then I end up with (suppressing arguments $x$ and $z$ in favour of readability)
$$\dfrac{\partial \pi}{\partial z} = \left(\frac{1}{p\_0}\right)^{\frac{R}{c\_p}}\dfrac{\partial}{\partial z}\exp\left(\frac{R}{c\_p}\log(p)\right)=\left(\frac{1}{p\_0}\right)^{\frac{R}{c\_p}}\* \frac{T}{\theta}\*{\frac{R}{c\_p}}\*\frac{1}{p}\*\dfrac{\partial p}{\partial z}.$$
Multiplying this by $\rho c\_p\theta$ we get
$$\rho c\_p \theta \dfrac{\partial \pi}{\partial z} = \left(\frac{1}{p\_0}\right)^{\frac{R}{c\_p}} \frac{T R \rho}{p}\*\dfrac{\partial p}{\partial z}$$
and because $\frac{T R \rho}{p}=1$ by the ideal gas law we end up with
$$\rho c\_p \theta \dfrac{\partial \pi}{\partial z} = \left(\frac{1}{p\_0}\right)^{\frac{R}{c\_p}}\dfrac{\partial p}{\partial z}.$$
This is almost what is stated in $\eqref{wanted}$, but not quite and I do not know how to get rid of the factor $\left(\frac{1}{p\_0}\right)^{\frac{R}{c\_p}}$ resp. do not see why it remains unmentioned in the textbook. Any help is appreciated.

**Tags:** wind, mesoscale-meteorology


---

## 3 answers

### Answer by username_1 on 2020-03-26. Score: 2 | Accepted answer

Start with the original equation. Let's first write the Hydrostatic equation:

$$\frac{\partial p}{\partial z}=-\rho g$$

So let's prove that $$-g=c\_p\theta\frac{\partial \pi}{\partial z}$$

If we use the product rule, we observe $$-g=c\_p(\frac{\partial \theta \pi}{\partial z}-\pi\frac{\partial \theta}{\partial z})$$

Since $\pi=\frac{T}{\theta}$, we can say that $T=\pi\theta$, which makes the above equation

$$-g=c\_p(\frac{\partial T}{\partial z}-\pi\frac{\partial \theta}{\partial z})$$

It can be shown that
$$\frac{\partial \theta}{\partial z}=\frac{\theta}{T}(\frac{\partial T}{\partial z}+\frac{g}{c\_p})$$

which can be rewritten as
$$\frac{\partial \theta}{\partial z}=\frac{1}{\pi}(\frac{\partial T}{\partial z}+\frac{g}{c\_p})$$

Substituting this into my fourth equation
$$-g=c\_p(\frac{\partial T}{\partial z}-\frac{\pi}{\pi}(\frac{\partial T}{\partial z}+\frac{g}{c\_p}))$$

From here I think you can figure it out.

Derivation for $\frac{\partial \theta}{\partial z}$
$$\theta=T(\frac{p\_0}{p})^\frac{R\_d}{c\_p}$$
$$log(\theta)=log(T)+\frac{R\_d}{c\_p}(log(p\_0)-log(p))$$
$$ \frac{1}{\theta}\frac{\partial \theta}{\partial z}=\frac{1}{T}\frac{\partial T}{\partial z}-\frac{R\_d}{c\_p P}\frac{\partial P}{\partial z}$$
Utilizing hydrostatic equation
$$ \frac{1}{\theta}\frac{\partial \theta}{\partial z}=\frac{1}{T}\frac{\partial T}{\partial z}+\frac{R\_d \rho g}{c\_p P}$$
$$ \frac{1}{\theta}\frac{\partial \theta}{\partial z}=\frac{1}{T}\frac{\partial T}{\partial z}+\frac{g}{c\_p T}$$

$$ \frac{\partial \theta}{\partial z}=\frac{\theta}{T}(\frac{\partial T}{\partial z}+\frac{g}{c\_p })$$

> **Comments:**
> **username_0**: Thanks already! I do not see the error. Perhaps your formula for $\dfrac{\partial \theta}{\partial z}$ has a wrong sign in the parentheses? Can you point me to a source for said formula?  
> **username_1**: For the formula for $\frac{\partial \theta}{\partial z}$? I'll add it in.  
> **username_0**: I think the mistake in that argumentation is indeed that $\dfrac{\partial \theta}{\partial z} = \frac{1}{\pi}\left(\dfrac{\partial T}{\partial z} + \frac{g}{c_p}\right)$. This can be derived from $\theta = \frac{T}{\pi}$ by product rule. I will add the steps later. Thank you!  
> **username_1**: I solved my negative sign and updated my answer. You're welcome!  

---

### Answer by username_0 on 2020-03-30. Score: 1

After looking back into this I found my error to lie in the long equation

$\dfrac{\partial \pi}{\partial z}=\left(\frac{1}{p\_0}\right)^{\frac{R}{c\_p}}\dfrac{\partial}{\partial z}\exp\left(\frac{R}{c\_p}\log(p)\right)=\left(\frac{1}{p\_0}\right)^{\frac{R}{c\_p}}\* \frac{T}{\theta}\*{\frac{R}{c\_p}}\*\frac{1}{p}\*\dfrac{\partial p}{\partial z}$.

I was wrong, because $$\dfrac{\partial}{\partial z}\exp\left(\frac{R}{c\_p}\log(p)\right)\neq \frac{T}{\theta}\*{\frac{R}{c\_p}}\*\frac{1}{p}\*\dfrac{\partial p}{\partial z},$$ but rather $$\dfrac{\partial}{\partial z}\exp\left(\frac{R}{c\_p}\log(p)\right) =\left(p\right)^{\frac{R}{c\_p}}\*{\frac{R}{c\_p}}\*\frac{1}{p}\*\dfrac{\partial p}{\partial z}.$$


---

### Answer by username_2 on 2020-03-28. Score: 0

The mistake is hidden in the identity ${\partial \over \partial z} \log (p) = {1\over p} {\partial p \over \partial z}$.

This formula looks harmless and would be correct if $p$ was a real valued function of $z$, but $p$ is actually a pressure value and so $\log(p)$ is undefined. Instead, let $p^\*=p/p\_0$ be a non-dimensional pressure, and then:
$$
{\partial \over \partial z} \log(p^\*) = {1\over p^\*} {\partial p^\*\over \partial z} = {1\over p} {\partial p\over \partial z}.
$$

Put this in your derivation and the spurious $\left( 1 \over p\_0 \right)^{R\over c\_p}$ will disappear.

> **Comments:**
> **username_0**: I do not think that $log(p)$ is undefined. After all, $p$ is a real value with physical dimension of pressure. See my answer, I pointed out my fault there.  
> **username_2**: The log of the real value is defined, but the log of the dimension is not. For example, if $p = 1hPa = 100 Pa$, what do you think $log(p)$ is? But, yes,  your correction above is dealing with the critical error (which I had missed).  
> **username_0**: Ah yes, I get your meaning now. But then $\left(\frac{p}{p_0}\right)^{\frac{R}{c_p}}\neq p^{\frac{R}{c_p}}\cdot\left(\frac{1}{p_0}\right)^{\frac{R}{c_p}}$, because the rhs is undefined?  
> **username_2**: Raising units to a power is defined, so that is not the same problem.   I suppose you could say that your approach works at a mechanistic level (with the correction you've posted in your answer), so it is OK. I'm coming from a maths background and have had it drummed into me that functions and operations which have been carefully defined to work on real values should not be applied to dimensional quantities.  
> **username_0**: But the standard defintion for the expression $a^b$ for $a>0, b \in \mathbb{R}$ is that $a^b=\exp(b\log(a))$, is it not? Hence my question in the previous comment.  
> **username_2**: Shouldn't that be: for $a, b \in \Re$?  

---

