An equivalent source model was used to describe realistic third-generation synchrotron hard X-rays to avoid simplifying the light source model excessively or introducing too many variables from optical elements into quantitative calculation. By using particle swarm optimization, through secondary source with different slit apertures, the direct beam diffraction patterns on the detection plane propagated from the simulated equivalent source were in great agreement with the measured patterns. This study is hoped to reduce the difficulty of calculation and improve the accuracy of various coherent imaging or metrology measurements.