Utility and Welfare Optimization (Theory and Practice in Electricity)