I am trying to implement the Hodgkin-Huxley model for simulating neurons using LTSpice. One feature of this model is that the resistances at any given time actually depend on the transmembrane voltage at that time. Is there a way, in LTSpice, to change the values of resistors dynamically in a simulation?
I can find answers on how to vary the value of a resistor in pre-defined increments during a simulation. However, this approach will not work in this case, because I don't know these increments before the simulation starts. Rather, they must be recalculated dynamically from a particular voltage. Does LTSpice (or any other version of Spice, for that matter) have this capability?
EDIT: To be more specific about what the Hodgkin-Huxley model entails, the simulation code I need basically boils down to , where the g's represent the conductances, the E's are all constant voltages, gL is constant, and the other conductances all update according to :
where m, n, and h are state variables, and Vm is the transmembrane voltage (the voltage between Istim+ and Istim- in the above schematic). The alpha's and beta's are known functions of the transmembrane voltage.
In particular, I need to be able to keep track of the "current values" of the m, n, and h parameters during the simulation because the next value of these variables will depend on them.