Calculation of mass using the ideal gas law