Intensity Distribution for Multiple Slit Diffraction
The mathematical treatment of Fraunhofer diffraction can be used to calculate intensity patterns of both single-slit and multiple-slit diffraction. The relevant formulas are difficult to derive with the methods available in college mathematics. As an alternative, this Demonstration uses Richard P. Feynman's method of "integrating over paths". This approach is more physical than mathematical, but leads to the same results.
For each slit, the vectors of 40 waves are summed up at a given point on the screen and then the vector sum over all slits gives the intensity at that point. You can calculate one vector for each slit and achieve a fairly good representation of the intensity distribution. A larger number of waves yields better agreement with experimental results and shows the modulation of intensity depending on the slit width of the grating.