Optimal Power Usage by Stochastic Programming