DC Parametric sweep

wiebe
2013-03-05
2013-06-12
  • wiebe
    wiebe
    2013-03-05

    Hello. I am busy now with NGSPICE, but have a question, one of the things I can do in pspice is plot the power as a function of resistance P(RL). We do this by creating a resistor, setting its value to "{RL}", adding a special part named "PARAM", setting "R2=2K" as name1/value of the PARAM part, then running a DC sweep using "Global Parameter" and "RL" as the name.

    We can then plot things with respect to RL, such as -V(R2)^2*I(R2), where R2 is the resistor having the value {RL}. It's the graph of maximum power transfer, so it looks like a horked -x^2 graph.

    I have found nothing comparable in ngspice. Is this correct?

    I have included the pspice circuit file below, changing ony the .INC with the file data that was included.

    Willem

     
  • Holger Vogt
    Holger Vogt
    2013-03-06

    Willem,

    see the example below. There are many additional methods in ngspice (behavioral sources, scripts) to cover most of the simulation needs.

    Regards

    Holger

    resistor sweep test
    V1 1 0 1
    RLoad 1 0 1
    * the dc sweep with resistor as parameter (manual 15.3.2)
    .dc RLoad 0.5 1 0.01
    * save the power dissipated in the resistor (manual 30.1, 30.2.1)
    .save @RLoad[p]
    .control
    run
    plot @RLoad[p]
    .endc
    .end