Add DUT model protocol

Define the DUTModel Protocol interface that all device models must
implement to integrate with the physics engine.
This commit is contained in:
2025-02-20 18:53:40 +00:00
parent 842ff09431
commit 7937dbf079

View File

@@ -0,0 +1,61 @@
"""Base protocol for Device Under Test (DUT) models.
Defines the interface that all DUT models must implement to integrate
with the physics engine.
"""
from typing import Protocol, runtime_checkable
@runtime_checkable
class DUTModel(Protocol):
"""Protocol for DUT electrical/thermal models.
DUT models encapsulate the temperature-dependent electrical behaviour
of a device, enabling realistic simulation of thermal-electrical coupling.
All temperature parameters are in degrees Celsius.
All voltage parameters are in volts.
All current parameters are in amps.
All power parameters are in watts.
"""
def calculate_output_voltage(self, junction_temperature: float) -> float:
"""Calculate the output voltage at the given junction temperature.
Args:
junction_temperature: DUT junction temperature in degrees Celsius.
Returns:
Output voltage in volts.
"""
...
def calculate_quiescent_current(self, junction_temperature: float) -> float:
"""Calculate the quiescent current at the given junction temperature.
Args:
junction_temperature: DUT junction temperature in degrees Celsius.
Returns:
Quiescent current in amps.
"""
...
def calculate_power_dissipation(
self,
input_voltage: float,
load_current: float,
junction_temperature: float,
) -> float:
"""Calculate the power dissipation for given operating conditions.
Args:
input_voltage: Input voltage in volts.
load_current: Load current in amps.
junction_temperature: DUT junction temperature in degrees Celsius.
Returns:
Power dissipation in watts.
"""
...