I would like to design this circuit shown in the picture. I have simulated it in Multisim. It functions as follows: When the switch is open, the phototransistor is high impedance, when the switch is closed it is low impedance. I wonder how to input this into Multisim. I would like to adjust current on phototransistor according to distance between photodiode and phototransistor. For example: if the distance is 1 metre, current on phototransistor is 10 mA; if distance is 2 m current on phototransistor is 4 mA. I have not found out how to do this in Multisim. Do you know how to do it in Multisim or do you know other software where this is possible?
You cannot use a photodiode to trigger a phototransistor.
A photodiode is another kind of light detector, with a similar function to a phototransistor. It cannot be used to generate light (without damaging it). A diode that emits light is rather unimaginatively called a light-emitting diode or LED.
You can't vary the distance between the photo diode and the photo transistor but you can vary the current through the diode, and thus control the current passing through the transistor. So instead of using a switch to switch the diode on and off, use a variable resistor to control the current through the PhotoDiode as I've done here.