Modeling Consumer Behavior In Electricity Markets - Theory And Applications