LTspice
Production
LTspice® is a powerful, fast, and free SPICE simulator software, schematic capture and waveform viewer with enhancements and models for improving the simulation...
LTspice on Analog.com
Hello ADI Support,
There is a parameter called "Ncycle" in voltage sources.
It seems that in the newer versions, the handling of `Ncycle = 0` has become a bit stricter.
In the "PULSE" type source (see attached `tuto1.asc`), setting `Ncycle = 0` produces a warning:
WARNING: Ncycles must be a positive number, will be ignored (using default = infinity).
V1 out 0 PULSE(0 {amp} 1m 1u 1u {Ton} {Tperiod} {Ncyc})
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
However, in the "SINE" type source (see attached `tuto2.asc`), setting `Ncycle = 0` behaves the same as if it were omitted — no warning appears.
Since voltage sources are widely used in libraries, it is quite common that the upper-level circuit passes `Ncycle = 0`.
As a result, the log is flooded with warning messages.
I was wondering — am I the only one who feels this warning might be a bit too strict?
In previous versions, no warning was generated for this case.
Best regards,
Denspa
251106_tuto.zip
Hi Denspa ,
I'l check on this, but it does feel wrong.
Behavior is also different between Sine and Pulse when using fractional Ncycles for values between 0 and 1, but behavior matches for fractions above one.
mike
Hello Mike,
As you confirmed, both SINE and PULSE correctly treat Ncycle = 0 as “infinite cycles.”
However, only PULSE produces a warning message, which gives the impression that something is wrong—even though the result is actually valid.
For compatibility with existing circuits, it would be very helpful if Ncycle = 0 did not produce a warning for PULSE.
It is a small detail, but I would appreciate your consideration.
Denspa
Hi Denspa ,
I see. I'm compiling that and the odd sub-1 fractional behavior into a single report. Thanks.
mike
Hi Denspa ,
I see. I'm compiling that and the odd sub-1 fractional behavior into a single report. Thanks.
mike