A novel simulation program in the MATLAB format for x-ray diffraction profiles in multilayers was developed, which can be applied to any multilayered structure with no limitations. The simulation algorithm (nickname DIWAS) is based on direct summation of waves, scattered by individual atomic planes. It takes into account strain and concentration-induced fluctuations of interplanar spacings, interface roughness and buried amorphous layers, and enables the addition of diffuse scattering profiles.The program allows handling of asymmetric reflections as well as symmetric ones, taking special care of the effective layer thickness. The summation over individual layers can be done coherently or incoherently, depending on the interface structure. To make the fitting procedure comprehensible, the contribution of every layer can be plotted separately.In this paper, the direct wave summation (DIWAS) routine is described in detail and is applied to fit experimental diffraction profiles taken from MOVPE grown heterostructures and superlattices of practical importance, such as InGaN/GaN/AlGaN/sapphire, GaAsN/GaAs, InGaAsP/InP and InGaAs/InP.