POT model w/ PARAMS * .include <> * This is the potentiometer * _____ * 1--|_____|--2 * | * 3 * .SUBCKT POT 1 2 3 PARAMS: Rt=1K SET=0.5 RA 1 3 {Rt*(1-SET)+.001} RB 3 2 {Rt*SET+.001} .ENDS * ngspice w/ LTSpice "Pote.lib" -> must define LIMIT function .func LIMIT(x,y,z) { min(max(x,y),z) } * set POT parameters .PARAM Rt=100k .PARAM SET=0.5 * voltage source // POT V1 1 0 DC 1V X1 0 1 2 POT Rt={Rt} SET={SET} * operational point -> potentiometer as voltage divider .OP .END