Local linear approximation for tracking frequency in power systems