There are a number of different things going on here, and too many complications in the worksheet to let the basic issues show clearly. I didn't change most of the sheet, but I did remove the second delta 1 frequency term, since it just clouds the issue.
1. The cases of z= 5 and z=500 show the same symptom: leakage. Due to the spacing of the sampling intervals, integer z does not correspond to integer # of cycles over the full sampling period.I added some functions in rev2 (attached) to calc power and actual bin number. z=5 is centered at bin 4.69, z=500 is centered at bin 469.19. the different fractional spacing explains the difference in spectral component amplitudes - leakage is spread differently.
2. When z=0.1 (low) , the actual value of the sampled function is near 0, not 1, since the sampling does not start at zero argument of the cosine, since k has an initial offset. Not sure why this is need, since the spectrum depends only on the span of the sampled data, not the origin. In any case, the waveform for z = 0.1 is around the zero crossing of the cosine, not near its peak.
3. When z =0, the sampled function is constant=1, giving only a bin(0) value = 1, the average (only thing present). When z is not zero, the cosine consists of two complex exponential components, each of amplitude 1/2, one at bin# = z and one at bin# = -z, which shows up at bin# = N-z since the spectrum is effectively periodic with N, the # of samples.moving from z=0 to z not 0 results in switching from one component with value 1 to two components of value 1/2 each. The FFT returns only one of these. You have to reconstruct the other.
The FFT assumes a real input, and returns only that part of the spectrum from 0 to fs/2. It does not return the upper half (fs/2 to fs) of the full spectrum, since these values are complex conjugates of the lower half. However, these missing values need to be included in any power calc.The CFFT function works with complex as well as real input waveforms, and returns the complete spectrum, with all components from 0 to fs. It works with any size vector. Unless dealing with a large # of transforms, I personally find the simplicity of using the CFFT worthwhile.
I think your worksheet is much too complicated to serve as a vehicle to explore DFT behavior. The best way to familiarize yourself with how the DFT functions behave is to work with a simple function - one real sinusoid, or even better, a single complex exponential. since the all the DFT's are linear. Learning how a single component works should help with more complicated behavior. Deal with sample #'s first and then set up with time and frequency. Keep track of how many cycles are in the complete sampling interval - this is the effective bin#. Note that if the input is sampled at k=0,1,2,...9, that the repeat sample span is 10, since this is assumed to be the same as k=0. the repeat interval is not 9.
Hope this helps,
Lou