http://ltwiki.org/index.php?title=Convergence_problems%3F&feed=atom&action=historyConvergence problems? - Revision history2024-03-29T15:14:55ZRevision history for this page on the wikiMediaWiki 1.31.7http://ltwiki.org/index.php?title=Convergence_problems%3F&diff=1207&oldid=prevLewispaul: further explain transient control options2013-10-01T16:30:27Z<p>further explain transient control options</p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 16:30, 1 October 2013</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l11" >Line 11:</td>
<td colspan="2" class="diff-lineno">Line 11:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|}</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|}</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del class="diffchange diffchange-inline">Be suspicious </del>of <del class="diffchange diffchange-inline">circuits that need something like </del>the <del class="diffchange diffchange-inline">alternate solver or </del>cshunt. <del class="diffchange diffchange-inline"> To me, it means something in the circuit is poorly behaved; in other words, there is something in </del>a <del class="diffchange diffchange-inline">model that is not realistic</del>.</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">''.options gmin=1e-10'' => Add a small conductance of 1e10(=10GOhm) parallel to every diode</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>of <ins class="diffchange diffchange-inline">transistors and diodes.<br></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">''.options abstol=1e-10'' => Increase the allowed tolerance from 1e-12 to 1e-10 for the</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">convergence criteria.<br></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">''.options reltol=0.003'' => Increase the allowed tolerance from 0.0001 to 0.003 for </ins>the</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">convergence criteria.  Never larger than 0.003! <br></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">''.options </ins>cshunt<ins class="diffchange diffchange-inline">=1e-15'' => Capacitance added from each node to ground</ins>. <ins class="diffchange diffchange-inline">Adding </ins>a <ins class="diffchange diffchange-inline">small CSHUNT to each node can solve some "internal timestep too small" problems caused by high-frequency oscillations or numerical noise. Default = 0</ins>.<ins class="diffchange diffchange-inline"><br></ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">See [http://www.ece.uci.edu/docs/hspice/hspice_2001_2-71.html Understanding the Control Options] for a more detailed look.<br></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">'''Be suspicious''' of circuits that need something like the alternate solver or cshunt.  To me, it means something in the circuit is poorly behaved; in other words, there is something in a model that is not realistic.<br></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">'''All of these settings changes''' trade off accuracy for speed.  If these changes don't significantly improve the speed of the simulation, remove them.  It never makes sense to add them for any simulation that takes under a minute or two.<br></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">== Common questions or situations ==</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><font color="blue">'''''I have been trying to understand your models of PWM controllers.  You seem to use a BI current source in series of a capacitor very often.  Can you please let me know why a capacitor is needed, and how you determine the capacitor value?  Is it to help the convergence or to implement the pole of op amp?  For example, the nodes of "hys", "latch", "Ierr" in UC3842A model you created, as attached.'''''</font color></div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><font color="blue">'''''I have been trying to understand your models of PWM controllers.  You seem to use a BI current source in series of a capacitor very often.  Can you please let me know why a capacitor is needed, and how you determine the capacitor value?  Is it to help the convergence or to implement the pole of op amp?  For example, the nodes of "hys", "latch", "Ierr" in UC3842A model you created, as attached.'''''</font color></div></td></tr>
</table>Lewispaulhttp://ltwiki.org/index.php?title=Convergence_problems%3F&diff=913&oldid=prevLewispaul at 18:56, 6 July 20122012-07-06T18:56:53Z<p></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 18:56, 6 July 2012</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l1" >Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>{|table width="<del class="diffchange diffchange-inline">400</del>" style="background-color:#ddffff" align="center" border="1" cellspacing="2" cellpadding="8"|</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>{|table width="<ins class="diffchange diffchange-inline">360</ins>" style="background-color:#ddffff" align="center" border="1" cellspacing="2" cellpadding="8"|</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|+ style="color:#0000ff; font-size:1.2em;" | SPICE settings that generally work with Transient Analysis<br />&nbsp;</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|+ style="color:#0000ff; font-size:1.2em;" | SPICE settings that generally work with Transient Analysis<br />&nbsp;</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|- align="center"</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|- align="center"</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l7" >Line 7:</td>
<td colspan="2" class="diff-lineno">Line 7:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|- align="center"</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|- align="center"</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|.options reltol=0.003</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|.options reltol=0.003</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">|- align="center"</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">|.options cshunt=1e-15</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|}</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|}</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">Be suspicious of circuits that need something like the alternate solver or cshunt.  To me, it means something in the circuit is poorly behaved; in other words, there is something in a model that is not realistic.</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
</table>Lewispaulhttp://ltwiki.org/index.php?title=Convergence_problems%3F&diff=653&oldid=prevLewispaul: Add DISQUS for comments2011-09-21T00:45:17Z<p>Add DISQUS for comments</p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 00:45, 21 September 2011</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l50" >Line 50:</td>
<td colspan="2" class="diff-lineno">Line 50:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Differencing circuits with a lot of dc and gain are always good candidates for the unity node treatment as are abrupt limiters.  Behavioral expressions with node voltages in their denominators such that when the sources go to zero, the expressions blow up (something gone small / something gone to zero => infinity) can be especially troublesome.  These types of expressions can be multiplied by the unity node raised to whatever power required to make them behave.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Differencing circuits with a lot of dc and gain are always good candidates for the unity node treatment as are abrupt limiters.  Behavioral expressions with node voltages in their denominators such that when the sources go to zero, the expressions blow up (something gone small / something gone to zero => infinity) can be especially troublesome.  These types of expressions can be multiplied by the unity node raised to whatever power required to make them behave.</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">{{#widget:DISQUS</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">|id=ltwiki</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">|uniqid={{PAGENAME}}</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">|url={{fullurl:{{PAGENAME}}}}</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">}}</ins></div></td></tr>
</table>Lewispaulhttp://ltwiki.org/index.php?title=Convergence_problems%3F&diff=528&oldid=prevLewispaul at 04:13, 17 March 20102010-03-17T04:13:41Z<p></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 04:13, 17 March 2010</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l1" >Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>{|table width="400" style="background-color:#<del class="diffchange diffchange-inline">ccffff</del>" align="center" border="1" cellspacing="2" cellpadding="8"|</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>{|table width="400" style="background-color:#<ins class="diffchange diffchange-inline">ddffff</ins>" align="center" border="1" cellspacing="2" cellpadding="8"|</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>|+ style="color:#0000ff; font-size:1.2em;" | <del class="diffchange diffchange-inline">Spice </del>settings that generally work with Transient Analysis<br />&nbsp;</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>|+ style="color:#0000ff; font-size:1.2em;" | <ins class="diffchange diffchange-inline">SPICE </ins>settings that generally work with Transient Analysis<br />&nbsp;</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|- align="center"</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|- align="center"</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|.options gmin=1e-10</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|.options gmin=1e-10</div></td></tr>
</table>Lewispaulhttp://ltwiki.org/index.php?title=Convergence_problems%3F&diff=527&oldid=prevLewispaul at 04:10, 17 March 20102010-03-17T04:10:04Z<p></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 04:10, 17 March 2010</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l1" >Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">{|table width="400" style="background-color:#ccffff" align="center" border="1" cellspacing="2" cellpadding="8"|</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">|+ style="color:#0000ff; font-size:1.2em;" | Spice settings that generally work with Transient Analysis<br />&nbsp;</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">|- align="center"</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">|.options gmin=1e-10</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">|- align="center"</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">|.options abstol=1e-10</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">|- align="center"</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">|.options reltol=0.003</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">|}</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><font color="blue">'''''I have been trying to understand your models of PWM controllers.  You seem to use a BI current source in series of a capacitor very often.  Can you please let me know why a capacitor is needed, and how you determine the capacitor value?  Is it to help the convergence or to implement the pole of op amp?  For example, the nodes of "hys", "latch", "Ierr" in UC3842A model you created, as attached.'''''</font color></div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><font color="blue">'''''I have been trying to understand your models of PWM controllers.  You seem to use a BI current source in series of a capacitor very often.  Can you please let me know why a capacitor is needed, and how you determine the capacitor value?  Is it to help the convergence or to implement the pole of op amp?  For example, the nodes of "hys", "latch", "Ierr" in UC3842A model you created, as attached.'''''</font color></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
</table>Lewispaulhttp://ltwiki.org/index.php?title=Convergence_problems%3F&diff=188&oldid=prevAnalogspiceman at 04:52, 16 August 20092009-08-16T04:52:55Z<p></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 04:52, 16 August 2009</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l1" >Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><font color="<del class="diffchange diffchange-inline">grey</del>">''I have been trying to understand your models of PWM controllers.  You seem to use a BI current source in series of a capacitor very often.  Can you please let me know why a capacitor is needed, and how you determine the capacitor value? Is it to help the convergence or to implement the pole of op amp?  For example, the nodes of "hys", "latch", "Ierr" in UC3842A model you created, as attached.''</font color></div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><font color="<ins class="diffchange diffchange-inline">blue</ins>"><ins class="diffchange diffchange-inline">'''</ins>''I have been trying to understand your models of PWM controllers.  You seem to use a BI current source in series of a capacitor very often.  Can you please let me know why a capacitor is needed, and how you determine the capacitor value? <ins class="diffchange diffchange-inline"> </ins>Is it to help the convergence or to implement the pole of op amp?  For example, the nodes of "hys", "latch", "Ierr" in UC3842A model you created, as attached.<ins class="diffchange diffchange-inline">'''</ins>''</font color></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Whenever possible, I try to arrange a model so the capacitors do double duty, that is to both aid transient convergence and to provide some direct function (e.g., an opamp pole).</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Whenever possible, I try to arrange a model so the capacitors do double duty, that is to both aid transient convergence and to provide some direct function (e.g., an opamp pole).</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><font color="<del class="diffchange diffchange-inline">grey</del>">''I am puzzled with the necessity of adding the capacitor (with various value) when converting a current to a voltage. I would think a current source in <del class="diffchange diffchange-inline">[</del>parallel with a<del class="diffchange diffchange-inline">] </del>1 Ohm resistor is adequate.''</font color></div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><font color="<ins class="diffchange diffchange-inline">blue</ins>"><ins class="diffchange diffchange-inline">'''</ins>''I am puzzled with the necessity of adding the capacitor (with various value) when converting a current to a voltage. <ins class="diffchange diffchange-inline"> </ins>I would think a current source in parallel with a 1 Ohm resistor is adequate.<ins class="diffchange diffchange-inline">'''</ins>''</font color></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>This is fine for low frequencies and dc, but the capacitor is there to aid transient convergence in the face of behavior nonlinear enough to fall outside of the various error tolerance limits (to which the solver responds by reducing the time step).  If the time steps go small enough, the capacitor will dominate the I/V behavior of any finite impedance (hence, the need to use current sources with parallel resistors rather than voltage sources).  Since capacitors are linear devices, the behavior becomes linear and the solver can get through the highly nonlinear behavior zones by taking them in small steps.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>This is fine for low frequencies and dc, but the capacitor is there to aid transient convergence in the face of behavior nonlinear enough to fall outside of the various error tolerance limits (to which the solver responds by reducing the time step).  If the time steps go small enough, the capacitor will dominate the I/V behavior of any finite impedance (hence, the need to use current sources with parallel resistors rather than voltage sources).  Since capacitors are linear devices, the behavior becomes linear and the solver can get through the highly nonlinear behavior zones by taking them in small steps.</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l9" >Line 9:</td>
<td colspan="2" class="diff-lineno">Line 9:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>It is best to make a real circuit capacitance (perhaps a circuit parasitic) perform this duty, but, since the solver will go down to picoseconds, it is almost always possible to choose a capacitor that has absolutely no effect within the normal bandwidth of the circuit, yet still functions very well as a transient convergence aid.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>It is best to make a real circuit capacitance (perhaps a circuit parasitic) perform this duty, but, since the solver will go down to picoseconds, it is almost always possible to choose a capacitor that has absolutely no effect within the normal bandwidth of the circuit, yet still functions very well as a transient convergence aid.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><font color="<del class="diffchange diffchange-inline">grey</del>">''I always use either "a voltage source in series of a 1G Ohm"...''</font color></div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><font color="<ins class="diffchange diffchange-inline">blue</ins>"><ins class="diffchange diffchange-inline">'''</ins>''I always use either "a voltage source in series of a 1G Ohm"...<ins class="diffchange diffchange-inline">'''</ins>''</font color></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Never use a strict voltage source if you can avoid it (the one exception is a zero volt source used for current sensing).  In LTspice, this can be as simple as filling in realistic values for a voltage source's parasitic resistance and capacitance (right mouse click on the source - advance for capacitance).  LTspice will automatically convert such sources into their Norton equivalent (save you having to do the calculation manually).</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Never use a strict voltage source if you can avoid it (the one exception is a zero volt source used for current sensing).  In LTspice, this can be as simple as filling in realistic values for a voltage source's parasitic resistance and capacitance (right mouse click on the source - advance for capacitance).  LTspice will automatically convert such sources into their Norton equivalent (save you having to do the calculation manually).</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><font color="<del class="diffchange diffchange-inline">grey</del>">''...or "a current source in series of a 1 Ohm" for "equation-type" solving purposes.  However, it did not work all the time, either with the wrong value or convergence problem.  I did also try adding a capacitor after I read your models.  It seems to me adding a capacitor would not help.''</font color></div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><font color="<ins class="diffchange diffchange-inline">blue</ins>"><ins class="diffchange diffchange-inline">'''</ins>''...or "a current source in series of a 1 Ohm" for "equation-type" solving purposes.  However, it did not work all the time, either with the wrong value or convergence problem.  I did also try adding a capacitor after I read your models.  It seems to me adding a capacitor would not help.<ins class="diffchange diffchange-inline">'''</ins>''</font color></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>This is either because of other stiff voltage type sources elsewhere within the circuit or because the solver failed when it was trying to find the dc operating point (during which all the capacitors are completely ignored).  The solver combats this by Gmin and/or source stepping (more on this later).</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>This is either because of other stiff voltage type sources elsewhere within the circuit or because the solver failed when it was trying to find the dc operating point (during which all the capacitors are completely ignored).  The solver combats this by Gmin and/or source stepping (more on this later).</div></td></tr>
</table>Analogspicemanhttp://ltwiki.org/index.php?title=Convergence_problems%3F&diff=48&oldid=prevAnalogspiceman at 02:09, 9 August 20092009-08-09T02:09:07Z<p></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 02:09, 9 August 2009</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l11" >Line 11:</td>
<td colspan="2" class="diff-lineno">Line 11:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><font color="grey">''I always use either "a voltage source in series of a 1G Ohm"...''</font color></div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><font color="grey">''I always use either "a voltage source in series of a 1G Ohm"...''</font color></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Never use a strict voltage source if you can avoid it.  In LTspice, this can be as simple as filling in realistic values for a voltage source's parasitic resistance and capacitance (right mouse click on the source - advance for capacitance).  LTspice will automatically convert such sources into their Norton equivalent (save you having to do the calculation manually).</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Never use a strict voltage source if you can avoid it <ins class="diffchange diffchange-inline">(the one exception is a zero volt source used for current sensing)</ins>.  In LTspice, this can be as simple as filling in realistic values for a voltage source's parasitic resistance and capacitance (right mouse click on the source - advance for capacitance).  LTspice will automatically convert such sources into their Norton equivalent (save you having to do the calculation manually).</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><font color="grey">''...or "a current source in series of a 1 Ohm" for "equation-type" solving purposes.  However, it did not work all the time, either with the wrong value or convergence problem.  I did also try adding a capacitor after I read your models.  It seems to me adding a capacitor would not help.''</font color></div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><font color="grey">''...or "a current source in series of a 1 Ohm" for "equation-type" solving purposes.  However, it did not work all the time, either with the wrong value or convergence problem.  I did also try adding a capacitor after I read your models.  It seems to me adding a capacitor would not help.''</font color></div></td></tr>
</table>Analogspicemanhttp://ltwiki.org/index.php?title=Convergence_problems%3F&diff=22&oldid=prevAnalogspiceman at 17:02, 7 August 20092009-08-07T17:02:49Z<p></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 17:02, 7 August 2009</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l1" >Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>''I have been trying to understand your models of PWM controllers.  You seem to use a BI current source in series of a capacitor very often.  Can you please let me know why a capacitor is needed, and how you determine the capacitor value? Is it to help the convergence or to implement the pole of op amp?  For example, the nodes of "hys", "latch", "Ierr" in UC3842A model you created, as attached.''</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><font color="grey"></ins>''I have been trying to understand your models of PWM controllers.  You seem to use a BI current source in series of a capacitor very often.  Can you please let me know why a capacitor is needed, and how you determine the capacitor value? Is it to help the convergence or to implement the pole of op amp?  For example, the nodes of "hys", "latch", "Ierr" in UC3842A model you created, as attached.''<ins class="diffchange diffchange-inline"></font color></ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Whenever possible, I try to arrange a model so the capacitors do double duty, that is to both aid transient convergence and to provide some direct function (e.g., an opamp pole).</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Whenever possible, I try to arrange a model so the capacitors do double duty, that is to both aid transient convergence and to provide some direct function (e.g., an opamp pole).</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>''I am puzzled with the necessity of adding the capacitor (with various value) when converting a current to a voltage. I would think a current source in [parallel with a] 1 Ohm resistor is adequate.''</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><font color="grey"></ins>''I am puzzled with the necessity of adding the capacitor (with various value) when converting a current to a voltage. I would think a current source in [parallel with a] 1 Ohm resistor is adequate.''<ins class="diffchange diffchange-inline"></font color></ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>This is fine for low frequencies and dc, but the capacitor is there to aid transient convergence in the face of behavior nonlinear enough to fall outside of the various error tolerance limits (to which the solver responds by reducing the time step).  If the time steps go small enough, the capacitor will dominate the I/V behavior of any finite impedance (hence, the need to use current sources with parallel resistors rather than voltage sources).  Since capacitors are linear devices, the behavior becomes linear and the solver can get through the highly nonlinear behavior zones by taking them in small steps.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>This is fine for low frequencies and dc, but the capacitor is there to aid transient convergence in the face of behavior nonlinear enough to fall outside of the various error tolerance limits (to which the solver responds by reducing the time step).  If the time steps go small enough, the capacitor will dominate the I/V behavior of any finite impedance (hence, the need to use current sources with parallel resistors rather than voltage sources).  Since capacitors are linear devices, the behavior becomes linear and the solver can get through the highly nonlinear behavior zones by taking them in small steps.</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l9" >Line 9:</td>
<td colspan="2" class="diff-lineno">Line 9:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>It is best to make a real circuit capacitance (perhaps a circuit parasitic) perform this duty, but, since the solver will go down to picoseconds, it is almost always possible to choose a capacitor that has absolutely no effect within the normal bandwidth of the circuit, yet still functions very well as a transient convergence aid.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>It is best to make a real circuit capacitance (perhaps a circuit parasitic) perform this duty, but, since the solver will go down to picoseconds, it is almost always possible to choose a capacitor that has absolutely no effect within the normal bandwidth of the circuit, yet still functions very well as a transient convergence aid.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>''I always use either "a voltage source in series of a 1G Ohm"...''</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><font color="grey"></ins>''I always use either "a voltage source in series of a 1G Ohm"...''<ins class="diffchange diffchange-inline"></font color></ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Never use a strict voltage source if you can avoid it.  In LTspice, this can be as simple as filling in realistic values for a voltage source's parasitic resistance and capacitance (right mouse click on the source - advance for capacitance).  LTspice will automatically convert such sources into their Norton equivalent (save you having to do the calculation manually).</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Never use a strict voltage source if you can avoid it.  In LTspice, this can be as simple as filling in realistic values for a voltage source's parasitic resistance and capacitance (right mouse click on the source - advance for capacitance).  LTspice will automatically convert such sources into their Norton equivalent (save you having to do the calculation manually).</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>''...or "a current source in series of a 1 Ohm" for "equation-type" solving purposes.  However, it did not work all the time, either with the wrong value or convergence problem.  I did also try adding a capacitor after I read your models.  It seems to me adding a capacitor would not help.''</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><font color="grey"></ins>''...or "a current source in series of a 1 Ohm" for "equation-type" solving purposes.  However, it did not work all the time, either with the wrong value or convergence problem.  I did also try adding a capacitor after I read your models.  It seems to me adding a capacitor would not help.''<ins class="diffchange diffchange-inline"></font color></ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>This is either because of other stiff voltage type sources elsewhere within the circuit or because the solver failed when it was trying to find the dc operating point (during which all the capacitors are completely ignored).  The solver combats this by Gmin and/or source stepping (more on this later).</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>This is either because of other stiff voltage type sources elsewhere within the circuit or because the solver failed when it was trying to find the dc operating point (during which all the capacitors are completely ignored).  The solver combats this by Gmin and/or source stepping (more on this later).</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l21" >Line 21:</td>
<td colspan="2" class="diff-lineno">Line 21:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>In order to get good transient convergence, a good model should, as much as possible, contain elements with only voltage inputs and only current outputs (Norton equivalents should be used to produce voltage sources).  The only voltage sources should be zero volt sources used for current sensing.  It can't be stressed enough that stiff voltage sources (especially nonlinear behavioral types) are problematic because, unlike current sources and/or resistors, they will not yield to capacitances at small time steps during convergence difficulties in a transient analysis.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>In order to get good transient convergence, a good model should, as much as possible, contain elements with only voltage inputs and only current outputs (Norton equivalents should be used to produce voltage sources).  The only voltage sources should be zero volt sources used for current sensing.  It can't be stressed enough that stiff voltage sources (especially nonlinear behavioral types) are problematic because, unlike current sources and/or resistors, they will not yield to capacitances at small time steps during convergence difficulties in a transient analysis.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Whenever the simulator reduces the time step, it is because of nonlinear circuit behavior. The implicit assumption is that, as the time step is reduced, the various parasitic and stray capacitances will come to dominate the nonlinear bits (which don't depend on time).  At really small time steps, only the capacitances will matter and, since capacitances are linear, the circuit will converge and the simulator will be able to get past the nonlinear behavior.  Of course this can't work if the models omit the "parasitic" capacitances (and resistance).</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Whenever the simulator reduces the time step, it is because of nonlinear circuit behavior. <ins class="diffchange diffchange-inline"> </ins>The implicit assumption is that, as the time step is reduced, the various parasitic and stray capacitances will come to dominate the nonlinear bits (which don't depend on time).  At really small time steps, only the capacitances will matter and, since capacitances are linear, the circuit will converge and the simulator will be able to get past the nonlinear behavior.  Of course this can't work if the models omit the "parasitic" capacitances (and resistance).</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>To follow these rules means that p/n junctions (and other nonlinear element nodes) should never be without some series resistance and some parallel capacitance.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>To follow these rules means that p/n junctions (and other nonlinear element nodes) should never be without some series resistance and some parallel capacitance.</div></td></tr>
</table>Analogspicemanhttp://ltwiki.org/index.php?title=Convergence_problems%3F&diff=19&oldid=prevAnalogspiceman at 09:03, 7 August 20092009-08-07T09:03:43Z<p></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 09:03, 7 August 2009</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l1" >Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>''I have been trying to understand your models of PWM controllers.  You seem to use a BI current source in series of a capacitor very often. Can you please let me know why a capacitor is needed, and how you determine the capacitor value? Is it to help the convergence or to implement the pole of op amp? For example, the nodes of "hys", "latch", "Ierr" in UC3842A model you created, as attached.''</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>''I have been trying to understand your models of PWM controllers.  You seem to use a BI current source in series of a capacitor very often. <ins class="diffchange diffchange-inline"> </ins>Can you please let me know why a capacitor is needed, and how you determine the capacitor value? Is it to help the convergence or to implement the pole of op amp? <ins class="diffchange diffchange-inline"> </ins>For example, the nodes of "hys", "latch", "Ierr" in UC3842A model you created, as attached.''</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Whenever possible, I try to arrange a model so the capacitors do double duty, that is to both aid transient convergence and to provide some direct function (e.g., an opamp pole).</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Whenever possible, I try to arrange a model so the capacitors do double duty, that is to both aid transient convergence and to provide some direct function (e.g., an opamp pole).</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l5" >Line 5:</td>
<td colspan="2" class="diff-lineno">Line 5:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>''I am puzzled with the necessity of adding the capacitor (with various value) when converting a current to a voltage. I would think a current source in [parallel with a] 1 Ohm resistor is adequate.''</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>''I am puzzled with the necessity of adding the capacitor (with various value) when converting a current to a voltage. I would think a current source in [parallel with a] 1 Ohm resistor is adequate.''</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>This is fine for low frequencies and dc, but the capacitor is there to aid transient convergence in the face of behavior nonlinear enough to fall outside of the various error tolerance limits (to which the solver responds by reducing the time step). If the time steps go small enough, the capacitor will dominate the I/V behavior of any finite impedance (hence, the need to use current sources with parallel resistors rather than voltage sources). Since capacitors are linear devices, the behavior becomes linear and the solver can get through the highly nonlinear behavior zones by taking them in small steps.</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>This is fine for low frequencies and dc, but the capacitor is there to aid transient convergence in the face of behavior nonlinear enough to fall outside of the various error tolerance limits (to which the solver responds by reducing the time step). <ins class="diffchange diffchange-inline"> </ins>If the time steps go small enough, the capacitor will dominate the I/V behavior of any finite impedance (hence, the need to use current sources with parallel resistors rather than voltage sources). <ins class="diffchange diffchange-inline"> </ins>Since capacitors are linear devices, the behavior becomes linear and the solver can get through the highly nonlinear behavior zones by taking them in small steps.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>It is best to make a real circuit capacitance (perhaps a circuit parasitic) perform this duty, but, since the solver will go down to picoseconds, it is almost always possible to choose a capacitor that has absolutely no effect within the normal bandwidth of the circuit, yet still functions very well as a transient convergence aid.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>It is best to make a real circuit capacitance (perhaps a circuit parasitic) perform this duty, but, since the solver will go down to picoseconds, it is almost always possible to choose a capacitor that has absolutely no effect within the normal bandwidth of the circuit, yet still functions very well as a transient convergence aid.</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l11" >Line 11:</td>
<td colspan="2" class="diff-lineno">Line 11:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>''I always use either "a voltage source in series of a 1G Ohm"...''</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>''I always use either "a voltage source in series of a 1G Ohm"...''</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Never use a strict voltage source if you can avoid it. In LTspice, this can be as simple as filling in realistic values for a voltage source's parasitic resistance and capacitance (right mouse click on the source - advance for capacitance). LTspice will automatically convert such sources into their Norton equivalent (save you having to do the calculation manually).</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Never use a strict voltage source if you can avoid it. <ins class="diffchange diffchange-inline"> </ins>In LTspice, this can be as simple as filling in realistic values for a voltage source's parasitic resistance and capacitance (right mouse click on the source - advance for capacitance). <ins class="diffchange diffchange-inline"> </ins>LTspice will automatically convert such sources into their Norton equivalent (save you having to do the calculation manually).</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>''...or "a current source in series of a 1 Ohm" for "equation-type" solving purposes. However, it did not work all the time, either with the wrong value or convergence problem. I did also try adding a capacitor after I read your models. It seems to me adding a capacitor would not help.''</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>''...or "a current source in series of a 1 Ohm" for "equation-type" solving purposes. <ins class="diffchange diffchange-inline"> </ins>However, it did not work all the time, either with the wrong value or convergence problem. <ins class="diffchange diffchange-inline"> </ins>I did also try adding a capacitor after I read your models. <ins class="diffchange diffchange-inline"> </ins>It seems to me adding a capacitor would not help.''</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>This is either because of other stiff voltage type sources elsewhere within the circuit or because the solver failed when it was trying to find the dc operating point (during which all the capacitors are completely ignored). The solver combats this by Gmin and/or source stepping (more on this later).</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>This is either because of other stiff voltage type sources elsewhere within the circuit or because the solver failed when it was trying to find the dc operating point (during which all the capacitors are completely ignored). <ins class="diffchange diffchange-inline"> </ins>The solver combats this by Gmin and/or source stepping (more on this later).</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>As good as it is, LTspice is not magic, and the old maxim "garbage in - garbage out" still applies. Many, if not most, third party subcircuit models are poorly written (don't let a big company name fool you). In order to get good dc convergence, a good model should have all its I/V relationships be continuous with continuous derivatives.</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>As good as it is, LTspice is not magic, and the old maxim "garbage in - garbage out" still applies. <ins class="diffchange diffchange-inline"> </ins>Many, if not most, third party subcircuit models are poorly written (don't let a big company name fool you). <ins class="diffchange diffchange-inline"> </ins>In order to get good dc convergence, a good model should have all its I/V relationships be continuous with continuous derivatives.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>In order to get good transient convergence, a good model should, as much as possible, contain elements with only voltage inputs and only current outputs (Norton equivalents should be used to produce voltage sources). The only voltage sources should be zero volt sources used for current sensing. It can't be stressed enough that stiff voltage sources (especially nonlinear behavioral types) are problematic because, unlike current sources and/or resistors, they will not yield to capacitances at small time steps during convergence difficulties in a transient analysis.</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>In order to get good transient convergence, a good model should, as much as possible, contain elements with only voltage inputs and only current outputs (Norton equivalents should be used to produce voltage sources). <ins class="diffchange diffchange-inline"> </ins>The only voltage sources should be zero volt sources used for current sensing. <ins class="diffchange diffchange-inline"> </ins>It can't be stressed enough that stiff voltage sources (especially nonlinear behavioral types) are problematic because, unlike current sources and/or resistors, they will not yield to capacitances at small time steps during convergence difficulties in a transient analysis.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Whenever the simulator reduces the time step, it is because of nonlinear circuit behavior. The implicit assumption is that, as the time step is reduced, the various parasitic and stray capacitances will come to dominate the nonlinear bits (which don't depend on time). At really small time steps, only the capacitances will matter and, since capacitances are linear, the circuit will converge and the simulator will be able to get past the nonlinear behavior. Of course this can't work if the models omit the "parasitic" capacitances (and resistance).</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Whenever the simulator reduces the time step, it is because of nonlinear circuit behavior. The implicit assumption is that, as the time step is reduced, the various parasitic and stray capacitances will come to dominate the nonlinear bits (which don't depend on time). <ins class="diffchange diffchange-inline"> </ins>At really small time steps, only the capacitances will matter and, since capacitances are linear, the circuit will converge and the simulator will be able to get past the nonlinear behavior. <ins class="diffchange diffchange-inline"> </ins>Of course this can't work if the models omit the "parasitic" capacitances (and resistance).</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>To follow these rules means that p/n junctions (and other nonlinear element nodes) should never be without some series resistance and some parallel capacitance.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>To follow these rules means that p/n junctions (and other nonlinear element nodes) should never be without some series resistance and some parallel capacitance.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Now back to problems finding the dc operating point. When the direct Newton method fails the simulation goes through the process of GMIN stepping and then if that fails, it tries source stepping.  The source stepping algorithm makes uses the foreknowledge that a realistic simulation always will have a known starting solution when all its sources are set to zero (i.e. that all node voltages and branch currents are zero as well). It also takes advantage of the fact that most all nonlinear elements (e.g. diodes, MOSFETs, etc.) exhibit linear behavior locally around zero (all junctions are off and other nonlinearities are, by definition, operating with small signals).</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Now back to problems finding the dc operating point. <ins class="diffchange diffchange-inline"> </ins>When the direct Newton method fails the simulation goes through the process of GMIN stepping and then if that fails, it tries source stepping.  The source stepping algorithm makes uses the foreknowledge that a realistic simulation always will have a known starting solution when all its sources are set to zero (i.e. that all node voltages and branch currents are zero as well). <ins class="diffchange diffchange-inline"> </ins>It also takes advantage of the fact that most all nonlinear elements (e.g. diodes, MOSFETs, etc.) exhibit linear behavior locally around zero (all junctions are off and other nonlinearities are, by definition, operating with small signals).</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>So, by starting from a known linear solution (i.e., zero ) the solver can bootstrap itself up to the normal operating point by gradually ramping up all the sources. In theory each successful step along the way allows linearly extrapolating an almost perfect set of initial conditions for solving the succeeding nearby step.</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>So, by starting from a known linear solution (i.e., zero ) the solver can bootstrap itself up to the normal operating point by gradually ramping up all the sources. <ins class="diffchange diffchange-inline"> </ins>In theory each successful step along the way allows linearly extrapolating an almost perfect set of initial conditions for solving the succeeding nearby step.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Problems come when starting at zero doesn't yield a zero output.  For example, a behavioral error amp with a numeric reference voltage in a difference equation (i.e. "5-V(fb)") will go to 5V when all sources are at zero (LTspice actually has extended source stepping to B-sources to address this). Difficulties can also occur when ramping up through sharp corners or discontinuities in a nonlinear device's characteristic. Multiplying a trouble point by a unity node voltage (explained later) helps because it tends to tilt the solution trajectory slope closer to the expected path, thereby keeping it locally monotonic so it won't get stuck.</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Problems come when starting at zero doesn't yield a zero output.  For example, a behavioral error amp with a numeric reference voltage in a difference equation (i.e. "5-V(fb)") will go to 5V when all sources are at zero (LTspice actually has extended source stepping to B-sources to address this). <ins class="diffchange diffchange-inline"> </ins>Difficulties can also occur when ramping up through sharp corners or discontinuities in a nonlinear device's characteristic. <ins class="diffchange diffchange-inline"> </ins>Multiplying a trouble point by a unity node voltage (explained later) helps because it tends to tilt the solution trajectory slope closer to the expected path, thereby keeping it locally monotonic so it won't get stuck.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Also, bear in mind that a simulated circuit may have several numerically valid dc solutions, only one of which usually corresponds to the real circuit's natural solution. If an ac analysis produces wildly unexpected results, it may be due to an improper dc solution.  Just because you don't get a dc convergence error message, don't assume all must be well - run a .op and check some of the numbers.</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Also, bear in mind that a simulated circuit may have several numerically valid dc solutions, only one of which usually corresponds to the real circuit's natural solution. <ins class="diffchange diffchange-inline"> </ins>If an ac analysis produces wildly unexpected results, it may be due to an improper dc solution.  Just because you don't get a dc convergence error message, don't assume all must be well - run a .op and check some of the numbers.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>If you are having dc solution problems, first examine your simulation circuit for behavioral sources or other devices that may go highly nonlinear as the sources are stepped up from zero.  Splitting a very nonlinear element into several pieces across several nodes can sometimes dilute the problematic behavior to the point where the solver no longer gets hung up on one very bad element.  In such cases, adding more nodes can actually make the simulation run much faster.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>If you are having dc solution problems, first examine your simulation circuit for behavioral sources or other devices that may go highly nonlinear as the sources are stepped up from zero.  Splitting a very nonlinear element into several pieces across several nodes can sometimes dilute the problematic behavior to the point where the solver no longer gets hung up on one very bad element.  In such cases, adding more nodes can actually make the simulation run much faster.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>If not already available somewhere in the circuit, a unity node may be created by setting up an isolated dc voltage source equal to one volt. Clearly, any b-source expression may be multiplied by the voltage on this node as many times as needed without changing the value of the expression during an analysis. The only effect on such an expression occurs during source stepping while seeking the dc operating point. Then, as this unity node is reduced to near zero, anything multiplied by it is also forced to approach zero.</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>If not already available somewhere in the circuit, a unity node may be created by setting up an isolated dc voltage source equal to one volt. <ins class="diffchange diffchange-inline"> </ins>Clearly, any b-source expression may be multiplied by the voltage on this node as many times as needed without changing the value of the expression during an analysis. <ins class="diffchange diffchange-inline"> </ins>The only effect on such an expression occurs during source stepping while seeking the dc operating point. <ins class="diffchange diffchange-inline"> </ins>Then, as this unity node is reduced to near zero, anything multiplied by it is also forced to approach zero.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Differencing circuits with a lot of dc and gain are always good candidates for the unity node treatment as are abrupt limiters. Behavioral expressions with node voltages in their denominators such that when the sources go to zero, the expressions blow up (something gone small / something gone to zero => infinity) can be especially troublesome. These types of expressions can be multiplied by the unity node raised to whatever power required to make them behave.</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Differencing circuits with a lot of dc and gain are always good candidates for the unity node treatment as are abrupt limiters. <ins class="diffchange diffchange-inline"> </ins>Behavioral expressions with node voltages in their denominators such that when the sources go to zero, the expressions blow up (something gone small / something gone to zero => infinity) can be especially troublesome. <ins class="diffchange diffchange-inline"> </ins>These types of expressions can be multiplied by the unity node raised to whatever power required to make them behave.</div></td></tr>
</table>Analogspicemanhttp://ltwiki.org/index.php?title=Convergence_problems%3F&diff=18&oldid=prevAnalogspiceman: Created page with '''I have been trying to understand your models of PWM controllers. You seem to use a BI current source in series of a capacitor very often. Can you please let me know why a capa…'2009-08-07T08:59:48Z<p>Created page with '''I have been trying to understand your models of PWM controllers. You seem to use a BI current source in series of a capacitor very often. Can you please let me know why a capa…'</p>
<p><b>New page</b></p><div>''I have been trying to understand your models of PWM controllers. You seem to use a BI current source in series of a capacitor very often. Can you please let me know why a capacitor is needed, and how you determine the capacitor value? Is it to help the convergence or to implement the pole of op amp? For example, the nodes of "hys", "latch", "Ierr" in UC3842A model you created, as attached.''<br />
<br />
Whenever possible, I try to arrange a model so the capacitors do double duty, that is to both aid transient convergence and to provide some direct function (e.g., an opamp pole).<br />
<br />
''I am puzzled with the necessity of adding the capacitor (with various value) when converting a current to a voltage. I would think a current source in [parallel with a] 1 Ohm resistor is adequate.''<br />
<br />
This is fine for low frequencies and dc, but the capacitor is there to aid transient convergence in the face of behavior nonlinear enough to fall outside of the various error tolerance limits (to which the solver responds by reducing the time step). If the time steps go small enough, the capacitor will dominate the I/V behavior of any finite impedance (hence, the need to use current sources with parallel resistors rather than voltage sources). Since capacitors are linear devices, the behavior becomes linear and the solver can get through the highly nonlinear behavior zones by taking them in small steps.<br />
<br />
It is best to make a real circuit capacitance (perhaps a circuit parasitic) perform this duty, but, since the solver will go down to picoseconds, it is almost always possible to choose a capacitor that has absolutely no effect within the normal bandwidth of the circuit, yet still functions very well as a transient convergence aid.<br />
<br />
''I always use either "a voltage source in series of a 1G Ohm"...''<br />
<br />
Never use a strict voltage source if you can avoid it. In LTspice, this can be as simple as filling in realistic values for a voltage source's parasitic resistance and capacitance (right mouse click on the source - advance for capacitance). LTspice will automatically convert such sources into their Norton equivalent (save you having to do the calculation manually).<br />
<br />
''...or "a current source in series of a 1 Ohm" for "equation-type" solving purposes. However, it did not work all the time, either with the wrong value or convergence problem. I did also try adding a capacitor after I read your models. It seems to me adding a capacitor would not help.''<br />
<br />
This is either because of other stiff voltage type sources elsewhere within the circuit or because the solver failed when it was trying to find the dc operating point (during which all the capacitors are completely ignored). The solver combats this by Gmin and/or source stepping (more on this later).<br />
<br />
As good as it is, LTspice is not magic, and the old maxim "garbage in - garbage out" still applies. Many, if not most, third party subcircuit models are poorly written (don't let a big company name fool you). In order to get good dc convergence, a good model should have all its I/V relationships be continuous with continuous derivatives.<br />
<br />
In order to get good transient convergence, a good model should, as much as possible, contain elements with only voltage inputs and only current outputs (Norton equivalents should be used to produce voltage sources). The only voltage sources should be zero volt sources used for current sensing. It can't be stressed enough that stiff voltage sources (especially nonlinear behavioral types) are problematic because, unlike current sources and/or resistors, they will not yield to capacitances at small time steps during convergence difficulties in a transient analysis.<br />
<br />
Whenever the simulator reduces the time step, it is because of nonlinear circuit behavior. The implicit assumption is that, as the time step is reduced, the various parasitic and stray capacitances will come to dominate the nonlinear bits (which don't depend on time). At really small time steps, only the capacitances will matter and, since capacitances are linear, the circuit will converge and the simulator will be able to get past the nonlinear behavior. Of course this can't work if the models omit the "parasitic" capacitances (and resistance).<br />
<br />
To follow these rules means that p/n junctions (and other nonlinear element nodes) should never be without some series resistance and some parallel capacitance.<br />
<br />
Now back to problems finding the dc operating point. When the direct Newton method fails the simulation goes through the process of GMIN stepping and then if that fails, it tries source stepping. The source stepping algorithm makes uses the foreknowledge that a realistic simulation always will have a known starting solution when all its sources are set to zero (i.e. that all node voltages and branch currents are zero as well). It also takes advantage of the fact that most all nonlinear elements (e.g. diodes, MOSFETs, etc.) exhibit linear behavior locally around zero (all junctions are off and other nonlinearities are, by definition, operating with small signals).<br />
<br />
So, by starting from a known linear solution (i.e., zero ) the solver can bootstrap itself up to the normal operating point by gradually ramping up all the sources. In theory each successful step along the way allows linearly extrapolating an almost perfect set of initial conditions for solving the succeeding nearby step.<br />
<br />
Problems come when starting at zero doesn't yield a zero output. For example, a behavioral error amp with a numeric reference voltage in a difference equation (i.e. "5-V(fb)") will go to 5V when all sources are at zero (LTspice actually has extended source stepping to B-sources to address this). Difficulties can also occur when ramping up through sharp corners or discontinuities in a nonlinear device's characteristic. Multiplying a trouble point by a unity node voltage (explained later) helps because it tends to tilt the solution trajectory slope closer to the expected path, thereby keeping it locally monotonic so it won't get stuck.<br />
<br />
Also, bear in mind that a simulated circuit may have several numerically valid dc solutions, only one of which usually corresponds to the real circuit's natural solution. If an ac analysis produces wildly unexpected results, it may be due to an improper dc solution. Just because you don't get a dc convergence error message, don't assume all must be well - run a .op and check some of the numbers.<br />
<br />
If you are having dc solution problems, first examine your simulation circuit for behavioral sources or other devices that may go highly nonlinear as the sources are stepped up from zero. Splitting a very nonlinear element into several pieces across several nodes can sometimes dilute the problematic behavior to the point where the solver no longer gets hung up on one very bad element. In such cases, adding more nodes can actually make the simulation run much faster.<br />
<br />
If not already available somewhere in the circuit, a unity node may be created by setting up an isolated dc voltage source equal to one volt. Clearly, any b-source expression may be multiplied by the voltage on this node as many times as needed without changing the value of the expression during an analysis. The only effect on such an expression occurs during source stepping while seeking the dc operating point. Then, as this unity node is reduced to near zero, anything multiplied by it is also forced to approach zero.<br />
<br />
Differencing circuits with a lot of dc and gain are always good candidates for the unity node treatment as are abrupt limiters. Behavioral expressions with node voltages in their denominators such that when the sources go to zero, the expressions blow up (something gone small / something gone to zero => infinity) can be especially troublesome. These types of expressions can be multiplied by the unity node raised to whatever power required to make them behave.</div>Analogspiceman