WOLFRAM SYSTEM MODELER

Comparator

Comparator

Diagram

Wolfram Language

In[1]:=
SystemModel["Modelica.Electrical.Analog.Examples.OpAmps.Comparator"]
Out[1]:=

Information

This information is part of the Modelica Standard Library maintained by the Modelica Association.

This is a comparator. Resistance R1 can be chosen, resistance R2 is defined by the desired reference voltage Vref (between Vn and Vp). The output switches between Vn for input voltage < Vref and Vp for input voltage > Vref.

Parameters (7)

Vps

Value: +15

Type: Voltage (V)

Description: Positive supply

Vns

Value: -15

Type: Voltage (V)

Description: Negative supply

Vin

Value: 5

Type: Voltage (V)

Description: Amplitude of input voltage

f

Value: 10

Type: Frequency (Hz)

Description: Frequency of input voltage

Vref

Value: 0

Type: Voltage (V)

Description: Reference voltage

k

Value: (Vref - Vns) / (Vps - Vns)

Type: Real

Description: Calculated potentiometer ratio to reach Vref

R

Value: 1000

Type: Resistance (Ω)

Description: Resistance of potentiometer

Components (6)

opAmp

Type: IdealizedOpAmpLimited

Description: Idealized operational amplifier with limitation

ground

Type: Ground

Description: Ground node

vIn

Type: TrapezoidVoltage

Description: Trapezoidal voltage source

vOut

Type: VoltageSensor

Description: Sensor to measure the voltage between two pins

potentiometer

Type: Potentiometer

Description: Adjustable resistor

supplyVoltage

Type: SupplyVoltage

Description: Supply voltage (positive and negative)