ngspice: enable .dc current, temperature and resistance sweeps
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
KiCad |
Fix Released
|
Unknown
|
Bug Description
This is an extension to report https:/
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).
tags: | added: eeschema ngspice |
Changed in kicad: | |
importance: | Wishlist → Unknown |
status: | Expired → Fix Released |
I wouldn't mind seeing this implemented myself.