Menu

parameter not working in AC section of independent voltage source

simpletk
2022-06-01
2022-06-01
  • simpletk

    simpletk - 2022-06-01

    I wanted to change all values in voltage source using parameters:

    .param aaa=0.9 bbb=0.8

    • this works
      V1 1 0 DC 0 AC (0.9 0) SIN(0 {bbb} 192 0 0 0)

    • this does not work
      V1 1 0 DC 0 AC ({aaa} 0) SIN(0 {bbb} 192 0 0 0)

    Error on line 12 :
    v1 1 0 dc 0 ac ( 1 0 ) ( 9.000000000000000e-01 0) sin(0 8.000000000000000e-01 192 0 0 0)
    no such parameter on this device

    In ngspice manual is this example:

    • Param-example
      .param amplitude= 1V * .subckt myfilter in out rval=100k cval=100nF
      Ra in p1 {2rval}
      Rb p1 out {2
      rval}
      C1 p1 0 {2*cval}
      Ca in p2 {cval}
      Cb p2 out {cval}
      R1 p2 0 {rval}
      .ends myfilter * X1 input output myfilter rval=1k cval=1n
      V1 input 0 AC {amplitude}
      .end

    Which also doesn't work. ngspice-36 Creation Date: Sat Jan 1 18:54:42 UTC 2022

     

Log in to post a comment.