Just stated to have this problem with my 2013ish iMac 27in. During use it just shuts right off. Sometimes ill get a day out of using it then it shuts down. After it shuts down, I have to unplug it to restart it. Sometimes after restart I might be a few minutes of use before it happens again. Apple ran a bunch of test over the phone and also reinstalled operating system and still didn't work. I then brought it into the apple store, they had it for a week and could not duplicate the problem. After getting it back I used it for a few days and all good then it happened again, just my luck. Nothing extra is plugged into the computer, any suggestions would be greatly appreciated. Last year the hard drive failed on this computer and I had to replace that as well.