Readers here do not have a solution at-the-ready because that has NEVER been a solution to any problem posted here.
Changing/upgrading the Power supply is NOT likely to be the the solution to your seemingly random shutdowns, either. But readers would like to help you find out what IS the reason.
Consider downloading and running this little "discovery" utility, Etrecheck. It changes NOTHING. Etrecheck was developed by senior contributor here, and uses system calls to collect often-needed information.
it contains little tests for speeds of devices, CPU utilization, memory usage, energy usage and a digest of recent problems, in one easy to use package. it does not even need to be Installed. Because less can be learned when your Mac is running great, best time to run is when your problems are actually occurring, if possible.
if you follow the directions faithfully, its report (pre-laundered of all personally-identifiable information) can be "Shared" to the System ClipBoard, then Pasted into an ‘Additional Text’ window in a reply on the forums.
Use Etrecheck pro for free:
http://Etrecheck.com
...