I would like to create a variable resistor as following:
R2=1 if i(R2)<1
R2=2 if 1<i(R2)<10
R2=3 if i(R2)>10
I know that the syntax is:
R=if(condition,valueiftrue,valueiffalse)
What if I have three intervals?
The .asc file and the IF statement law is also shown below.
What is the correct syntax to do that?
Best Answer
Then you can either
Create a B source with the conditional statements and an additional signal (which is useful for debugging)
Nest the
if
statementsif(condition,valueiftrue,if(condition,valueiftrue,valueiffalse))