Commit 24fecc4
committed
Widen voltage-limit knee, raise gmin for convergence
Paul's pfalstad#241 test circuit with multiple open switches was still failing.
Root cause: vt was 5% of maxVoltage (0.25V for a 5V limit), giving a
near-discontinuous Jacobian. g jumps by ~1e7 across a few tens of mV
near the compliance threshold, so Newton pings between the linear and
saturated regimes.
Changes:
- vt = max(0.2 * maxVoltage, 0.1V) spreads the knee so sech^2 varies
smoothly across ~1V instead of ~0.25V.
- Gmin floor raised from 1e-9 to 1e-6 to keep the Norton resistor well
below the matrix stiffness scale in open-circuit topologies.
- Removed the explicit converged=false trigger; the solver's own
convergence criteria are sufficient once the Jacobian is well-shaped.1 parent f7156f2 commit 24fecc4
1 file changed
+13
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
125 | | - | |
126 | | - | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
127 | 132 | | |
128 | 133 | | |
129 | 134 | | |
130 | 135 | | |
131 | | - | |
132 | | - | |
133 | 136 | | |
134 | 137 | | |
135 | 138 | | |
136 | 139 | | |
137 | | - | |
| 140 | + | |
138 | 141 | | |
139 | 142 | | |
140 | 143 | | |
| |||
145 | 148 | | |
146 | 149 | | |
147 | 150 | | |
148 | | - | |
149 | | - | |
150 | | - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
151 | 155 | | |
152 | 156 | | |
153 | 157 | | |
| |||
0 commit comments