Risk and Flexibility in Electricity: Introduction to the Fundamentals and Techniques