Is there a "chain rule" for error propagation?

153 Views Asked by At

I am investigating certain functions $\mu_1$ and $\mu_2$ which represent a physical quantity $\mu$ where $\mu_i(T,\rho)$; but also $\rho = \rho(T,P)$ so that also $\mu_i = \mu_i(T,P)$. Maybe another way of saying that is that each $\mu_i$ is defined in $(T,\rho)$ coordinates but can be redefined in $(T,P)$ coordinates. The function $\mu_1$ is considered the "standard" for computing quantity $\mu$, but $\mu_2$ is computationally cheaper. So I am investigating the error between $\mu_1$ and $\mu_2$.

My advisor has told me that $$|\varepsilon(\mu)| \approx \sqrt{\left( \frac{\partial \mu}{\partial \rho} \varepsilon(\rho) \right)^2 + \left( \frac{\partial \mu}{\partial T} \varepsilon(T) \right)^2 }$$ where $\varepsilon(\cdot)$ is the error in a given variable. Here is my issue: all of the data I have generated is in $(T,P)$ coordinates. So, for example, I can numerically approximate derivatives like $\partial \mu / \partial T$ and $\partial \mu / \partial P$. But I do not have data from which I could approximate $\partial \mu / \partial \rho$. However, as $\rho = \rho(T,P)$, I have data to approximate $\partial \rho/\partial T$ and $\partial \rho/\partial P$. So is there some way to rewrite the above error formula so that it avoids the use of $\partial \mu / \partial \rho$ using something like a chain rule for error propagation? Also, I am not sure where the above formula comes from, or why it is justified?

Any help you can provide will be appreciated!

(NOTE: If it helps, $T, P, \rho, \mu$ are temperature, pressure, density, viscosity respectively.)

1

There are 1 best solutions below

0
On

Given that this seems to be thermodynamic-related, you are probably used to the subscript notation for partial derivatives. Rephrased, what you want are

$$\left(\frac{\partial \mu}{\partial \rho}\right)_T, \left(\frac{\partial \mu}{\partial T}\right)_\rho$$

given

$$\left(\frac{\partial \mu}{\partial P}\right)_T, \left(\frac{\partial \mu}{\partial T}\right)_P$$

Keep in mind that since you are working numerically, the actual functional forms $\mu$ would be different in both coordinates (e.g. $\mu(T,\rho) = T + \rho$ and $\rho = T + P$ would imply $\mu(T,P) = 2T + P$). In other words you have to find a formula for $\frac{\partial \mu}{\partial T}$ as well because the version that appears in the error formula is most likely not what you are numerically computing with data (if this assumption is incorrect please say so).

To keep the notation clear, let's denote $\mu(T,\rho) \equiv f(T,\rho)$ and $\mu(T,P) \equiv g(T,P)$ with the relation

$$g(T,P) = f(T,\rho(T,P))$$

Then by the chain rule we have the system of equations

$$\begin{pmatrix}\frac{\partial g}{\partial T} \\ \frac{\partial g}{\partial P}\end{pmatrix} = \begin{pmatrix}1 & \frac{\partial \rho}{\partial T} \\ 0 & \frac{\partial \rho}{\partial P} \end{pmatrix}\begin{pmatrix}\frac{\partial f}{\partial T} \\ \frac{\partial f}{\partial \rho}\end{pmatrix}$$

Inverting this relationship and replacing the physical variables where they belong, we get

$$\begin{pmatrix}\left(\frac{\partial \mu}{\partial T}\right)_\rho \\ \left(\frac{\partial \mu}{\partial \rho}\right)_T\end{pmatrix} = \begin{pmatrix}1 & -\frac{\frac{\partial \rho}{\partial T}}{\frac{\partial \rho}{\partial P}} \\ 0 & \frac{1}{\frac{\partial \rho}{\partial P}} \end{pmatrix}\begin{pmatrix}\left(\frac{\partial \mu}{\partial T}\right)_P \\ \left(\frac{\partial \mu}{\partial P}\right)_T\end{pmatrix}$$