Invest $50 in a UPS (battery backup) with AVR (Automatic Voltage Regulation). You can get them for around $50. That should solve your problem and add life to your computer in the process.

Good luck.