Most Helpful Member
The attached simple sim is meant to produce a 0-10kHz swept sine over a 1 sec period, but instead produces 0-20kHz. Where am I going wrong?
Try idt() function to integrate the quantities.
Can you explain? It looks to me that coincidentally, idt(V(a) just happens to be one half of time^2 at time=1s. Why is this any better than just 0.5*time^2 ?
View attachment 113128
My V(a) plots well behaved. Why do you need to integrate it? If you integrate it, it makes a very different V(b).
It gets weirder. With v(a) ramped from 0 to 1 over 1 sec, followed by v(a) = 1 for 1 sec, a 2 sec sim gives a 0-20kHz sweep followed by a 10kHz sine, with the frequency suddenly halving at the 1 sec point ???
View attachment 113129
Weirder still. Changing V(a) to ramp from 0.5 to 1 over the first 1 sec gives a 5kHz (expected) to 15kHz (unexpected) frequency sweep, followed by 10kHz from 1 sec onwards.
The param thing was just to simplify the BV expression while I was experimenting with it.I don't see where you've changed anything from post 1 except broke out part of the equation and placed it in a param.
The param thing was just to simplify the BV expression while I was experimenting with it.
I extended the sim time from 1 sec to 2 secs so that, from time 1s to 2s, v(a) stays at 1V. That results in LTS correctly identifying the sine frequency from 1s onwards.
I agree the max timestep seems to be the root of the anomaly. I used 1uS for the post #13 sim. If you set maxtimestep progressively >2uS you start to see changes in the sine envelope. Set it at 50uS, for example, and you create a nice noise generator!
It's beginning to look as though any BV expression which is a time function of something which is itself a time function will give unpredictable results.