Power systems analysis and planning