Equation of state for ideal and non-ideal (van der Waals) gases