I am still very much a beginner in SPICE and simulation.
Can somebody help me why I get the error message "No model named ‘’ in ‘SPICE models\Optocoupler.lib’ " from the Simulation Model Editor when trying to add the follwing simplified model to my component (or point out where I can find this in the ngspice or other manuals):
* Simple Optocoupler spice model
*
* ==== ====
* A = diode anode
* K = diode cathode
* C = BJT collector
* E = BJT emitter
*$
.SUBCKT Optocoupler A K E C
* Behavioral Resistor - Changes value based on A-K voltage
RComp E C R={if(V(A,K) > 1.4, ROpto, 1Meg)}
.MODEL ROpto RES (R=1)
.ends Optocoupler
*
The same happens without the .MODEL line with 1 instead of ROpto on the line above.
Thanks a lot!
Jan