PSpice: value of resistor controlled by a function
I remember publishing a model of a variable resistor in Power Electronics and Intelligent Motion, the US magazine, in 2005. The idea was to control an inductance, a capacitance and a resistance by a voltage. The variable resistance model using PSpice analog behavioral equations is here:

.subckt VARIRES 1 2 CTRL

R1 1 2 1E10

G1 1 2 Value = { V(1,2)/(V(CTRL)+1u) }

.ENDS

It follows this simple model



and here is a simple test circuit using IsSpice at that time:



The 1-u source is there to prevent a divide-by-zero event and improves convergence during the bias point calculation.