Our teaching assistant showed us this circuit, saying that the MOSFET acts as a switch. When the power supply is OFF, the MOSFET allows the filter capacitors to be discharged via the switch circuit.
I know that capacitor C3 gets discharged when the switch is off. If the gate-source voltage exceeds the threshold voltage, then the MOSFET switches ON, allowing the filter capacitors to be discharged. However, I am not too certain as to what is the function of the diode and the drain resistor. Could anyone give me an explanation of the logic behind the operations? Thanks.