1. Introduction 2. Renewable energy sources : modeling and forecasting 3. Clearing the day-ahead market with a high penetration of stochastic production 4. Balancing markets 5. Managing uncertainty with flexibility 6. Impact of stochastic renewable energy generation on market quantities 7. Trading stochastic production in electricity pools 8. Virtual power plants 9. Facilitating renewable integration by demand response A. Random variables and stochastic processes B. Basics of optimization C. Introduction to stochastic programming D. Introduction to robust optimization E. GAMS Codes Index