Intelligent system applications to power quality and substation automation