Determination of thermodynamic properties from the speed of sound