Modelling Stochastic Optimization to Energy and Reserve Market in a Microgrid Environment - Diogo Faria de Castro (2018)