Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Small Signal Amplifier ngspice failure

Help
lpc2138
2012-12-01
2013-06-12
  • lpc2138
    lpc2138
    2012-12-01

    code  from nsgspice manual , 24 version ,page372
    Small Signal Amplifier
    *
    *This circuit simulates a small signal amplifier
    *with a diode limiter.
    *
    .dc Vin -1 1 .05
    *
    Vin Input 0 DC 0
    R_source Input Amp_In 100
    *
    D_Neg 0 Amp_In 1n4148
    D_Pos Amp_In 0 1n4148
    *
    C1 Amp_In 0 1uF
    A1 Amp_In 0 Amp_Out Amplifier
    R_Load Amp_Out 0 1000
    *
    .model 1n4148 D (is=2.495E-09 rs=4.755E-01 n=1.679E+00
    + tt=3.030E-09 cjo=1.700E-12 vj=1 m=1.959E-01 bv=1.000E+02
    + ibv=1.000E-04)
    *
    .model Amplifier Amp (gain = -10 in_offset = 1e-3
    + rin = 1meg rout = 0.4)
    *
    .end
    Error message
    Error on line 15 : a1 amp_in 0 amp_out amplifier
    MIF-ERROR - unable to find definition of model amplifier
    Model issue on line 22 : .model amplifier amp (gain=-10 in_offset=1e-3 rin=1meg r …
    Unknown model type amp - ignored

    thanks.

     
  • Robert Larice
    Robert Larice
    2012-12-01

    Hello,

    from the manual:

    Subsequent sections of this document detail the steps required to
      create such a Code Model and include it in the XSPICE simulator.

    In other words, the xspice "amp" is not part of ngspice,
       but is an exercise on "how to create your own xpsice model"

    some pages later you will find an example
      which is using the already existing xspice model "gain"
    see:
      Amplifier with XSPICE model “gain”

    Robert

     
  • lpc2138
    lpc2138
    2012-12-01

    thanks. I found it just now.