Switch (Boolean)

Ideal switch that closes while its control input is true.

  • Boolean
  • electrical
  • Modelica Standard Library
  • 3 ports
  • 2 parameters
BlockSwitch (Boolean)KindclosingSwitchLibrarySemiconductors

Description

An ideal bidirectional switch that is closed while control is true and open while it is false. Use it for relays, contactors, and scheduled connections.

Example

Switches and a breaker An ideal switch, closing and opening switches, a two-way switch, and a breaker that opens an inductive circuit.

10 V Ai ALoad AIdeal switchGate 5 HzGround A10 V Bi BClosing switchClose at 0.1 sLoad BGround B10 V Ci COpening switchOpen at 0.1 sLoad CGround CL 10 mH10 V Di DBreakerTrip at 0.1 sLoad DGround D10 V Ei ETwo-way switchChange over at 0.1 sLoad 10 ΩLoad 20 ΩGround E
In Gradara, select a Switch (Boolean) block and press F1, then choose Open example. It opens as a new model in My models, ready to run.

Also in this example:DC voltageIdeal switchCurrent sensorGroundPulseResistorInductorOpening switchChangeover switchBreaker (with arc)Boolean step

Ports

Inputs 1

  • oncontrol

    Boolean command: true closes the switch.

Conserving terminals 2

  • +p

    Terminal 1. Current into p is counted as positive.

  • −n

    Terminal 2.

Parameters

  • On resistanceRon0.00001 Ω

    ≥ 0

    On resistance, in ohms: the slope of the conducting branch. 0 or more; the default 10 µΩ is near-ideal.

  • Off conductanceGoff0.00001 S

    ≥ 0

    Off conductance, in siemens: the slope of the blocking branch, so the leakage is Goff · v. 0 or more; the default 10 µS leaks 10 µA per volt.

Equations

Modelica
v = p.v − n.v, i = p.i
Closed (control true): v = Ron · i
Open (control false): i = Goff · v

Implementation

Modelica Standard Library 4.1.0Modelica.Electrical.Analog.Ideal.IdealClosingSwitch
MSL documentation

Assumptions and limitations

  • Switches instantly with no arc or bounce. Opening an inductive current forces it through Goff and gives a large voltage spike.

Tips

  • For an opening switch that models the arc, use Breaker (with arc).

Used in

These larger examples use it too. Open them from Examples in the app.

  • Data center cooling control
  • 480 VAC → 24 VDC flyback

See also

Select a block in Gradara and press F1 to open its page offline.