A Microgrid is a group of interconnected loads and distributed energy resources within clearly defined electrical boundaries that acts as a... Show moreA Microgrid is a group of interconnected loads and distributed energy resources within clearly defined electrical boundaries that acts as a single controllable entity with respect to the grid and that connects and disconnects from such grid to enable it to operate in both grid-connected or island mode. The optimized energy scheduling problem is significant to both utilities and community consumers. In this thesis, I present an approach by analyzing the historical weather data and renewable energy data, and build a two-stage stochastic program with a long term view towards minimizing costs. The underlying stochastic process that generates uncertainty in demand and supply in power network is the local weather, thus understanding solar radiation as a function of weather is significant to us. First, two simple methods, which are majority rule and flexible time selection, are proposed with the purpose of handling noisy raw data and giving a relatively precise prediction of renewable energy consumption and overall energy demands. Then, I implement a deterministic strategy, a two-stage stochastic program and a repeated stochastic program using AMPL, a mathematical modeling language. Every stochastic program is defined as based on 42 scenarios from the weather conditions. In the final step, I solve the model using CPLEX and compare optimal solutions based on a year-long Monte Carlo simulation. Ignoring installation and maintenance costs, the Microgrid can make some profit by an optimized control based on our modeling approach utilizing the stochastic optimization paradigm. Although there are only slight differences between three models, the repeated two-stage stochastic model gives the best long-term results. M.S. in Applied Mathematics, December 2014 Show less