<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent changes to 33: Parametric Sweep NgSpice</title><link href="https://sourceforge.net/p/ngspice/feature-requests/33/" rel="alternate"/><link href="https://sourceforge.net/p/ngspice/feature-requests/33/feed.atom" rel="self"/><id>https://sourceforge.net/p/ngspice/feature-requests/33/</id><updated>2021-01-12T12:02:57.416000Z</updated><subtitle>Recent changes to 33: Parametric Sweep NgSpice</subtitle><entry><title>#33 Parametric Sweep NgSpice</title><link href="https://sourceforge.net/p/ngspice/feature-requests/33/?limit=25#9a13" rel="alternate"/><published>2021-01-12T12:02:57.416000Z</published><updated>2021-01-12T12:02:57.416000Z</updated><author><name>Ferdy</name><uri>https://sourceforge.net/u/ferhue/</uri></author><id>https://sourceforge.net5516e25c896820b981f2f62e24813702914c35d3</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Could this ticket be reopened? It would be quite helpful to do a parametric DC sweep in the same way than PSPICE does:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;.DC LIN PARAM Ik 1p 400p 1p&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;This would be needed to facilitate the KiCad ngspice integration, see discussion: &lt;a href="https://gitlab.com/kicad/code/kicad/-/merge_requests/564#note_481539302" rel="nofollow"&gt;https://gitlab.com/kicad/code/kicad/-/merge_requests/564#note_481539302&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>#33 Parametric Sweep NgSpice</title><link href="https://sourceforge.net/p/ngspice/feature-requests/33/?limit=25#1309" rel="alternate"/><published>2018-06-29T20:00:25.990000Z</published><updated>2018-06-29T20:00:25.990000Z</updated><author><name>Holger Vogt</name><uri>https://sourceforge.net/u/userid-2045894/</uri></author><id>https://sourceforge.netcb3fcbf32aeb5d8b8ceb9fcff8d5cbf289cc9497</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;status&lt;/strong&gt;: open --&amp;gt; closed&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;assigned_to&lt;/strong&gt;: Holger Vogt&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;</summary></entry><entry><title>#33 Parametric Sweep NgSpice</title><link href="https://sourceforge.net/p/ngspice/feature-requests/33/?limit=25#dcbf" rel="alternate"/><published>2018-06-29T19:59:54.582000Z</published><updated>2018-06-29T19:59:54.582000Z</updated><author><name>Holger Vogt</name><uri>https://sourceforge.net/u/userid-2045894/</uri></author><id>https://sourceforge.netc4e4aa8458067316ff461193b098ee47e76868f9</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Command 'alterparam' to alter (and sweep) parameters is available in ngspice-28.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>#33 Parametric Sweep NgSpice</title><link href="https://sourceforge.net/p/ngspice/feature-requests/33/?limit=25#6a15/2bf9" rel="alternate"/><published>2016-05-03T20:58:31.320000Z</published><updated>2016-05-03T20:58:31.320000Z</updated><author><name>Holger Vogt</name><uri>https://sourceforge.net/u/userid-2045894/</uri></author><id>https://sourceforge.netb721127df8a33f6afedcd48ec5ec34b6509e66c2</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;You may use alter or altermod in subcircuits (manual, at the end of Chapt. 17.5.3).&lt;/p&gt;
&lt;p&gt;After loading the circuit, use the command 'listing expand' (or 'listing expand &amp;gt; listtext.txt', if you want to put the output into a file listtext.txt). Then you may have a look at the subcircuits, how they are expanded, and what names to use in the alter command.&lt;/p&gt;
&lt;p&gt;Holger&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>#33 Parametric Sweep NgSpice</title><link href="https://sourceforge.net/p/ngspice/feature-requests/33/?limit=25#6a15" rel="alternate"/><published>2016-05-01T19:48:07.122000Z</published><updated>2016-05-01T19:48:07.122000Z</updated><author><name>Franz Zinn</name><uri>https://sourceforge.net/u/franzzinn/</uri></author><id>https://sourceforge.netdd09dd9deeb267bc0c99e64133bf5d03164f5107</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Will this feature also support subcircuit parameter sweeps ? If possible kindly support this too. "alter" and "altermod" can not be used for this purpose. &lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>#33 Parametric Sweep NgSpice</title><link href="https://sourceforge.net/p/ngspice/feature-requests/33/?limit=25#46c3" rel="alternate"/><published>2015-11-14T15:18:38.153000Z</published><updated>2015-11-14T15:18:38.153000Z</updated><author><name>Holger Vogt</name><uri>https://sourceforge.net/u/userid-2045894/</uri></author><id>https://sourceforge.netb8e90cb068109751274fad36b7b68ac56bef54c6</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;please have a look at manual chapter &lt;br/&gt;
16.13.4.2 .step&lt;/p&gt;
&lt;p&gt;Holger&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>#33 Parametric Sweep NgSpice</title><link href="https://sourceforge.net/p/ngspice/feature-requests/33/?limit=25#f9b4" rel="alternate"/><published>2015-11-13T14:21:54.895000Z</published><updated>2015-11-13T14:21:54.895000Z</updated><author><name>Hardy Leonardo da Cunha Pereira</name><uri>https://sourceforge.net/u/realtico/</uri></author><id>https://sourceforge.net0cd39fbe02508093aa319324d37e011819d4512d</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I would also like to have this parameter change method. It is interesting when you have to test the behaviour of a trimmer or a trimpot in a filter circuit (like an graphic equalizer, for example).&lt;/p&gt;
&lt;p&gt;I can use the alter command and the only problem is that the script will be longer and more prone to mistakes. The bad part about this is that you can´t save vectors between runs (with different names) so you can plot them stacked for comparison reasons. Almost all simulators have this feature.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>#33 Parametric Sweep NgSpice</title><link href="https://sourceforge.net/p/ngspice/feature-requests/33/?limit=25#7276" rel="alternate"/><published>2014-05-03T13:52:07.012000Z</published><updated>2014-05-03T13:52:07.012000Z</updated><author><name>marcel hendrix</name><uri>https://sourceforge.net/u/userid-1302892/</uri></author><id>https://sourceforge.net59bd8b32f93ca4e86ea12d7534178e935758a317</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;It ain't pretty ...&lt;br /&gt;
The main problem was that ALTER changes the device directly, you&lt;br /&gt;
don't need to go through the parameter. Also, the alpha_T in the &lt;br /&gt;
control loop can't be a parameter because a control section &lt;br /&gt;
is a third interpreter layer :-E&lt;/p&gt;
&lt;p&gt;I didn't make it plot, sorry. You probably will need to read in &lt;br /&gt;
the diskfile again, assign the scale/value columns to variables, &lt;br /&gt;
and then plot. &lt;/p&gt;
&lt;p&gt;Note that diskfile contains paired scale/value columns. The actual&lt;br /&gt;
value of the scales is a bit mysterious, maybe somebody else can&lt;br /&gt;
explain.&lt;/p&gt;
&lt;p&gt;-marcel&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;Test sweeping

Vin 1 0 1
R1  1 2 1k
R2  2 0 200
.tran 1ms 10ms

.control
 let start_T = 20
 let stop_T  = 30
 let delta_T = 1
 let T_act   = start_T
 let alpha_T = -0.001
 let new_R   = 200

 while T_act le stop_T
     let new_R = 200 * (1 + alpha_T * T_act)
     alter r2 new_R
     run
     wrdata sweepT.out v(2) v(1) T_act new_R
     set appendwrite
     let T_act = T_act + delta_T
 end
asciiplot v(2) v(1)
.endc

.end
&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;</summary></entry><entry><title>#33 Parametric Sweep NgSpice</title><link href="https://sourceforge.net/p/ngspice/feature-requests/33/?limit=25#536d" rel="alternate"/><published>2014-05-03T09:44:27.143000Z</published><updated>2014-05-03T09:44:27.143000Z</updated><author><name>Michael</name><uri>https://sourceforge.net/u/fadinaderzaki/</uri></author><id>https://sourceforge.net1e36e7ad637be9cadec1e744fc6baacc1fa96f6a</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thank you Marcel&lt;/p&gt;
&lt;p&gt;I tried Let and Alter&lt;/p&gt;
&lt;p&gt;VDin 1 0 1&lt;br /&gt;
R1 1 2 1k&lt;br /&gt;
R2 2 0 r={200*(1+alpha_T * T)}&lt;br /&gt;
.tran 1ms 10ms&lt;/p&gt;
&lt;p&gt;.control&lt;br /&gt;
let start_T = 20&lt;br /&gt;
let stop_T = 30&lt;br /&gt;
let delta_T = 1&lt;br /&gt;
let T_act = start_T&lt;br /&gt;
*loop&lt;br /&gt;
while T_act le stop_T&lt;br /&gt;
  alter T T_act&lt;br /&gt;
  run&lt;br /&gt;
  wrdata sweepT.out v(2) v(1) T_act&lt;br /&gt;
  set appendwrite&lt;br /&gt;
  let T_act = T_act + delta_T&lt;br /&gt;
end&lt;br /&gt;
plot v(2) v(1)&lt;br /&gt;
.endc&lt;br /&gt;
.end&lt;br /&gt;
but this code didn't work cause the values wasn't right in the file sweepT and when i tried to plot the T_act, i got an error "T_act isn't a vector"&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>#33 Parametric Sweep NgSpice</title><link href="https://sourceforge.net/p/ngspice/feature-requests/33/?limit=25#1c87" rel="alternate"/><published>2014-05-03T09:08:43.337000Z</published><updated>2014-05-03T09:08:43.337000Z</updated><author><name>marcel hendrix</name><uri>https://sourceforge.net/u/userid-1302892/</uri></author><id>https://sourceforge.netfa8ae9b0a65035c231e9021c896f54ce63d75bad</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Did you look at LET and ALTER in the manual? &lt;/p&gt;
&lt;p&gt;-marcel&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>