The aim of the study is to develop and verify an algorithm for automatic generation of leaflet apparatus models for prosthetic heart valves, to optimize the basic parameters of the models in order to minimize the stress-strain state and maximize the geometric area of the orifice.Materials and Methods. The suggested algorithm consists of three blocks: "Generator", "Modeling", "Analysis". The first block creates a three-dimensional model of the leaflet apparatus using the specified parameters (height, radius, thickness, degree of "sagging", angle of the free edge deviation). Numerical simulation of the apparatus functioning is further performed using the finite element method. Then, the statistical analysis of the von Mises stresses is done and the opening area of the design in question is calculated.Verification was performed by comparing quantitatively the lumen areas of the leaflet apparatus in the open state, obtained from the literature data for the Trifecta bioprosthesis (19, 21, and 23 mm in diameter), with the results of the described algorithm operation.Results. The verification of the algorithm has demonstrated the following deviations in the lumen area in the open state: 2.85% for 19 mm, 14.81% for 21 mm, and 23.17% for 23 mm models. This difference is due to the choice of the model material (no data could be found on the physical and mechanical properties of the pericardium used for the fabrication of the Trifecta bioprostheses).The generation of a large number of designs (n=1517) without fixation of certain geometry parameters has shown that thickness of the leaflet apparatus makes the greatest contribution to the degree of opening; its dependence on the thickness and arising peak von Mises stresses has been demonstrated. Of the valvular models obtained, 278 showed the opening degree greater than 80% and maximum peak von Mises stresses below 4 MPa for the proposed model of the pericardium, which is 65% below the ultimate strength of the material.Out of 278 leaflet models, 3 "optimal" designs were selected meeting the diameter criteria of 19, 21, and 23 mm. The loss index for them was 0.24, 0.19, 0.20 with the opening degrees of 88.28, 84.48, 88.12%, and maximum peak von Mises stresses of 3.62, 1.21, 1.87 MPa, respectively. Conclusion. The developed algorithm makes it possible to automatically generate three-dimensional models of the leaflet apparatus, numerically simulate the opening process using the finite element method, statistically analyze the results obtained, and calculate the lumen area. The algorithm was verified based on the data for the Trifecta bioprosthesis of three standard sizes. The presented algorithm can be used both for the research and development of various designs and for obtaining "optimal" models of sash devices.