This shows you the differences between two versions of the page.
|
gnucap:manual:commands:dc [2023/01/31 08:51] felixs add parameter sweeps, marked as "soon" |
gnucap:manual:commands:dc [2025/11/20 04:10] (current) felixs update, parameter sweeps, mention pipe |
||
|---|---|---|---|
| Line 3: | Line 3: | ||
| ===== Purpose ===== | ===== Purpose ===== | ||
| - | Performs a nonlinear DC steady state analysis, and sweeps the signal input, or a component value or (soon) a parameter value. Components must be of type "element", such as voltage/current sources and resistors. | + | Performs a nonlinear DC steady state analysis, and sweeps the signal input, a component value or a parameter value. Components must be of type "element", such as voltage/current sources and resistors. Sweeping parameters that are used to control expansion (binning or generate) will not trigger re-expansion, and hence might lead to unexpected results. |
| ===== Syntax ===== | ===== Syntax ===== | ||
| Line 10: | Line 10: | ||
| dc label start stop stepsize {options ...} | dc label start stop stepsize {options ...} | ||
| dc param start stop stepsize {options ...} | dc param start stop stepsize {options ...} | ||
| + | dc param1 start1 stop1 stepsize1 param2 start2 stop2 stepsize2 [..] {options ...} | ||
| + | |||
| ===== Comments ===== | ===== Comments ===== | ||
| Line 25: | Line 26: | ||
| The program will sweep any simple component, including resistors, capacitors, and controlled sources. SPICE sweeps only fixed sources (types V and I). | The program will sweep any simple component, including resistors, capacitors, and controlled sources. SPICE sweeps only fixed sources (types V and I). | ||
| - | This command will sweep up to 4 component values or parameters (soon), nested. | + | This command will sweep up to 4 component values or parameters, nested. Modify s_dc.cc if you need more. |
| - | (Soon:) Sweeping parameters may be noticeably slower than an equivalent element sweep, as all parameters are re-evaluated before each step. Time used is added to the setup function timer (cf. [[gnucap:manual:commands:status|status]]). | + | Sweeping parameters may be noticeably slower than an equivalent element sweep, as all parameters are re-evaluated before each step. Time used is added to the setup function timer (cf. [[gnucap:manual:commands:status|status]]). |
| The original models of the sweep component(s) and parameter values will be restored after the simulation has been completed. | The original models of the sweep component(s) and parameter values will be restored after the simulation has been completed. | ||
| + | |||
| + | A subprocess can be a shell commmand with arguments. Use '{' and '}' to delimit the command string. | ||
| ===== Options ===== | ===== Options ===== | ||
| Line 45: | Line 48: | ||
| |> //file// |Send results of analysis to file. | | |> //file// |Send results of analysis to file. | | ||
| |>> //file// |Append results to file. | | |>> //file// |Append results to file. | | ||
| + | || //command//|Pipe output to a subprocess, eg. convert to CSV| | ||
| |noplot |Suppress plotting. | | |noplot |Suppress plotting. | | ||
| |plot |Graphic output, when plotting is normally off. | | |plot |Graphic output, when plotting is normally off. | | ||
| Line 74: | Line 78: | ||
| dc temperature=75 | dc temperature=75 | ||
| Simulate at 75 degrees, this time. Since we didn't specify new sweep parameters, do the same as last time. (Without the loop.) | Simulate at 75 degrees, this time. Since we didn't specify new sweep parameters, do the same as last time. (Without the loop.) | ||
| + | dc a 0 1 .5 b 0 1 .5 | { sed -e 's/ \+$//' -e 's/\([^ ]\) /\1, /g' } | ||
| + | Sweep a and b, display as CSV. | ||