Algorithms for Synchrophasors, Frequency, and ROCOF