The approach to create power system digital twins is presented by the example of energy supply of a geographically localized R&D facility. In this paper, the six-layer digital twin architecture is proposed and its prototype software implementation is described. The architecture consists of an ontological model, a digital single line diagram, electronic documentation, master data, load measurement data, and mathematical models and simulations. The paper describes problems and principles of ontological modeling of the prosumer infrastructure, including customer load, low-voltage distribution network sections, small-scale generation equipment, and electric energy storage devices. The optimal configuration of the hybrid power supply system with renewable energy sources was computed using the digital twin that was composed according to the presented approach. For machine-readable representation of the digital twin, the ontological modeling language OWL is used.