Menu

#630 pwl if r=last time, simulation never ends

v1.0 (example)
closed-fixed
None
5
2023-08-30
2023-05-14
simpletk
No
  • comment
    VU1 1 0 DC 0 PWL (0 0 0.003 1) r=0.003
    RR1 1 0 100
    .tran 100u 20m 0
    .print tran v(1)
    .end

If I choose r=0.123 then this error message is given:

ERROR: repeat start time value 0.123 for pwl voltage source must be smaller than final time point given!

That's ok, but when I choose r=exact_last_point then no error is given and simulation never ends.
Basically condition for that error message should be changed from t > last to t >= last
or it should be make to work with last time too (same as r=0).
ngspice-36

Discussion

  • Giles Atkinson

    Giles Atkinson - 2023-05-14
    • status: open --> open-accepted
    • assigned_to: Giles Atkinson
     
  • Giles Atkinson

    Giles Atkinson - 2023-05-14

    It is reproducible in version 40, but not pre-master. It seems likely to have been fixed by:

    commit 9c71db3a728d59c901a08afc3870b65095adb1b0
    Author: Giles Atkinson <gatk555@gmail.com>
    Date:   Mon Apr 3 19:12:51 2023 +0100
    
        Fix Bug #607  -
          "DC Source with Pulse stops pulsing half way through simulation".
        Do not require breakpoints to be hit almost exactly before scheduling
        the next one.  That may cause the next breakpoint to be lost.
    

    That change contained a PWL-specific bug that was supposed to be fixed by 79c69e064435f6b6f8950804e0f5d3fbbe0cd708, but this test circuit shows that it is still there when the R parameter is used. So another change is needed.

     
  • Giles Atkinson

    Giles Atkinson - 2023-05-14

    In fact, that change is largely irrelevant, except that it did remove the loop that becomes endless when the repeat starts at the last time-point. The best fix seems to be to treat that as an error, as suggested.

     
  • Giles Atkinson

    Giles Atkinson - 2023-06-13
     
  • Giles Atkinson

    Giles Atkinson - 2023-06-13

    Fixed as suggested: 0616965a6795ee8ac4ec7628a2685f4eee5bc55e.

     
  • Giles Atkinson

    Giles Atkinson - 2023-06-13
    • status: open-accepted --> open-fixed
     
  • Giles Atkinson

    Giles Atkinson - 2023-08-30
    • status: open-fixed --> closed-fixed
     
  • Giles Atkinson

    Giles Atkinson - 2023-08-30

    Fix included in ngspice-41.

     

Log in to post a comment.