Menu

PULSE source syntax

2014-05-29
2017-06-29
  • marcel hendrix

    marcel hendrix - 2014-05-29

    This cannot be called a bug, but it merits a warning.

    The syntax of an NGSPICE pulse source is as follows:

    PULSE(-1 1 2NS 2NS 2NS 50NS 100NS)

    Some simulators allow:

    PULSE(-1 1 2NS 2NS 2NS 50NS 100NS 1)

    to just generate 1 pulse (e.g. LTSpice).

    In NGSPICE this syntax leads to a source that appears
    to be 0V for ever. There is no error message. (I did
    not test for anything other than "1" so it may be
    a special case).

    -marcel

     
  • Robert Larice

    Robert Larice - 2014-05-29

    ~~~~~
    :::html
    Hello Marcel,

    The trailing "1" will be used as a "PHASE" parameter
    when you have compiled with xspice enabled.
    This can be found in vsrcload.c line 99

    ifdef XSPICE

    / gtri - begin - wbk - add PHASE parameter /
    PHASE = here->VSRCfunctionOrder > 7
    ? here->VSRCcoeffs[7] : 0.0;

    Regards,
    Robert

     
  • marcel hendrix

    marcel hendrix - 2014-05-30

    Thanks Robert! I see it in the manual now (shame on me).

    I still find the behavior rather difficult to understand. When phase <> 0, the pulse is delayed by {360-phase} degrees -- see picture.

    Therefore my initial test with phase=1 delayed the pulse by very nearly a full cycle. That's why I missed it.

    -marcel

     

    Last edit: marcel hendrix 2014-05-30

Log in to post a comment.