We propose a methodology for building digital twins for the management of production systems. The digital twin consists of invariant and variable parts. The variable part is associated with industry-specific features of the subject area. A theoretical and quantitative mathematical description of the elements of the digital twin model is proposed. On the basis of predicate calculus a mathematical model for search of a problem situation and development of management actions is proposed.