Analog.Semiconductors.Tests.DiodeBreakdown
Reverse-breakdown test for Diode2 — a zener clamp. Diode has no breakdown branch, so this test targets Diode2 with Bv = 6.8.
A 12 V, 50 Hz sine drives node X through 100 Ohm with the diode's cathode on X and anode grounded, so the diode clamps both swings:
negative swings forward-bias the junction: X clamps near
Vf = 0.7, on the linear continuation aboveVdMax = Vf + N*Vt;positive swings reverse it past
Bv = 6.8: X clamps near +6.8 V on the breakdown branch, which switches in belowvd = -Bv/2.
Both seams are C1, so the solver needs no region tests. d.v is anode minus cathode, so the waveform swings between +0.7 and -6.8. The 100 nF capacitor supplies the differential state; its 10 µs time constant is far below the 20 ms period, so the clamping is quasi-static.
Usage
ElectricalComponents.Analog.Semiconductors.Tests.DiodeBreakdown()
Behavior
Source
"""
Reverse-breakdown test for `Diode2` — a zener clamp. `Diode` has no breakdown branch, so
this test targets `Diode2` with `Bv = 6.8`.
A 12 V, 50 Hz sine drives node X through 100 Ohm with the diode's cathode on X and anode
grounded, so the diode clamps both swings:
* negative swings forward-bias the junction: X clamps near `Vf = 0.7`, on the linear
continuation above `VdMax = Vf + N*Vt`;
* positive swings reverse it past `Bv = 6.8`: X clamps near +6.8 V on the breakdown
branch, which switches in below `vd = -Bv/2`.
Both seams are C1, so the solver needs no region tests. `d.v` is anode minus cathode, so
the waveform swings between +0.7 and -6.8. The 100 nF capacitor supplies the
differential state; its 10 µs time constant is far below the 20 ms period, so the
clamping is quasi-static.
"""
test component DiodeBreakdown
"Sine signal: 12 V amplitude, 50 Hz — past the 6.8 V breakdown each cycle"
sine = BlockComponents.Sources.Sine(amplitude = 12, frequency = 50) {
"Dyad": {"placement": {"diagram": {"x1": 160, "x2": 260, "y1": 276, "y2": 376}}}
}
"Drive source"
vs = ElectricalComponents.Analog.Sources.VoltageSource() {
"Dyad": {"placement": {"diagram": {"x1": 295, "x2": 395, "y1": 381, "y2": 481}}}
}
"Source series resistance (100 Ω), limiting the clamp current"
rs = ElectricalComponents.Analog.Basic.Resistor(R = 100) {
"Dyad": {"placement": {"diagram": {"x1": 425, "x2": 525, "y1": 606, "y2": 706}}}
}
"Diode under test, breakdown at 6.8 V; cathode to X, anode grounded"
d = ElectricalComponents.Analog.Semiconductors.Diode2(Bv = 6.8) {"Dyad": {"placement": {"diagram": {"x1": 35, "x2": 135, "y1": 71, "y2": 171}}}}
"Node capacitance (100 nF); supplies the differential state"
cx = ElectricalComponents.Analog.Basic.Capacitor(C = 100n) {
"Dyad": {"placement": {"diagram": {"x1": 165, "x2": 265, "y1": 71, "y2": 171}}}
}
"Ground reference"
ground = ElectricalComponents.Analog.Basic.Ground() {
"Dyad": {"placement": {"diagram": {"x1": 425, "x2": 525, "y1": 486, "y2": 586}}}
}
relations
initial cx.v = 0
connect(sine.y, vs.V) {"Dyad": {"edges": [{"S": 1, "M": [{"x": 345, "y": 326}], "E": 2}], "path": {}}}
connect(vs.p, rs.p) {
"Dyad": {
"edges": [{"S": 1, "M": [{"x": 280, "y": 431}, {"x": 280, "y": 656}], "E": 2}],
"path": {}
}
}
"Node X: source through rs, diode cathode, capacitor"
connect(rs.n, d.n, cx.p) {
"Dyad": {
"edges": [
{
"S": 1,
"M": [{"x": 540, "y": 656}, {"x": 540, "y": 20}, {"x": 150, "y": 20}],
"E": -1
},
{"S": -1, "M": [], "E": 2},
{"S": -1, "M": [], "E": 3}
],
"junctions": [{"x": 150, "y": 121}],
"path": {}
}
}
"Diode anode grounded, so breakdown clamps positive swings of X"
connect(d.p, cx.n, vs.n, ground.g) {
"Dyad": {
"edges": [
{
"S": 1,
"M": [{"x": 20, "y": 121}, {"x": 20, "y": 226}, {"x": 280, "y": 226}],
"E": -1
},
{"S": -1, "M": [], "E": 2},
{"S": -1, "M": [{"x": 410, "y": 121}], "E": -2},
{"S": -2, "M": [], "E": 3},
{"S": -2, "M": [{"x": 475, "y": 431}], "E": 4}
],
"junctions": [{"x": 280, "y": 121}, {"x": 410, "y": 431}],
"path": {}
}
}
metadata {
"Dyad": {
"tests": {
"case1": {
"stop": 0.06,
"abstol": 1e-9,
"reltol": 0.000001,
"expect": {"signals": ["d.v", "d.i", "cx.v"]}
}
}
}
}
endFlattened Source
"""
Reverse-breakdown test for `Diode2` — a zener clamp. `Diode` has no breakdown branch, so
this test targets `Diode2` with `Bv = 6.8`.
A 12 V, 50 Hz sine drives node X through 100 Ohm with the diode's cathode on X and anode
grounded, so the diode clamps both swings:
* negative swings forward-bias the junction: X clamps near `Vf = 0.7`, on the linear
continuation above `VdMax = Vf + N*Vt`;
* positive swings reverse it past `Bv = 6.8`: X clamps near +6.8 V on the breakdown
branch, which switches in below `vd = -Bv/2`.
Both seams are C1, so the solver needs no region tests. `d.v` is anode minus cathode, so
the waveform swings between +0.7 and -6.8. The 100 nF capacitor supplies the
differential state; its 10 µs time constant is far below the 20 ms period, so the
clamping is quasi-static.
"""
test component DiodeBreakdown
"Sine signal: 12 V amplitude, 50 Hz — past the 6.8 V breakdown each cycle"
sine = BlockComponents.Sources.Sine(amplitude = 12, frequency = 50) {
"Dyad": {"placement": {"diagram": {"x1": 160, "x2": 260, "y1": 276, "y2": 376}}}
}
"Drive source"
vs = ElectricalComponents.Analog.Sources.VoltageSource() {
"Dyad": {"placement": {"diagram": {"x1": 295, "x2": 395, "y1": 381, "y2": 481}}}
}
"Source series resistance (100 Ω), limiting the clamp current"
rs = ElectricalComponents.Analog.Basic.Resistor(R = 100) {
"Dyad": {"placement": {"diagram": {"x1": 425, "x2": 525, "y1": 606, "y2": 706}}}
}
"Diode under test, breakdown at 6.8 V; cathode to X, anode grounded"
d = ElectricalComponents.Analog.Semiconductors.Diode2(Bv = 6.8) {"Dyad": {"placement": {"diagram": {"x1": 35, "x2": 135, "y1": 71, "y2": 171}}}}
"Node capacitance (100 nF); supplies the differential state"
cx = ElectricalComponents.Analog.Basic.Capacitor(C = 100n) {
"Dyad": {"placement": {"diagram": {"x1": 165, "x2": 265, "y1": 71, "y2": 171}}}
}
"Ground reference"
ground = ElectricalComponents.Analog.Basic.Ground() {
"Dyad": {"placement": {"diagram": {"x1": 425, "x2": 525, "y1": 486, "y2": 586}}}
}
relations
initial cx.v = 0
connect(sine.y, vs.V) {"Dyad": {"edges": [{"S": 1, "M": [{"x": 345, "y": 326}], "E": 2}], "path": {}}}
connect(vs.p, rs.p) {
"Dyad": {
"edges": [{"S": 1, "M": [{"x": 280, "y": 431}, {"x": 280, "y": 656}], "E": 2}],
"path": {}
}
}
"Node X: source through rs, diode cathode, capacitor"
connect(rs.n, d.n, cx.p) {
"Dyad": {
"edges": [
{
"S": 1,
"M": [{"x": 540, "y": 656}, {"x": 540, "y": 20}, {"x": 150, "y": 20}],
"E": -1
},
{"S": -1, "M": [], "E": 2},
{"S": -1, "M": [], "E": 3}
],
"junctions": [{"x": 150, "y": 121}],
"path": {}
}
}
"Diode anode grounded, so breakdown clamps positive swings of X"
connect(d.p, cx.n, vs.n, ground.g) {
"Dyad": {
"edges": [
{
"S": 1,
"M": [{"x": 20, "y": 121}, {"x": 20, "y": 226}, {"x": 280, "y": 226}],
"E": -1
},
{"S": -1, "M": [], "E": 2},
{"S": -1, "M": [{"x": 410, "y": 121}], "E": -2},
{"S": -2, "M": [], "E": 3},
{"S": -2, "M": [{"x": 475, "y": 431}], "E": 4}
],
"junctions": [{"x": 280, "y": 121}, {"x": 410, "y": 431}],
"path": {}
}
}
metadata {
"Dyad": {
"tests": {
"case1": {
"stop": 0.06,
"abstol": 1e-9,
"reltol": 0.000001,
"expect": {"signals": ["d.v", "d.i", "cx.v"]}
}
}
}
}
endTest Cases
Test Case case1
pltpltplt