<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent posts to Discussion</title><link>https://sourceforge.net/p/ngspice/discussion/</link><description>Recent posts to Discussion</description><atom:link href="https://sourceforge.net/p/ngspice/discussion/feed.rss" rel="self"/><language>en</language><lastBuildDate>Thu, 23 Apr 2026 20:01:29 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/ngspice/discussion/feed.rss" rel="self" type="application/rss+xml"/><item><title>Uncertain on the results of coupled inductor simulation with initial values</title><link>https://sourceforge.net/p/ngspice/discussion/120973/thread/8fe047623d/?limit=250#3535/0209</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;A 5th order integration method (like PLECS is using) needs 4 initial derivatives in addition to the initial value itself. IIRC, SPICE does a number of steps (with a low order integrator) to approximate these derivatives. This approximation will be inaccurate, and anyway there is no guarantee that the values are what the user &lt;em&gt;intended&lt;/em&gt;. However, I think it reasonable to expect that SPICE-based simulators will show the same result.  With SIMPWL I know for sure that it does not need unknown derivatives. However, PLECS, like SIMPWL, claims to be state-space based but gives a wildly different result.&lt;/p&gt;
&lt;p&gt;The circuit has indeed additional problems: there is a cutset of currents, one of the 3 inductor currents is dependent on the others. I don't think a SPICE simulator will invest the time to find out which is the dependent and which are the independent variables, and modify the matrices so that the initial values line up with the independents (if it is  possible with MNA at all).&lt;/p&gt;
&lt;p&gt;The example is indeed contrived (unless we are building an HV generator) but I like to know the limits of my tools. &lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">marcel hendrix</dc:creator><pubDate>Thu, 23 Apr 2026 20:01:29 -0000</pubDate><guid>https://sourceforge.netbdad43b4c7986de17e0b4f978731a55e25b2419c</guid></item><item><title>Uncertain on the results of coupled inductor simulation with initial values</title><link>https://sourceforge.net/p/ngspice/discussion/120973/thread/8fe047623d/?limit=25#3535</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Might check that mutuals are sane. I have had trouble in&lt;br/&gt;
other simulators in other times, trying to do complex &lt;br/&gt;
couplings (without clue) and evidently there's some &lt;br/&gt;
stuff about making sure matrices are sparse and the&lt;br/&gt;
k values rolled up, still sub-unity (?).&lt;/p&gt;
&lt;p&gt;I just gave up trying to model bond wire k couplings.&lt;br/&gt;
C, OK. L,OK. &lt;/p&gt;
&lt;p&gt;Anyway, different simulators might respond to the&lt;br/&gt;
physically impossible in various ways. I'd dig there&lt;br/&gt;
first, "why?". Then maybe run a "settling" tran job &lt;br/&gt;
to get to a DC-stable or cyclic-stable IC that maybe&lt;br/&gt;
is more solvable (rather than NaN-precursor, like).&lt;/p&gt;
&lt;p&gt;I don't think initial conditions which are jacked, make&lt;br/&gt;
any simulator's job easier. Maybe just provoke different&lt;br/&gt;
paths to failure. &lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">dick freebird</dc:creator><pubDate>Thu, 23 Apr 2026 18:27:50 -0000</pubDate><guid>https://sourceforge.net3813467dc1aab674b8f00b7e2e8430302c9a6ed7</guid></item><item><title>Uncertain on the results of coupled inductor simulation with initial values</title><link>https://sourceforge.net/p/ngspice/discussion/120973/thread/8fe047623d/?limit=250#fb47/8958</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Thanks, Felix!&lt;/p&gt;
&lt;p&gt;I'll ponder gnucap's documentation.&lt;br/&gt;
BTW, I tried OpenModelica and SIMBA (demo version) just now. Modelica is a monster that I can not make sense off. SIMBA gave an interesting result. The initial values are obeyed but neither the frequency nor the damping are correct.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">marcel hendrix</dc:creator><pubDate>Wed, 22 Apr 2026 11:22:48 -0000</pubDate><guid>https://sourceforge.net32c38052dce159f3c4898b370e86b6786458689f</guid></item><item><title>Uncertain on the results of coupled inductor simulation with initial values</title><link>https://sourceforge.net/p/ngspice/discussion/120973/thread/8fe047623d/?limit=25#fb47</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;see &lt;a href="http://gnucap.org/dokuwiki/doku.php/gnucap:manual:tech:spice2verilog?s" rel="nofollow"&gt;http://gnucap.org/dokuwiki/doku.php/gnucap:manual:tech:spice2verilog?s&lt;/a&gt;[]=uic#algorithmic_peculiarities&lt;/p&gt;
&lt;p&gt;tl;dr; The issue is somewhere between model specification and simulation algorithm. The way Spice implements UIC makes no physical sense in general (cf. the currents at time 0). Particularly, (spice, ngspice) UIC was not originally intended for the purpose shown here.&lt;/p&gt;
&lt;p&gt;NB: Other simulators may do different things. Not rocket science, but at the cost of losing Spice compatibility.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Felix</dc:creator><pubDate>Wed, 22 Apr 2026 09:43:11 -0000</pubDate><guid>https://sourceforge.net16920d5ee8f448d5e1250c0c36e75de184de7f72</guid></item><item><title>Uncertain on the results of coupled inductor simulation with initial values</title><link>https://sourceforge.net/p/ngspice/discussion/120973/thread/8fe047623d/?limit=250#5637</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;I am struggling with the simulation of a coupled inductor when initial values are specified.&lt;br/&gt;
By now I did the same simulation (see attachment) in NGSPICE, LTspice, PLECS, and SIMPWL, with four rather different outcomes.&lt;br/&gt;
The LTspice result is clearly completely wrong. It simply does not obey the IC=... specification when using .TRAN with the UIC option. At least the sum of the three inductor currents is 0, as it must be. &lt;br/&gt;
NGSPICE &lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">marcel hendrix</dc:creator><pubDate>Tue, 21 Apr 2026 19:12:05 -0000</pubDate><guid>https://sourceforge.netc5e0bf986e90df389cb8ec130b8c0d2aa6a22823</guid></item><item><title>Measure RMS current of inductor in SPICE</title><link>https://sourceforge.net/p/ngspice/discussion/120973/thread/76e100d705/?limit=25#8fea/a9a4</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Thank you for your response. Following is the result from SPICE,&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;Note: Compatibility modes selected: ps lt a

Circuit: 

Doing analysis at TEMP = 27.000000 and TNOM = 27.000000

Using SPARSE 1.3 as Direct Linear Solver
Operating point simulation skipped by 'uic',
  now using transient initial conditions.

Warning: command 'plot' is not available during batch simulation, ignored!
    You may use Gnuplot instead.

No. of Data Rows : 10011
irms                =  6.35351e+00 from=  1.00000e-08 to=  1.00000e-02
irms = 6.353514e+00
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I got best result. You are great! Thank you again!&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Hai Yang</dc:creator><pubDate>Fri, 10 Apr 2026 19:59:23 -0000</pubDate><guid>https://sourceforge.netacb5b6a3d524ecb0f75dbf35b29fc51477d8b014</guid></item><item><title>Measure RMS current of inductor in SPICE</title><link>https://sourceforge.net/p/ngspice/discussion/120973/thread/76e100d705/?limit=25#842c/be77/f7c6</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Thank you for your response. I am pretty new to SPICE. I am going to try UIC&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Hai Yang</dc:creator><pubDate>Fri, 10 Apr 2026 19:56:27 -0000</pubDate><guid>https://sourceforge.net0c4da536863f8bec5e6085dbc2d334ff2cba393e</guid></item><item><title>Measure RMS current of inductor in SPICE</title><link>https://sourceforge.net/p/ngspice/discussion/120973/thread/76e100d705/?limit=25#842c/dc48</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Thank you for your response. You are genius. I modified my netlist, and increase the length to 4 second. The result get much better.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="err"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;Inductor&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="no"&gt;RMS&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="no"&gt;current&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="no"&gt;measurement&lt;/span&gt;
&lt;span class="nf"&gt;V1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="no"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="no"&gt;SIN&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;282&lt;/span&gt;&lt;span class="no"&gt;.28&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;R1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="no"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="no"&gt;n1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="no"&gt;.10&lt;/span&gt;
&lt;span class="nf"&gt;L1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="no"&gt;n1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="no"&gt;mH&lt;/span&gt;

&lt;span class="na"&gt;.tran&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="no"&gt;.2ms&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;4000&lt;/span&gt;&lt;span class="no"&gt;ms&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="no"&gt;ms&lt;/span&gt;

&lt;span class="na"&gt;.control&lt;/span&gt;
&lt;span class="nf"&gt;run&lt;/span&gt;
&lt;span class="nf"&gt;meas&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="no"&gt;tran&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="no"&gt;Irms&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="no"&gt;RMS&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="no"&gt;i&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;L1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="no"&gt;from&lt;/span&gt;&lt;span class="err"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;2000&lt;/span&gt;&lt;span class="no"&gt;ms&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="no"&gt;to&lt;/span&gt;&lt;span class="err"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;3000&lt;/span&gt;&lt;span class="no"&gt;ms&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="no"&gt;Irms&lt;/span&gt;
&lt;span class="na"&gt;.endc&lt;/span&gt;
&lt;span class="na"&gt;.end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Following is the result,&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;Note: Compatibility modes selected: ps lt a

Circuit: 

Doing analysis at TEMP = 27.000000 and TNOM = 27.000000

Using SPARSE 1.3 as Direct Linear Solver

Initial Transient Solution
--------------------------
Node                                   Voltage
----                                   -------
in                                           0
n1                                           0
l1#branch                                    0
v1#branch                                    0

No. of Data Rows : 15001
irms                =  6.40150e+00 from=  2.00000e+00 to=  3.00000e+00
irms = 6.401500e+00
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;You save me a lot of time. Thank you again!&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Hai Yang</dc:creator><pubDate>Fri, 10 Apr 2026 19:45:56 -0000</pubDate><guid>https://sourceforge.netd6589daa19bd07f760ecc7b96ae7d67e0f790162</guid></item><item><title>Measure RMS current of inductor in SPICE</title><link>https://sourceforge.net/p/ngspice/discussion/120973/thread/76e100d705/?limit=25#8e3e/bfbd</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Thank you for your response, For this circuit, the theorical calculation value is, 6.37A. The margin of error is too high. I modified my netlist, and got a better result from SPICE.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Hai Yang</dc:creator><pubDate>Fri, 10 Apr 2026 19:38:48 -0000</pubDate><guid>https://sourceforge.net75d6170762519f3546cd99974c6a30ae826642e8</guid></item><item><title>Measure RMS current of inductor in SPICE</title><link>https://sourceforge.net/p/ngspice/discussion/120973/thread/76e100d705/?limit=25#8fea</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Use initial conditions:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="err"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;Inductor&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="no"&gt;RMS&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="no"&gt;current&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="no"&gt;measurement&lt;/span&gt;
&lt;span class="nf"&gt;V1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="no"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="no"&gt;SIN&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;282&lt;/span&gt;&lt;span class="no"&gt;.28&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;R1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="no"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="no"&gt;n1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="no"&gt;.10&lt;/span&gt;
&lt;span class="nf"&gt;L1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="no"&gt;n1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="no"&gt;mH&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="no"&gt;ic&lt;/span&gt;&lt;span class="err"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;-9&lt;/span&gt;

&lt;span class="na"&gt;.tran&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="no"&gt;us&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="no"&gt;uic&lt;/span&gt;

&lt;span class="na"&gt;.control&lt;/span&gt;
&lt;span class="nf"&gt;run&lt;/span&gt;
&lt;span class="nf"&gt;plot&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="no"&gt;i&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;L1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;meas&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="no"&gt;tran&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="no"&gt;Irms&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="no"&gt;RMS&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="no"&gt;i&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;L1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="no"&gt;Irms&lt;/span&gt;
&lt;span class="na"&gt;.endc&lt;/span&gt;
&lt;span class="na"&gt;.end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Holger Vogt</dc:creator><pubDate>Fri, 10 Apr 2026 16:20:06 -0000</pubDate><guid>https://sourceforge.netab74ac3977b9be0d70b156366e1b2a688ed30e3b</guid></item></channel></rss>