Hi I am trying to simulate a simple subcircuit model in LTSpice but I get an if function error which says
"Syntax error: function if(): requires exactly three segments"
These are the if arguments in the subcircuit code
* Function G(V(t)) - Describes the device threshold
.func G(V) = IF(V<=Vp, IF(V>=-Vn, 0, -An*(exp(-V)-exp(Vn))), Ap*(exp(V)-exp(Vp)))
* Function F(V(t),x(t)) - Describes the SV motion
.func F(V1,V2) = IF(eta*V1>=0,IF(V2>=xp,exp(-alphap*(V2-xp))*wp(V2),1),IF(V2<=(1-xn),exp(alphan*(V2+xn-1))*wn(V2),1))
Based on the IF function { IF(a, then b, else c)} both of these functions have 3 segments for each of their IF components. Is there something I'm missing out?
I have attached screenshots of the error and the IF function segments of the code for reference.
"Syntax error: function if(): requires exactly three segments"
These are the if arguments in the subcircuit code
* Function G(V(t)) - Describes the device threshold
.func G(V) = IF(V<=Vp, IF(V>=-Vn, 0, -An*(exp(-V)-exp(Vn))), Ap*(exp(V)-exp(Vp)))
* Function F(V(t),x(t)) - Describes the SV motion
.func F(V1,V2) = IF(eta*V1>=0,IF(V2>=xp,exp(-alphap*(V2-xp))*wp(V2),1),IF(V2<=(1-xn),exp(alphan*(V2+xn-1))*wn(V2),1))
Based on the IF function { IF(a, then b, else c)} both of these functions have 3 segments for each of their IF components. Is there something I'm missing out?
I have attached screenshots of the error and the IF function segments of the code for reference.
Attachments
-
13 KB Views: 17
-
33.7 KB Views: 20