diyAudio (http://www.diyaudio.com/forums/index.php)
-   Software Tools (http://www.diyaudio.com/forums/software-tools/)
-   -   "Piecewise" waveform arithmetics in ltspice? (http://www.diyaudio.com/forums/software-tools/186342-piecewise-waveform-arithmetics-ltspice.html)

 teemuk 3rd April 2011 04:02 PM

"Piecewise" waveform arithmetics in ltspice?

Is there a way to combine several waveform arithmetic functions so that they would work at specific ranges of input x?

for example:
With values of x < -1 the waveform would be processed with function #1,
with values of x >-1 and <1 the waveform would be processed with function #2, and with values of x >1 the waveform would be processed with function #3.

:confused:

 teemuk 3rd April 2011 04:50 PM

Nevermind, I can wrap it up with IF sentences.

If someone has a better solution let's hear ya.

 jcx 10th April 2011 04:59 PM

the U() function can be used to turn on/off terms in an equation

my http://www.diyaudio.com/forums/softw...ml#post1333137
sim uses the U() function to select different periods of a waveform for parts of the calculation:

V=u(time-{(ncycles-3)*period})*u({(ncycles-2)*period}-time) is unit pulse for one cycle of a waveform and can be multiplied by the funciton you want to select for that time range - other functions of I,V can be used as "window" control arguments

 All times are GMT. The time now is 06:51 PM.

Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.