A protective relay is basically an electrical device that detects a fault in a power system and initiates the operation…