add function to calculate and output EOS of the system