Phase diagram function