Skip to content
LIBRARY
Analog.Semiconductors.Tests.DiodeHeating.md

Analog.Semiconductors.Tests.DiodeHeating ​

Self-heating test for Diode, use_heat_port = true — the heat-port loop for a non-BJT device (ThermalRunaway covers the NPN).

A 5 V supply through 10 Ω forward-biases the diode at about 0.42 A, so it dissipates roughly 0.35 W. That flows out of the heat port into a thermal mass and through a 50 K/W conductance to ambient, settling around 17 K above ambient with a thermal time constant C_th * R_th = 0.5 s.

The electro-thermal loop closes gently here: as T_dev rises, Is_T climbs (the SPICE XTI/EG law) and the forward drop falls by roughly 2 mV/K, so the current creeps up a few percent as the junction warms — visible in d.i alongside d.T_dev. The 10 Ω ballast keeps the loop firmly stable; this bench is checking that the temperature law and the port coupling compile and integrate.

Usage ​

ElectricalComponents.Analog.Semiconductors.Tests.DiodeHeating()

Behavior ​

Source ​

dyad
"""
Self-heating test for Diode, `use_heat_port = true` — the heat-port loop for a
non-BJT device (`ThermalRunaway` covers the NPN).

A 5 V supply through 10 Ω forward-biases the diode at about 0.42 A, so it
dissipates roughly 0.35 W. That flows out of the heat port into a thermal mass
and through a 50 K/W conductance to ambient, settling around 17 K above
ambient with a thermal time constant `C_th * R_th` = 0.5 s.

The electro-thermal loop closes gently here: as `T_dev` rises, `Is_T` climbs
(the SPICE `XTI`/`EG` law) and the forward drop falls by roughly 2 mV/K, so
the current creeps up a few percent as the junction warms — visible in `d.i`
alongside `d.T_dev`. The 10 Ω ballast keeps the loop
firmly stable; this bench is checking that the temperature law and the port
coupling compile and integrate.
"""
test component DiodeHeating
  "Supply level (5 V)"
  supply_lvl = BlockComponents.Sources.Constant(k = 5) {"Dyad": {"placement": {"diagram": {"x1": 20, "x2": 120, "y1": 70, "y2": 170}}}}
  "Supply source"
  supply = ElectricalComponents.Analog.Sources.VoltageSource() {
    "Dyad": {"placement": {"diagram": {"x1": 155, "x2": 255, "y1": 175, "y2": 275}}}
  }
  "Ballast resistor (10 Ω), setting the operating current"
  rs = ElectricalComponents.Analog.Basic.Resistor(R = 10) {
    "Dyad": {"placement": {"diagram": {"x1": 285, "x2": 385, "y1": 276, "y2": 376}}}
  }
  "Diode under test, thermally coupled"
  d = ElectricalComponents.Analog.Semiconductors.Diode(use_heat_port = true, use_temperature_dependency = true) {
    "Dyad": {"placement": {"diagram": {"x1": 415, "x2": 515, "y1": 276, "y2": 376}}}
  }
  "Junction and package thermal mass"
  mass = ThermalComponents.Components.HeatCapacitor(C = 0.01, T0 = 300.15) {
    "Dyad": {"placement": {"diagram": {"x1": 542.5, "x2": 642.5, "y1": 276, "y2": 376}}}
  }
  "Heatsink path to ambient (50 K/W)"
  sink = ThermalComponents.Components.ThermalConductor(G = 0.02) {
    "Dyad": {"placement": {"diagram": {"x1": 670, "x2": 770, "y1": 381, "y2": 481}}}
  }
  "Ambient reservoir"
  ambient = ThermalComponents.Sources.FixedTemperature(T = 300.15) {
    "Dyad": {"placement": {"diagram": {"x1": 540, "x2": 640, "y1": 481, "y2": 581}}}
  }
  "Ground reference"
  ground = ElectricalComponents.Analog.Basic.Ground() {
    "Dyad": {"placement": {"diagram": {"x1": 285, "x2": 385, "y1": 75, "y2": 175}}}
  }
relations
  connect(supply_lvl.y, supply.V) {"Dyad": {"edges": [{"S": 1, "M": [{"x": 205, "y": 120}], "E": 2}], "path": {}}}
  connect(supply.p, rs.p) {
    "Dyad": {
      "edges": [{"S": 1, "M": [{"x": 140, "y": 225}, {"x": 140, "y": 326}], "E": 2}],
      "path": {}
    }
  }
  connect(rs.n, d.p) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "path": {}}}
  connect(d.n, supply.n, ground.g) {
    "Dyad": {
      "edges": [
        {"S": 1, "M": [{"x": 530, "y": 326}, {"x": 530, "y": 225}], "E": -1},
        {"S": -1, "M": [], "E": 2},
        {"S": -1, "M": [{"x": 270, "y": 20}, {"x": 335, "y": 20}], "E": 3}
      ],
      "junctions": [{"x": 270, "y": 225}],
      "path": {}
    }
  }
  "Thermal path: junction into the mass, mass to ambient through the heatsink"
  connect(d.port, mass.port) {
    "Dyad": {
      "edges": [{"S": 1, "M": [{"x": 465, "y": 431}], "E": -1}, {"S": -1, "M": [], "E": 2}],
      "junctions": [{"x": 592.5, "y": 431}],
      "path": {}
    }
  }
  connect(mass.port, sink.port_a) {
    "Dyad": {
      "edges": [{"S": 1, "M": [], "E": -1}, {"S": -1, "M": [], "E": 2}],
      "junctions": [{"x": 592.5, "y": 431}],
      "path": {}
    }
  }
  connect(sink.port_b, ambient.port) {
    "Dyad": {
      "edges": [{"S": 1, "M": [{"x": 785, "y": 431}, {"x": 785, "y": 531}], "E": 2}],
      "path": {}
    }
  }
metadata {
  "Dyad": {
    "tests": {"case1": {"stop": 5, "expect": {"signals": ["d.i", "d.T_dev", "d.LossPower"]}}}
  }
}
end
Flattened Source
dyad
"""
Self-heating test for Diode, `use_heat_port = true` — the heat-port loop for a
non-BJT device (`ThermalRunaway` covers the NPN).

A 5 V supply through 10 Ω forward-biases the diode at about 0.42 A, so it
dissipates roughly 0.35 W. That flows out of the heat port into a thermal mass
and through a 50 K/W conductance to ambient, settling around 17 K above
ambient with a thermal time constant `C_th * R_th` = 0.5 s.

The electro-thermal loop closes gently here: as `T_dev` rises, `Is_T` climbs
(the SPICE `XTI`/`EG` law) and the forward drop falls by roughly 2 mV/K, so
the current creeps up a few percent as the junction warms — visible in `d.i`
alongside `d.T_dev`. The 10 Ω ballast keeps the loop
firmly stable; this bench is checking that the temperature law and the port
coupling compile and integrate.
"""
test component DiodeHeating
  "Supply level (5 V)"
  supply_lvl = BlockComponents.Sources.Constant(k = 5) {"Dyad": {"placement": {"diagram": {"x1": 20, "x2": 120, "y1": 70, "y2": 170}}}}
  "Supply source"
  supply = ElectricalComponents.Analog.Sources.VoltageSource() {
    "Dyad": {"placement": {"diagram": {"x1": 155, "x2": 255, "y1": 175, "y2": 275}}}
  }
  "Ballast resistor (10 Ω), setting the operating current"
  rs = ElectricalComponents.Analog.Basic.Resistor(R = 10) {
    "Dyad": {"placement": {"diagram": {"x1": 285, "x2": 385, "y1": 276, "y2": 376}}}
  }
  "Diode under test, thermally coupled"
  d = ElectricalComponents.Analog.Semiconductors.Diode(use_heat_port = true, use_temperature_dependency = true) {
    "Dyad": {"placement": {"diagram": {"x1": 415, "x2": 515, "y1": 276, "y2": 376}}}
  }
  "Junction and package thermal mass"
  mass = ThermalComponents.Components.HeatCapacitor(C = 0.01, T0 = 300.15) {
    "Dyad": {"placement": {"diagram": {"x1": 542.5, "x2": 642.5, "y1": 276, "y2": 376}}}
  }
  "Heatsink path to ambient (50 K/W)"
  sink = ThermalComponents.Components.ThermalConductor(G = 0.02) {
    "Dyad": {"placement": {"diagram": {"x1": 670, "x2": 770, "y1": 381, "y2": 481}}}
  }
  "Ambient reservoir"
  ambient = ThermalComponents.Sources.FixedTemperature(T = 300.15) {
    "Dyad": {"placement": {"diagram": {"x1": 540, "x2": 640, "y1": 481, "y2": 581}}}
  }
  "Ground reference"
  ground = ElectricalComponents.Analog.Basic.Ground() {
    "Dyad": {"placement": {"diagram": {"x1": 285, "x2": 385, "y1": 75, "y2": 175}}}
  }
relations
  connect(supply_lvl.y, supply.V) {"Dyad": {"edges": [{"S": 1, "M": [{"x": 205, "y": 120}], "E": 2}], "path": {}}}
  connect(supply.p, rs.p) {
    "Dyad": {
      "edges": [{"S": 1, "M": [{"x": 140, "y": 225}, {"x": 140, "y": 326}], "E": 2}],
      "path": {}
    }
  }
  connect(rs.n, d.p) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "path": {}}}
  connect(d.n, supply.n, ground.g) {
    "Dyad": {
      "edges": [
        {"S": 1, "M": [{"x": 530, "y": 326}, {"x": 530, "y": 225}], "E": -1},
        {"S": -1, "M": [], "E": 2},
        {"S": -1, "M": [{"x": 270, "y": 20}, {"x": 335, "y": 20}], "E": 3}
      ],
      "junctions": [{"x": 270, "y": 225}],
      "path": {}
    }
  }
  "Thermal path: junction into the mass, mass to ambient through the heatsink"
  connect(d.port, mass.port) {
    "Dyad": {
      "edges": [{"S": 1, "M": [{"x": 465, "y": 431}], "E": -1}, {"S": -1, "M": [], "E": 2}],
      "junctions": [{"x": 592.5, "y": 431}],
      "path": {}
    }
  }
  connect(mass.port, sink.port_a) {
    "Dyad": {
      "edges": [{"S": 1, "M": [], "E": -1}, {"S": -1, "M": [], "E": 2}],
      "junctions": [{"x": 592.5, "y": 431}],
      "path": {}
    }
  }
  connect(sink.port_b, ambient.port) {
    "Dyad": {
      "edges": [{"S": 1, "M": [{"x": 785, "y": 431}, {"x": 785, "y": 531}], "E": 2}],
      "path": {}
    }
  }
metadata {
  "Dyad": {
    "tests": {"case1": {"stop": 5, "expect": {"signals": ["d.i", "d.T_dev", "d.LossPower"]}}}
  }
}
end


Test Cases ​

Test Case case1 ​

julia
plt

julia
plt

julia
plt