Implement MOSFET model


Fundamental Blocks/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 Vds varies

  • Vds = Ron*I when a positive signal is applied at the gate input.

  • Vds = Rd*I-Vf +Lon*dI/dt when the antiparallel diode is conducting (no gate signal).

The Lon diode inductance is available only with the continuous model. For most applications, Lon should be set to zero for both continuous and discrete models.

The MOSFET block also contains a series Rs-Cs snubber circuit that can be connected in parallel with the MOSFET (between nodes d and s).

Dialog Box and Parameters

FET Resistance Ron

The internal resistance Ron, in ohms (Ω). The Resistance Ron parameter cannot be set to 0 when the Inductance Lon parameter is set to 0.

Internal diode inductance Lon

The internal inductance Lon, in henries (H). The Inductance Lon parameter is normally set to 0 except when the Resistance Ron parameter is set to 0.

Internal diode resistance Rd

The internal resistance of the internal diode, in ohms (Ω).

Internal diode forward voltage Vf

The forward voltage of the internal diode, in volts (V).

Initial current Ic

You can specify an initial current flowing in the MOSFET device. It is usually set to 0 in order to start the simulation with the device blocked.

If the Initial current IC parameter is set to a value greater than 0, the steady-state calculation considers the initial status of the MOSFET as closed. Initializing all states of a power electronic converter is a complex task. Therefore, this option is useful only with simple circuits.

Snubber resistance Rs

The snubber resistance, in ohms (Ω). Set the Snubber resistance Rs parameter to inf to eliminate the snubber from the model.

Snubber capacitance Cs

The snubber capacitance, in farads (F). Set the Snubber capacitance Cs parameter to 0 to eliminate the snubber, or to inf to get a resistive snubber.

Show measurement port

If selected, add a Simulink® output to the block returning the MOSFET current and voltage.

Inputs and Outputs


Simulink signal to control the opening and closing of the MOSFET.


The Simulink output of the block is a vector containing 2 signals. You can demultiplex these signals by using the Bus Selector block provided in the Simulink library.





MOSFET current



MOSFET voltage


Assumptions and Limitations

The MOSFET block implements a macro model of the real MOSFET device. It does not take into account either the geometry of the device or the complex physical processes [1].

Depending on the value of the inductance Lon, the MOSFET is modeled either as a current source (Lon > 0) or as a variable topology circuit (Lon = 0). The MOSFET block cannot be connected in series with an inductor, a current source, or an open circuit, unless its snubber circuit is in use.

Use the Powergui block to specify either continuous simulation or discretization of your electrical circuit containing MOSFET blocks. When using a continuous model, the ode23tb solver with a relative tolerance of 1e-4 is recommended for best accuracy and simulation speed.

The inductance Lon is forced to 0 if you choose to discretize your circuit.


The power_mosconvpower_mosconv example illustrates the use of the MOSFET block in a zero-current quasi-resonant switch converter. In such a converter, the current produced by the Lr-Cr resonant circuit flows through the MOSFET and internal diode. The negative current flows through the internal diode that turns off at 0 current [1]. The switching frequency is 2 MHz and the pulse width is 72 degrees (duty cycle: 20%).

Run the simulation and observe the gate pulse signal, the MOSFET current, the capacitor voltage, and the diode current on the four-trace Scope block.


[1] Mohan, N., T.M. Undeland, and W.P. Robbins, Power Electronics: Converters, Applications, and Design, John Wiley & Sons, Inc., New York, 1995.

Was this topic helpful?