# SPST Switch

Model single-pole single-throw switch

## Library

Passive Devices/Switches

## Description

The SPST Switch block models a single-pole single-throw switch:

• When the switch is closed, port c is connected to port s through a resistance with value equal to the Closed resistance parameter value.

• When the switch is open, port c is connected to port s through a resistance with value equal to the reciprocal of the Open conductance parameter value.

If the Threshold width parameter is set to zero, the switch is closed if the voltage presented at the vT control port exceeds the value of the Threshold parameter.

If the Threshold width parameter is greater than zero, then switch conductance G varies smoothly between off-state and on-state values:

$G=\frac{x}{{R}_{closed}}+\left(1-x\right){G}_{open}$

The block uses the function 3λ2 – 2λ3 because its derivative is zero for λ = 0 and λ = 1.

Defining a small positive Threshold width can help solver convergence in some models, particularly if the control port signal vT varies continuously as a function of other network variables. However, defining a nonzero threshold width precludes the solver making use of switched linear optimizations. Therefore, if the rest of your network is switched linear, MathWorks recommends that you set Threshold width to zero.

Optionally, you can add a delay between the point at which the voltage at vT passes the threshold and the switch opening or closing. To enable the delay, on the Dynamics tab, set the Model dynamics parameter to Model turn-on and turn-off times.

## Dialog Box and Parameters

### Main Tab

Closed resistance

Resistance between the c and s electrical ports when the switch is closed. The value must be greater than zero. The default value is 0.01 Ω.

Open conductance

Conductance between the c and s electrical ports when the switch is open. The value must be greater than zero. The default value is 1e-6 S.

Threshold

The threshold voltage for the control physical signal input vT above which the switch will turn on. The default value is 0 V.

Threshold width

The minimum increase in the control signal vT above the threshold value that will move the switch from fully open to fully closed. The default value is 0 V.

### Dynamics Tab

Model dynamics

Select whether the block models a switching delay:

• No dynamics — Do not model the delay. This is the default option.

• Model turn-on and turn-off times — Use additional parameters to model a delay between the point at which the voltage at vT passes the threshold and the switch opening or closing.

Turn-on delay

Time between the input voltage exceeding the threshold voltage and the switch closing. This parameter is only visible when you select Model turn-on and turn-off times for the Model dynamics parameter. The value must be greater than zero. The default value is 1e-3 seconds.

Turn-off delay

Time between the input voltage falling below the threshold voltage and the switch opening. This parameter is only visible when you select Model turn-on and turn-off times for the Model dynamics parameter. The value must be greater than zero. The default value is 1e-3 seconds.

Initial input value, vT

The value of the physical signal input vT at time zero. This value is used to initialize the delayed control voltage parameter internally. This parameter is only visible when you select Model turn-on and turn-off times for the Model dynamics parameter. The default value is 0 V.

## Ports

This block has the following ports:

vT

Physical signal that opens and closes the switch

c, s

Electrical conserving ports