Commit 1b0ea53
Fix SCR convergence failure with series resistor (sharpie7#851)
Move the SCR on/off state evaluation from doStep() to startIteration()
so it is evaluated once per timestep rather than on every Newton-Raphson
sub-iteration. The previous code switched the anode resistance between
0.0105 ohms (on) and 100K ohms (off) inside doStep(), causing the
resistance to flip-flop on every iteration when the SCR was near its
trigger threshold with an external series resistor, preventing
convergence.
This matches the pattern used by TriacElm and DiacElm, which both
evaluate their state in startIteration().
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 6b826de commit 1b0ea53
1 file changed
+14
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| 100 | + | |
100 | 101 | | |
101 | 102 | | |
102 | 103 | | |
| |||
217 | 218 | | |
218 | 219 | | |
219 | 220 | | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
220 | 234 | | |
221 | 235 | | |
222 | 236 | | |
| |||
226 | 240 | | |
227 | 241 | | |
228 | 242 | | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | 243 | | |
235 | 244 | | |
236 | 245 | | |
| |||
0 commit comments