Аннотация:The paper considers the problem of modeling the diffraction of a plane electromagnetic wave on a periodic in one direction cylindrical structure, that is given by its permittivity function. This structure can be both periodic and non-periodic in the third direction (along the z axis). The wave comes from the direction of the z axis at some angle to it. A computer program was written to calculate the resulting electromagnetic field, the coefficients of transmission, reflection, absorption. Verification of the correctness of the program is carried out by comparing the computational results with analytical formulas for diffraction of a plane electromagnetic wave on a periodic layered structure. The stability of the diffraction result to perturbations of the layer shape is studied. It is shown that the diffraction result is resistant to small random perturbations of the layer shape, which indicates the possibility of solving the inverse problem of determining the internal structure of the medium by the results of sensing.