Basic differential relay working function