The attached simple sim is meant to produce a 010kHz swept sine over a 1 sec period, but instead produces 020kHz. Where am I going wrong?
Attachments

448 bytes Views: 17
Try idt() function to integrate the quantities.The attached simple sim is meant to produce a 010kHz swept sine over a 1 sec period, but instead produces 020kHz. Where am I going wrong?
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 ?Try idt() function to integrate the quantities.
v=sin(2*pi*10k*idt(v(a)*time))
eT
Because the time computation should occur after each time slice (idt()) and then fed to the remainder of the equation.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).
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.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 020kHz sweep followed by a 10kHz sine, with the frequency suddenly halving at the 1 sec point ???
View attachment 113129
Edit:
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.
HiThe 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.
Heh...the best way to avoid this type of gocha is to use the LTspice modulate or modulate2 device.Nice solution. Thanks. I'm sure LTS has a lot more 'gotchas' awaiting me .