Menu

How to make PULSE source with just 2 pulses?

simpletk
2023-05-08
2023-05-08
  • simpletk

    simpletk - 2023-05-08

    I'm trying to use PULSE voltage supply with just two pulses. I can either have 1 pulse or infinetely many pulses:

    * two 5V pulses, 0.1s wide, 0.2s period
    .control
    unset ngbehavior
    .endc
    *               V1 V2 D Raise  Fall   PW  Per N
    V1 1 0 DC 0 PULSE(1 5 0 0.0001 0.0001 0.1 0.2 2)
    R1 1 0 1000
    .tran 0.01 1.0 0
    .print tran v(1)
    .end
    

    I'm using ngspice-36 from ubuntu 22.04

     
  • Giles Atkinson

    Giles Atkinson - 2023-05-08

    It seems you may be using the version 40 manual with version 36 software. It works with 40 and I think the "number of pulses" argument was new in 40:

    commit 631ff35c340a7f7289f700235573b86b14390388
    Author: Holger Vogt <holger.vogt@uni-due.de>
    Date:   Thu Nov 24 14:46:54 2022 +0100
    
        The 8th parameter on a voltage or current source now is 'number of pulses'.
        Previous usage had been PHASE, introduced by XSPICE, which has
        been redundant to DELAY. PHASE is again available when compatibility flag
        xs has been set.
    

    If you do not want to build from source, two single-pulse sources in series or a PWL source should work.

     
  • simpletk

    simpletk - 2023-05-08

    Thanks

     

Log in to post a comment.