<s> r"""<STR_LIT>""" <EOL> import scipy as sp <EOL> def standard ( phase , <EOL> pore_MW = '<STR_LIT>' , <EOL> pore_density = '<STR_LIT>' , <EOL> ** kwargs ) : <EOL> r"""<STR_LIT>""" <EOL> MW = phase [ pore_MW ] <EOL> rho = phase [ pore_density ] <EOL> value = rho / MW <EOL> return value <EOL> def ideal_gas ( phase , <EOL> pore_pressure = '<STR_LIT>' , <EOL> pore_temperature = '<STR_LIT>' , <EOL> ** kwargs ) : <EOL> r"""<STR_LIT>""" <EOL> R = <NUM_LIT> <EOL> P = phase [ pore_pressure ] <EOL> T = phase [ pore_temperature ] <EOL> value = P / ( R * T ) <EOL> return value <EOL> def vanderwaals ( phase , <EOL> pore_P = '<STR_LIT>' , <EOL> pore_T = '<STR_LIT>' , <EOL> pore_Pc = '<STR_LIT>' , <EOL> pore_Tc = '<STR_LIT>' , <EOL> ** kwargs ) : <EOL> r"""<STR_LIT>""" <EOL> P = phase [ pore_P ] / <NUM_LIT> <EOL> T = phase [ pore_T ] <EOL> Pc = phase [ pore_Pc ] / <NUM_LIT> <EOL> Tc = phase [ pore_Tc ] <EOL> R = <NUM_LIT> <EOL> a = <NUM_LIT> * ( R ** <NUM_LIT:2> ) * ( Tc ** <NUM_LIT:2> ) / ( <NUM_LIT:64> * Pc ) <EOL> b = R * Tc / ( <NUM_LIT:8> * Pc ) <EOL> a1 = - <NUM_LIT:1> / b <EOL> a2 = ( R * T + b * P ) / ( a * b ) <EOL> a3 = - P / ( a * b ) <EOL> a0 = sp . ones ( sp . shape ( a1 ) ) <EOL> coeffs = sp . vstack ( ( a0 , a1 , a2 , a3 ) ) . T <EOL> density = sp . array ( [ sp . roots ( C ) for C in coeffs ] ) <EOL> value = sp . real ( density [ : , <NUM_LIT:2> ] ) * <NUM_LIT> <EOL> return value </s>
