# Digital Twin

## Overview

A _Digital Twin_ is a virtual copy of a physical device. It simulates the behaviour of the physical device based on the constant stream of data received through its sensors.

> 
A digital twin is a virtual representation of an object or system that spans its lifecycle, is updated from real-time data, and uses simulation, machine learning and reasoning to help decision-making.

Another detailed definition
> 
A digital twin is a dynamic virtual representation of a physical object or system, usually across multiple stages of its lifecycle. It uses real-world data, simulation or machine learning models, combined with data analysis, to enable understanding, learning, and reasoning. Digital twins can be used to answer what-if questions and should be able to present the insights in an intuitive way.

source: [IBM](https://web.archive.org/web/20210515151526/https://developer.ibm.com/articles/what-are-digital-twins/)

For e.g., [Google Maps](https://www.google.com/maps) is a _Digital Twin_ of the earth for a specific industry context.

## Existing Problems
These are few problems which _Digital Twin_ wants to solve:

- Making physical devices transparent
- Real-time data monitoring of a digital component
- Proactive anomaly/failure detection. For e.g. predicting MTTF* and MTBF** of a Part/Product.
- Predictive suggestions on optimizing the efficiency of a physical device and overall plant production yield.

## Categories of Digital Twins

There are three categories of Twins:

1. Part Twin/Discrete Twin
2. Product Twin/Composite Twin
3. System Twin/Digital Twin for Organization


Example:
A wind energy alternator system

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1621157466009/JubEuDfMz.png)
`Part Twin` is one intrinsic part of an alternator/turbine that rotates to produce electricity


![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1621157492404/0E64yI8GM.png)
`Product Twin` is the aggregation of multiple `Part twins` which twins an entire turbine.


![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1621157510209/7cXX5SFFQ.png)
`System Twin` twins the entire Wind turbine system on an organizational level.

Each of these categories is further divided into the following three kinds:

1. `Status`: Provides the status of the device. Generally created with visualization tools.
2. `Operational`:  Provides more info than the `Status twins`. These twins can change the parameters and implement actions.
3. `Simulation`: Combining historical data with real-time live feed predicts future states, detects anomalies, optimization opportunities can improve the recovery yield of plants.


![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1621157604329/-3lG-ZV3M.png)

## References and Further reading

- [What are digital twins](https://web.archive.org/web/20210515151526/https://developer.ibm.com/articles/what-are-digital-twins/)
- [Digital Twins and The Internet of Things](https://web.archive.org/web/20210515151225/https://developer.ibm.com/technologies/iot/articles/digital-twins-and-the-internet-of-things)
- [Digital Twin](https://en.wikipedia.org/wiki/Digital_twin)
- [Digital Twinning In Architecture, Engineering, And Construction](https://www.parsons.com/2020/12/digital-twinning-in-architecture-engineering-and-construction/)
- [IoT Architecture of Digital Twin with Apache Kafka](https://dzone.com/articles/iot-architectures-for-digital-twin-with-apache-kaf)

## Appendix

### MTTF

- The average time hardware runs before falling permanently.
- This metrics is used where there is a very low to no chance of repairability of products.

### MTBF

- The average time required to repair hardware and making it up back into production.


![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1621154392062/iCCddo22F.png)
Sample Diagram to understand MTTF and MTBF

Photo by <a href="https://unsplash.com/@sortino?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Joshua Sortino</a> on <a href="https://unsplash.com/s/photos/iot?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
  

