mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-04-23 03:00:17 -04:00
See plot:
```
import CoolProp, numpy as np, matplotlib.pyplot as plt
CP = CoolProp.CoolProp
AS = CP.AbstractState('HEOS','Methane&Ethane')
AS.set_mole_fractions([0.5,0.5])
# The spinodal
AS.build_spinodal()
sp = AS.get_spinodal_data()
plt.plot(sp.tau, sp.delta, label='spinodal')
# The phase envelope
AS.build_phase_envelope("none")
pe = AS.get_phase_envelope_data()
plt.plot(AS.T_reducing()/np.array(pe.T), np.array(pe.rhomolar_vap)/AS.rhomolar_reducing(), label='phase envelope')
plt.show()
```