I found the switches but in the end i just used a big resistance for off state.You can try to use Sw_tClose and Sw_tOpen connected in series or instead of a switch you could use VPULSE source (squarewave).
Also, what are the purpose of a logic gate and R2 resistor?
Yes, I know. But I ask why the gate is needed in the first place?The nand is used as a (not)
But isn't the 0V at the MOSFET gate turn-on the MOSFET and energize the relay?R2 is used in case we remove the nand or it get's destroyed we will be sure we will have 0 volts on the mosfet.
Yes the mosfet will turn on if vin is <9.5vYes, I know. But I ask why the gate is needed in the first place?
For example, this circuit will work exactly the same way as your circuit.
View attachment 147646
But isn't the 0V at the MOSFET gate turn-on the MOSFET and energize the relay?