Hi Michael !
I would 1st suggest you to try unplugging the machine, holding the power button for 10s then plugging it back it.
I had the same problem with the same mac model. I ended up replacing the power supply unit (iFixit sells [product|IF165-000|that part]) and it now works well. Couldn't tell if your computer has the same problem but I'm glad that it fixed mine.
Hope this helps !