--- In LTspice@..., "Tammo Heeren" <Tammo.Heeren@...> wrote: Having said that, I quick simulation clearly shows that all 4 variations of min, max, function work as expected. My apologies to Helmut. He was correct after all. I suppose the manual is incorrect.
Tammo
Hello Tammo, I wouldn't say the help-manual is incorrect. It only doesn't mention all possible cases. I think the description shown in the help pages is the same as in other SPICE programs. Best regards, Helmut
On 26 Jul 2006 at 5:28, Helmut Sennewald wrote:
The limit() function limits the output value.
limit(min, max, function) limit(min, function, max)
The order of the parameter doesn't matter. Helmut,
it don't think this statement is quite correct. The manual states that : limit(x,y,z) = min( max(x,y), z) If we go through the permutations:
limit( 0, 1, 2 ) = min( max( 0, 1 ), 2 ) = min( 1, 2 ) = 1: correct limit( 0, 1, -2 ) = min( max( 0, 1 ), -2 ) = min( 1, -2 ) = -2:
not correct limit( 0, 2, 1 ) = min( max( 0, 2 ), 1 ) = min( 2, 1 ) = 1: correct limit( 0, -2, 1 ) = min( max( 0, -2 ), 1 ) = min( 0, 1 ) = 0: correct
limit( 2, 0, 1 ) = min( max( 2,0 ), 1 ) = min( 2, 1 ) = 1: correct limit( -2, 0, 1 ) = min( max( -2, 0 ), 1 ) = min( 0, 1 ) = 0: correct
limit( 2, 1, 0 ) = min( max( 2,1 ), 0 ) = min( 2, 0 ) = 0: not
correct limit( -2, 1, 0 ) = min( max( -2, 1 ), 0 ) = min( 1, 0 ) = 0: correct
I hope I did not forget any permutations. Thus the following are correct: - limit( min, function, max ) - limit( function, min, max )
Tammo
|