Planning and management of power systems