On the Supply Function Equilibrium and its Applications in Electricity Markets