AbstractAspects of the methodological support of digital twins were presented by the example of the chemical and energy engineering process of phosphorus production from apatite–nepheline ore waste. Algorithmic support was developed for one of the levels of the hierarchy of the information structure of a self-refining digital twin. This support is intended for the complex optimization of the operation of the phosphorus production plant according to the criterion of the minimum resource consumption. The algorithm is based on the ensemble application of deep neural networks, the training of which can continue during the operation of the plant. The results of a model experiment performed using the created program that implemented the developed algorithmic support of the self-refining digital twin were presented.