The reason you need to use the group velocity is that information (the wave and/or the packet) travels at this speed. The phase velocity just tells you what happens to a particular phase (say the crest) through space - it dies away at the end of your wave, it has no meaning outside of the wave...
I am not worried about my Mathematica code but about the question from the problem - is this a symmetric function? Are my conclusions correct? How do I calculate the relative intensities? How does the phase distribution over the slit affect the pattern?
Homework Statement
Describe how the Fraunhofer diffraction pattern of a grating depends on:
(a) the spacing between the grating lines;
(b) the overall extent of the grating;
(c) the amplitude distribution over an individual line;
(d) the phase distribution over an individual line.
A...