THE factory of the future will be a building stuffed full of robots making robots. A factory in Amberg, a small town in Bavaria, is not quite that, but it gets close. The plant is run by Siemens, a German engineering giant, and it makes industrial computer-control systems, which are essential bits of kit used in a variety of automated systems, including the factory’s own production lines.

The Amberg plant is bright, airy and squeaky clean. It produces 15m units a year—a tenfold increase since opening in 1989, and without the building being expanded or any great increase in the 1,200 workers employed in three shifts. (Production is about 75% automated, as Siemens reckons some tasks are still best done by humans.) The defect rate is close to zero, as 99.9988% of units require no adjustment, a remarkable feat considering they come in more than 1,000 different varieties.

Such achievements are largely down to the factory’s “digital twin”. For there is another factory, a virtual version of the physical facility that resides within a computer system. This digital twin is identical in every respect and is used to design the control units, test them, simulate how to make them and program production machines. Once everything is humming along nicely, the digital twin hands over to the physical factory to begin making things for real.

The digital twin is not a new invention. The concept of pairing traces its roots to the early days of space travel, when NASA built models to help monitor and modify spacecraft that, once launched, were beyond their physical reach. As computer power increased, these analogue models turned into digital ones.

The powerful systems that have since emerged bring together several elements—software services in computer-aided design and engineering; simulation; process control; and product life cycle management. Some digital twins are gaining artificial intelligence and virtual-reality capabilities, too. They can also help to monitor remotely and provide after-service for products that have been sold. “It is a digital twin of the entire value chain,” says Jan Mrosik, the chief executive of Siemens’s Digital Factory Division.

Siemens is not alone in equipping its factories with digital twins. Its American rival, GE, is doing the same. Both companies also sell their digital-twin software, along with firms such as Dassault Systèmes, a French specialist in the area. Customers come from industries ranging from aerospace and defence to automotive, consumer products, energy, heavy machinery and pharmaceuticals.

One motivation for twinning is to bring products to market faster and at a lower cost. The digital twin allows endless design iterations to be tried in the virtual world without having to stop the production line to see how they can be made, says Mr Mrosik. The twin can also model people working in a factory to improve their ergonomics. In one example, Maserati, which is part of Fiat Chrysler Automobiles (whose chairman is a director of The Economist’s parent company), used a digital twin to put its Ghibli sports saloon into production in Grugliasco, Italy, in just 16 months instead of the typical 30 months.

The spread of digital twins could shake up supply chains. For example, suppliers could be asked to submit a digital twin of their product so that it can be tested in a manufacturer’s virtual factory before an order is placed. It is already a requirement at the Amberg plant for suppliers to deliver a digital twin along with their product to help installation.

Twins will become more responsive still as products are increasingly fitted with sensors that relay data to the internet. Formula 1 cars are full of such sensors; racing teams use these data to create digital twins of their cars so that they can rapidly design, test and manufacture parts needed to make hundreds of changes in the week or two between races. GE creates digital twins of its wind turbines and jet engines to monitor their performance and carry out preventive maintenance. Data transmitted from a jet engine while planes are in the air can provide 15-30 days’ advance notice of potential failures.

Even mass-produced goods that are far less complex are likely to end up having digital siblings. This would help with product tracking and verification, which is increasingly important in food manufacturing and pharmaceutical production. Just about any product could have a unique identifier that links to production data, if not a full digital twin, reckons Thomas Körmendi, the chief executive of Kezzler, a Norwegian company that produces secure product codes using an algorithm.

The firm’s codes can be scanned with a smartphone, which then connects over the internet so that information can be exchanged with a digital twin on things like a product’s location and use. A consumer in London checking the provenance of a bottle of fine wine, for example, could confirm the vintage, or be alerted to the possibility of counterfeiting if the bottle had actually been dispatched to a different country. That’s something everyone can raise a glass to.