Referance for LTspice expressions.

Thread Starter

Lightium

Joined Jun 6, 2012
320
Hello,
I am looking for a referance for using algebraic expressions in LTspice, specificly in subcircuits.
 

WBahn

Joined Mar 31, 2012
32,883
The help file won't help with this. Have you looked? Where is it?
You state that the help file won't help with this, but then ask where to find the help file.

There are several contexts in which you can use expressions and the constraints differ with each.

What, precisely, are you trying to accomplish. Give a concrete example and let's see if we can figure out if it can be done and, if so, how. If not, what the issue is that is preventing it.
 

WBahn

Joined Mar 31, 2012
32,883
It would be interesting to see what you were trying to accomplish and how you ended up doing it -- and how well it is working for you. But there's certainly no requirement.
 

Thread Starter

Lightium

Joined Jun 6, 2012
320
.subckt sparkgap p n

* Parameters
* d: Gap distance in meters
* aa: Gap area in sqr meters
* p: Gas pressure in Pascals, 1 atmos = 101325 pascals

*Gas A B
*Dry air 43.6 * 10^6 12.8
*Argon 10.7 * 10^6 11.4
*Helium 2.32 * 10^6 10.2
*Nitrogen 37.1 * 10^6 12.3


* Model constants
.param A = 43.6e+3
.param B = 23.8
.param C = 11.6

* Spark gap voltage
*Vspark = ({B} * {p} * {d}) / log({A} * {p} * {d}) - log(log(1+(1/1.2)))-{C}

* Capacitance of gap
* Spark gap resistance
Cspark p n {8.85e-12 * aa / d}
Rspark p n {30e15 / (({B} * {p} * {d}) / log({A} * {p} * {d}) - log(log(1+(1/1.2)))-{C})}

.ends sparkgap
 
Top