F Flyback Well-Known Member Mar 26, 2023 #1 Hi, I wish to do IF {(I(C7) > 5) OR IF (I(C7)<-5)}, THEN I(C7) = 5, ELSE I(C7) = I(C7) Do you know how the syntax goes for this in LTspice?
Hi, I wish to do IF {(I(C7) > 5) OR IF (I(C7)<-5)}, THEN I(C7) = 5, ELSE I(C7) = I(C7) Do you know how the syntax goes for this in LTspice?
E eTech Well-Known Member Most Helpful Member Mar 26, 2023 #2 Flyback said: Hi, I wish to do IF {(I(C7) > 5) OR IF (I(C7)<-5)}, THEN I(C7) = 5, ELSE I(C7) = I(C7) Do you know how the syntax goes for this in LTspice? Click to expand... If used with a BV or BI device, like this: V=if ( (I(C7)>5) | (I(C7)< -5), 5, I(C7)) <---the result is a voltage -or- I=if ( (I(C7)>5) | (I(C7)< -5), 5, I(C7)) <---the result is a current How do you plan to use result? Last edited: Mar 26, 2023 Upvote 0 Downvote
Flyback said: Hi, I wish to do IF {(I(C7) > 5) OR IF (I(C7)<-5)}, THEN I(C7) = 5, ELSE I(C7) = I(C7) Do you know how the syntax goes for this in LTspice? Click to expand... If used with a BV or BI device, like this: V=if ( (I(C7)>5) | (I(C7)< -5), 5, I(C7)) <---the result is a voltage -or- I=if ( (I(C7)>5) | (I(C7)< -5), 5, I(C7)) <---the result is a current How do you plan to use result?
F Flyback Well-Known Member Mar 26, 2023 #3 Thanks, i was using two lines instead of one for the OR Many thanks. Upvote 0 Downvote