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

Analog.Semiconductors.Tests.PNPOperatingPoint ​

Forward-active operating-point check for PNP, the polarity mirror of NPNOperatingPoint.

The emitter is held at 0.65 V, the base at ground through 10 Ohm, and the collector at -4.35 V, so V_EB = 0.65 and V_CB = -4.35 — numerically the same junction voltages as the NPN test. The collector current is the exact negation:

i_c = I_EC*(qbk + 1/Br) - I_CC*qbk = -9.04886e-6

Simulated -9.04827e-6; the 6.4e-5 relative gap is the base drop, as in the NPN test. The substrate is grounded, matching MSL's useSubstrate = false.

Usage ​

ElectricalComponents.Analog.Semiconductors.Tests.PNPOperatingPoint(Vemitter=0.65, Vcollector=-4.35)

Parameters: ​

NameDescriptionUnitsDefault value
VemitterEmitter biasV0.65
VcollectorCollector biasV-4.35

Behavior ​

Source ​

dyad
"""
Forward-active operating-point check for PNP, the polarity mirror of
`NPNOperatingPoint`.

The emitter is held at 0.65 V, the base at ground through 10 Ohm, and the collector at
-4.35 V, so `V_EB = 0.65` and `V_CB = -4.35` — numerically the same junction voltages as
the NPN test. The collector current is the exact negation:

```
i_c = I_EC*(qbk + 1/Br) - I_CC*qbk = -9.04886e-6
```

Simulated -9.04827e-6; the 6.4e-5 relative gap is the base drop, as in the NPN test.
The substrate is grounded, matching MSL's `useSubstrate = false`.
"""
test component PNPOperatingPoint
  "Emitter level"
  emit_sig = BlockComponents.Sources.Constant(k = Vemitter) {
    "Dyad": {"placement": {"diagram": {"x1": 20, "x2": 120, "y1": 120, "y2": 220}}}
  }
  "Emitter source"
  ve = ElectricalComponents.Analog.Sources.VoltageSource() {
    "Dyad": {"placement": {"diagram": {"x1": 155, "x2": 255, "y1": 340, "y2": 440}}}
  }
  "Small base series resistance; keeps the drive off `C_jE`"
  rb = ElectricalComponents.Analog.Basic.Resistor(R = 10) {
    "Dyad": {"placement": {"diagram": {"x1": 285, "x2": 385, "y1": 560, "y2": 660}}}
  }
  "Collector level"
  col_sig = BlockComponents.Sources.Constant(k = Vcollector) {
    "Dyad": {"placement": {"diagram": {"x1": 150, "x2": 250, "y1": 20, "y2": 120}}}
  }
  "Collector source"
  vc = ElectricalComponents.Analog.Sources.VoltageSource() {
    "Dyad": {"placement": {"diagram": {"x1": 285, "x2": 385, "y1": 125, "y2": 225}}}
  }
  "Transistor under test, default card"
  q = ElectricalComponents.Analog.Semiconductors.PNP() {
    "Dyad": {"placement": {"diagram": {"x1": 415, "x2": 515, "y1": 455, "y2": 555}}}
  }
  "Ground reference"
  ground = ElectricalComponents.Analog.Basic.Ground() {
    "Dyad": {"placement": {"diagram": {"x1": 415, "x2": 515, "y1": 230, "y2": 330}}}
  }
  "Emitter bias"
  parameter Vemitter::Voltage = 0.65
  "Collector bias"
  parameter Vcollector::Voltage = -4.35
relations
  "Started at the operating point, so the junction states carry no transient"
  initial q.V_EB = 0.65
  connect(emit_sig.y, ve.V) {"Dyad": {"edges": [{"S": 1, "M": [{"x": 205, "y": 170}], "E": 2}], "path": {}}}
  connect(col_sig.y, vc.V) {"Dyad": {"edges": [{"S": 1, "M": [{"x": 335, "y": 70}], "E": 2}], "path": {}}}
  connect(ve.p, q.e) {
    "Dyad": {
      "edges": [
        {
          "S": 1,
          "M": [{"x": 140, "y": 390}, {"x": 140, "y": 710}, {"x": 465, "y": 710}],
          "E": 2
        }
      ],
      "path": {}
    }
  }
  connect(rb.p, q.b) {
    "Dyad": {
      "edges": [{"S": 1, "M": [{"x": 270, "y": 610}, {"x": 270, "y": 505}], "E": 2}],
      "path": {}
    }
  }
  connect(vc.p, q.c) {
    "Dyad": {
      "edges": [
        {
          "S": 1,
          "M": [{"x": 270, "y": 175}, {"x": 270, "y": 380}, {"x": 465, "y": 380}],
          "E": 2
        }
      ],
      "path": {}
    }
  }
  connect(rb.n, q.s, ve.n, vc.n, ground.g) {
    "Dyad": {
      "edges": [
        {"S": 1, "M": [{"x": 530, "y": 610}], "E": -1},
        {"S": -1, "M": [], "E": 2},
        {"S": -1, "M": [{"x": 530, "y": 400}, {"x": 270, "y": 400}], "E": -2},
        {"S": -2, "M": [], "E": 3},
        {"S": -2, "M": [{"x": 400, "y": 390}], "E": -3},
        {"S": -3, "M": [], "E": 4},
        {"S": -3, "M": [{"x": 465, "y": 175}], "E": 5}
      ],
      "junctions": [{"x": 530, "y": 505}, {"x": 270, "y": 390}, {"x": 400, "y": 175}],
      "path": {}
    }
  }
metadata {
  "Dyad": {
    "tests": {
      "case1": {
        "stop": 0.000001,
        "atol": {"q.c.i": 2e-8},
        "expect": {"final": {"q.c.i": -0.0000090483}}
      }
    }
  }
}
end
Flattened Source
dyad
"""
Forward-active operating-point check for PNP, the polarity mirror of
`NPNOperatingPoint`.

The emitter is held at 0.65 V, the base at ground through 10 Ohm, and the collector at
-4.35 V, so `V_EB = 0.65` and `V_CB = -4.35` — numerically the same junction voltages as
the NPN test. The collector current is the exact negation:

```
i_c = I_EC*(qbk + 1/Br) - I_CC*qbk = -9.04886e-6
```

Simulated -9.04827e-6; the 6.4e-5 relative gap is the base drop, as in the NPN test.
The substrate is grounded, matching MSL's `useSubstrate = false`.
"""
test component PNPOperatingPoint
  "Emitter level"
  emit_sig = BlockComponents.Sources.Constant(k = Vemitter) {
    "Dyad": {"placement": {"diagram": {"x1": 20, "x2": 120, "y1": 120, "y2": 220}}}
  }
  "Emitter source"
  ve = ElectricalComponents.Analog.Sources.VoltageSource() {
    "Dyad": {"placement": {"diagram": {"x1": 155, "x2": 255, "y1": 340, "y2": 440}}}
  }
  "Small base series resistance; keeps the drive off `C_jE`"
  rb = ElectricalComponents.Analog.Basic.Resistor(R = 10) {
    "Dyad": {"placement": {"diagram": {"x1": 285, "x2": 385, "y1": 560, "y2": 660}}}
  }
  "Collector level"
  col_sig = BlockComponents.Sources.Constant(k = Vcollector) {
    "Dyad": {"placement": {"diagram": {"x1": 150, "x2": 250, "y1": 20, "y2": 120}}}
  }
  "Collector source"
  vc = ElectricalComponents.Analog.Sources.VoltageSource() {
    "Dyad": {"placement": {"diagram": {"x1": 285, "x2": 385, "y1": 125, "y2": 225}}}
  }
  "Transistor under test, default card"
  q = ElectricalComponents.Analog.Semiconductors.PNP() {
    "Dyad": {"placement": {"diagram": {"x1": 415, "x2": 515, "y1": 455, "y2": 555}}}
  }
  "Ground reference"
  ground = ElectricalComponents.Analog.Basic.Ground() {
    "Dyad": {"placement": {"diagram": {"x1": 415, "x2": 515, "y1": 230, "y2": 330}}}
  }
  "Emitter bias"
  parameter Vemitter::Voltage = 0.65
  "Collector bias"
  parameter Vcollector::Voltage = -4.35
relations
  "Started at the operating point, so the junction states carry no transient"
  initial q.V_EB = 0.65
  connect(emit_sig.y, ve.V) {"Dyad": {"edges": [{"S": 1, "M": [{"x": 205, "y": 170}], "E": 2}], "path": {}}}
  connect(col_sig.y, vc.V) {"Dyad": {"edges": [{"S": 1, "M": [{"x": 335, "y": 70}], "E": 2}], "path": {}}}
  connect(ve.p, q.e) {
    "Dyad": {
      "edges": [
        {
          "S": 1,
          "M": [{"x": 140, "y": 390}, {"x": 140, "y": 710}, {"x": 465, "y": 710}],
          "E": 2
        }
      ],
      "path": {}
    }
  }
  connect(rb.p, q.b) {
    "Dyad": {
      "edges": [{"S": 1, "M": [{"x": 270, "y": 610}, {"x": 270, "y": 505}], "E": 2}],
      "path": {}
    }
  }
  connect(vc.p, q.c) {
    "Dyad": {
      "edges": [
        {
          "S": 1,
          "M": [{"x": 270, "y": 175}, {"x": 270, "y": 380}, {"x": 465, "y": 380}],
          "E": 2
        }
      ],
      "path": {}
    }
  }
  connect(rb.n, q.s, ve.n, vc.n, ground.g) {
    "Dyad": {
      "edges": [
        {"S": 1, "M": [{"x": 530, "y": 610}], "E": -1},
        {"S": -1, "M": [], "E": 2},
        {"S": -1, "M": [{"x": 530, "y": 400}, {"x": 270, "y": 400}], "E": -2},
        {"S": -2, "M": [], "E": 3},
        {"S": -2, "M": [{"x": 400, "y": 390}], "E": -3},
        {"S": -3, "M": [], "E": 4},
        {"S": -3, "M": [{"x": 465, "y": 175}], "E": 5}
      ],
      "junctions": [{"x": 530, "y": 505}, {"x": 270, "y": 390}, {"x": 400, "y": 175}],
      "path": {}
    }
  }
metadata {
  "Dyad": {
    "tests": {
      "case1": {
        "stop": 0.000001,
        "atol": {"q.c.i": 2e-8},
        "expect": {"final": {"q.c.i": -0.0000090483}}
      }
    }
  }
}
end


Test Cases ​

Test Case case1 ​