0
$\begingroup$

This is a numerical analysis problem that I should know the answer to, but for some reason, I am all over the shop...

I have a grid of $\rho$ and $T$ values, with $\rho > 0$ and $T \ge 0$. At each grid point I have values for the functions $e(\rho,T)$ and $p(\rho,T)$.

I need to calculate a third value $S(\rho,T)$ at every grid point, where $S$ satisfies:

$\text{d}e = T\text{d}S + \frac{p}{\rho^2}\text{d}\rho;\ \ \ S(\rho,0) = 0$

My approach so far has been:

$\int_A^B \text{d}S = \int_A^B \frac{1}{T} \text{d}e - \int_A^B \frac{p}{\rho^2T} \text{d}\rho$

and then computing this numerically, but it is not giving me sensible answers. Any thoughts?

EDIT: The equation is the second law of thermodynamics, where $e$ is internal energy, $T$ is temperature, $\rho$ is density, $p$ is pressure and $S$ is entropy.

  • 0
    @EdGorcenski The equation is the second law of thermodynamics. Updated variables to make this clear.2012-11-01

1 Answers 1

0

Your integral form isn't working because it's not correct.

$\int_A^B f(s)dS$ means that we integrate $f$ as $S$ ranges over the interval $[A,B]$. You cannot simply apply the same integration limits to the other independent variables; i.e., if $\int_A^B dS$ is valid, then $\int_A^B \frac{1}{T} de$ means that $e$ ranges from $S=A$ to $S=B$, which doesn't generally make sense.

You want to compute $S(\rho,T)$, but you cannot obtain that form explicitly. Instead, you need to employ the chain rule, and instead compute $S(p(\rho,T),e(\rho,T))$ via the Jacobian matrix $S'$.