|
From: ngspice u. <d16...@ti...> - 2025-12-01 09:28:29
|
> What about the following: > > * sch1 > R1 0 _net0 1 tc1=0.0 tc2=0.0 > V1 _net0 0 DC 0 SIN(0 1 1 0 0 0) AC 1 ACPHASE 0 > .control > tran 0.01 1.99 .99 > linearize > fourier 1 v1#branch > .endc > .END Thank you for your reply. In my example, the starting point of .99 seconds (command ' tran 0.01 1.99 .99' ) was chosen solely to obtain 100 intervals of 10 millisecond duration, starting at 1.00: the uneven step size and .OPTION INTERP produced the desired set of time vector values: 1.00, 1.01, 1.02 ... 1.99 – exactly 100 intervals with a step of 10 milliseconds, that is, exactly 1 second of the periodic signal period. If I run the simulation without .OPTION INTERP, as you recommend, I get a vector with 101 values of 10 milliseconds each. If I understand the logic correctly, then 0.99, 1.00 ... 1.99. 101 * 0.010 = 1.01 seconds. This isn't equal to one signal cycle, which is 1 second long, and the harmonic analysis appears inaccurate at the initial stage. If I understand correctly, the 'fourier' command, when checking for self-starting, checks the duration of the time segment by subtracting the start time from the end time, but doesn't take into account the duration of the interval (in my case, 10 milliseconds), which seems incorrect. |