---
id: wiki-2026-0508-digital-twins
title: Digital Twins
category: 10_Wiki/Topics
status: verified
canonical_id: self
aliases: [Digital Twin, DT, Cyber-Physical Mirror]
duplicate_of: none
source_trust_level: A
confidence_score: 0.9
verification_status: applied
tags: [iot, simulation, cps, industry-4]
raw_sources: []
last_reinforced: 2026-05-10
github_commit: pending
tech_stack:
  language: Python/C++
  framework: NVIDIA-Omniverse/Azure-DigitalTwins
---

# Digital Twins

## 매 한 줄
> **"매 physical asset/system 의 매 live, bidirectional digital replica"**. Grieves 2002 의 PLM concept 가 매 IoT, sensor cost 폭락, real-time sim, generative AI 의 만남으로 매 Industry 4.0 의 핵심. 매 NVIDIA Omniverse, Azure Digital Twins, Siemens Xcelerator 의 2026 era — physical + digital 의 매 closed loop.

## 매 핵심

### 매 3 layer
- **Physical**: 실제 자산 + sensor (vibration, temp, pressure, camera).
- **Communication**: MQTT/OPC-UA/AMQP, time-series store, edge gateway.
- **Digital**: 3D model + physics sim + ML predictor + control logic.

### 매 spectrum
- **Digital model**: static 3D, no live data.
- **Digital shadow**: one-way (physical → digital).
- **Digital twin**: bidirectional — twin can command physical.

### 매 응용
1. Predictive maintenance (jet engine, wind turbine).
2. Smart city traffic / energy optimization.
3. Manufacturing line virtual commissioning.
4. Healthcare (patient-specific organ twin).
5. Robot fleet sim (NVIDIA Isaac, Omniverse).

## 💻 패턴

### Sensor → twin (MQTT + Python)
```python
import paho.mqtt.client as mqtt, json, time

def on_message(c, u, msg):
    data = json.loads(msg.payload)
    twin.update_state(asset_id=data['id'], temp=data['temp'], ts=data['ts'])
    if twin.predict_failure(data['id']) > 0.8:
        c.publish(f"cmd/{data['id']}/throttle", "0.5")  # bidirectional!

cli = mqtt.Client(); cli.on_message = on_message
cli.connect("mqtt.factory.local"); cli.subscribe("sensor/+"); cli.loop_forever()
```

### Azure Digital Twins (DTDL)
```json
{
  "@id": "dtmi:com:factory:Pump;1",
  "@type": "Interface",
  "displayName": "Pump",
  "contents": [
    { "@type": "Property", "name": "rpm", "schema": "double" },
    { "@type": "Telemetry", "name": "vibration", "schema": "double" },
    { "@type": "Command", "name": "shutdown" },
    { "@type": "Relationship", "name": "feeds", "target": "dtmi:com:factory:Tank;1" }
  ]
}
```

### Physics-based twin (Modelica via FMU)
```python
from fmpy import simulate_fmu
result = simulate_fmu(
    'pump.fmu',
    start_values={'inlet_pressure': 2.5, 'rpm': 1800},
    output=['outlet_pressure', 'efficiency'],
    stop_time=10.0
)
```

### Omniverse USD scene (live update)
```python
from pxr import Usd, UsdGeom, Gf
stage = Usd.Stage.Open('factory.usd')
pump = UsdGeom.Xform.Get(stage, '/World/Pump_01')
# Stream live sensor pose via OmniGraph / Live Sync
def on_telemetry(rpm, vibration):
    pump.GetPrim().GetAttribute('rpm:live').Set(rpm)
    pump.GetPrim().GetAttribute('vib:live').Set(vibration)
```

### Predictive maintenance (LSTM)
```python
import torch.nn as nn
class FailurePredictor(nn.Module):
    def __init__(self, n_sensors=8):
        super().__init__()
        self.lstm = nn.LSTM(n_sensors, 64, batch_first=True)
        self.head = nn.Linear(64, 1)
    def forward(self, x):  # (B, T, n_sensors)
        h, _ = self.lstm(x)
        return torch.sigmoid(self.head(h[:, -1]))
# Train on (sensor window, RUL label) pairs from CMAPSS / NASA dataset.
```

## 매 결정 기준
| 상황 | Approach |
|---|---|
| Single asset, simple monitoring | Digital shadow (cheap) |
| Fleet w/ predictive maint. | Twin + ML failure model |
| Process plant commissioning | Physics twin (FMU/Modelica) |
| Robotics / AV training | Sim-to-real (Isaac, CARLA) |
| Smart city / building | Hierarchical twins (DTDL) |

**기본값**: 매 start digital shadow → ML 추가 후 twin → bidirectional 마지막.

## 🔗 Graph
- 부모: [[Cyber-Physical Systems]] · [[Industry 4.0]]
- 변형: [[Digital Shadow]] · [[Digital Model]]
- 응용: [[Predictive Maintenance]] · [[Sim-to-Real]] · [[Smart City]]
- Adjacent: [[OPC-UA]] · [[USD (OpenUSD)]] · [[NVIDIA Omniverse]] · [[FMI/FMU]]

## 🤖 LLM 활용
**언제**: IoT/manufacturing/CPS context, sim2real planning, asset lifecycle.
**언제 X**: Pure web app, no physical asset. 매 marketing buzzword 화 주의.

## ❌ 안티패턴
- **3D model = twin 오해**: 매 3D 만으론 shadow도 아님.
- **Sensor 무인 데이터**: garbage in → garbage twin.
- **No model versioning**: physical 변경 시 twin drift.
- **Closed-loop without safety**: bidirectional 시 매 fail-safe + human-in-loop 필수.
- **Vendor lock-in**: proprietary schema → DTDL/USD 표준 사용.

## 🧪 검증 / 중복
- Verified (Grieves 2014, NIST CPS framework, Azure DT docs, NVIDIA Omniverse docs).
- 신뢰도 A.

## 🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — DT layers + DTDL/Omniverse/MQTT patterns |
