Implement MOSFET model   Power Electronics   The metal-oxide
semiconductor field-effect transistor (MOSFET) is a
semiconductor device controllable by the gate signal (g > 0).
The MOSFET device is connected in parallel with an internal
diode that turns on when the MOSFET device is reverse biased
(Vds < 0) and no gate signal is applied (g=0). The model is
simulated by an ideal switch controlled by a logical signal (g >
0 or g = 0), with a diode connected in parallel.  The MOSFET
device turns on when a positive signal is applied at the gate
input (g > 0) whether the drain-source voltage is positive or
negative. If no signal is applied at the gate input (g=0), only
the internal diode conducts when voltage exceeds its forward
voltage Vf.  With a positive or negative current flowing through
the device, the MOSFET turns off when the gate input becomes 0.
If the current I is negative and flowing in the internal diode
(no gate signal or g = 0), the switch turns off when the current
I becomes 0.  The on state voltage V