Compact model for phase change memory cells