ngspice: enable .dc current, temperature and resistance sweeps

Bug #1821460 reported by Holger Vogt
26
This bug affects 4 people
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Unknown

Bug Description

This is an extension to report https://bugs.launchpad.net/kicad/+bug/1786126

The .dc command in ngspice (in addition to sweeping a voltage) allows sweeping the current of a current source that is in the netlist, the temperature of the simulation or sweeping the value of a resistor that is in the netlist.

The command for sweeping the temperature is
.dc TEMP -15 75 5
During simulation a scale (x axis) vector temp-sweep is generated, which is used for plotting.

Combining the temperature sweep with another sweep is possible, e.g.
.dc V1 0 5 0.1 TEMP -15 75 5
Here for each temperature the voltage V1 is swept. vector temp-sweep is not generated, but vector v-sweep.

.dc TEMP -15 75 0.5 V2 0 5 1
For each voltage V2 the temperature is swept. vector temp-sweep is generated and has to be available for plotting.

The command for a resistance sweep in combination with a voltage sweep is
.dc R2 5 10 1 V1 0 1 100m
The scale vector res-sweep is generated and used as x axis vector for plotting

The command for a current sweep in combination with a resistance sweep is
.dc I1 0 1 100m R2 5 10 1
The scale vector i-sweep is generated and used as x axis vector for plotting

Eeschema --> Tools --> Simulator --> Settings --> DC Transfer
should be modified, e.g. by exclusive radio buttons V, I, T, R, each for primary and secondary selection, next to the enable button. The drop-down files DC Source should then offer only the V, I, R available in the netlist. In case of T being selected, the drop-down should grey out. Some value checking for start or end point might be done (R > 0, T > -273.15 °C).

Holger Vogt (h+vogt)
tags: added: eeschema ngspice
Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

I wouldn't mind seeing this implemented myself.

Changed in kicad:
status: New → Triaged
importance: Undecided → Wishlist
milestone: none → 6.0.0-rc1
Revision history for this message
Sylwester Kocjan (skocjan) wrote :

Hi,

I wonder if radio buttons are necessary here. Drop-down list can contain all the elements: V and I sources, resistors and additional element: TEMP.

Moreover, I think we should get rid of one of Enable checkbox: first item must be always included in .dc command. Second item can be enabled if necessary. Two more ideas:

- controls for second item can be disabled when checkbox will be cleared
- text fields indicating units (Volts, Amperes, gr. C) can change depending on selected item in list.

In the attachment you can find my proposals for this feature.

Revision history for this message
Sylwester Kocjan (skocjan) wrote :

This is screenshot how it can look like

Revision history for this message
Sylwester Kocjan (skocjan) wrote :

This is partly modified fbp file

Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

KiCad bug tracker has moved to Gitlab. This report is now available here: https://gitlab.com/kicad/code/kicad/-/issues/2370

Changed in kicad:
status: Triaged → Expired
Changed in kicad:
importance: Wishlist → Unknown
status: Expired → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.