I want to control resistance (100Mohm) programmatically. I found on this site that photoFET can solve this issue by sourcing constant current. From my understanding FET can give resistance control over orders of 1 to 2Mohm. Apart from this I want to drop 5000V dc(5kv) across this resistance. So what should I use? i.e Range of variation for this resistor needs to be from few 100 Megaohm to few kiloohms. A small amount of current 50 micro amperes flows in the circuit.