Skip to content
Analog.IdealOpAmpLimited.md

Analog.IdealOpAmpLimited ​

Usage ​

TranslatedComponents.Analog.IdealOpAmpLimited(unitVoltage=1)

Parameters: ​

NameDescriptionUnitsDefault value
unitVoltageV1

Connectors ​

  • in_p - This connector represents an electrical pin with voltage and current as the potential and flow variables, respectively. (Pin)

  • in_n - This connector represents an electrical pin with voltage and current as the potential and flow variables, respectively. (Pin)

  • out - This connector represents an electrical pin with voltage and current as the potential and flow variables, respectively. (Pin)

  • VMax - This connector represents an electrical pin with voltage and current as the potential and flow variables, respectively. (Pin)

  • VMin - This connector represents an electrical pin with voltage and current as the potential and flow variables, respectively. (Pin)

Variables ​

NameDescriptionUnits
vinV
s–

Behavior ​

julia
using TranslatedComponents #hide
using ModelingToolkit #hide
@variables unitVoltage #hide
@named sys = TranslatedComponents.Analog.IdealOpAmpLimited(unitVoltage=unitVoltage) #hide
full_equations(sys) #hide
<< @example-block not executed in draft mode >>

Source ​

dyad
component IdealOpAmpLimited
  in_p = Pin()
  in_n = Pin()
  out = Pin()
  VMax = Pin()
  VMin = Pin()
  parameter unitVoltage::Dyad.Voltage = 1
  variable vin::Dyad.Voltage
  variable s::Real
relations
  in_p.i = 0
  in_n.i = 0
  VMax.i = 0
  VMin.i = 0
  vin = in_p.v - in_n.v
  in_p.v - in_n.v = unitVoltage * identity(s < -1 ? s + 1 : (s > 1 ? s - 1 : 0))
  out.v = identity(s < -1 ? VMin.v : (s > 1 ? VMax.v : (VMax.v - VMin.v) * s / 2 + (VMax.v + VMin.v) / 2))
end
Flattened Source
dyad
component IdealOpAmpLimited
  in_p = Pin()
  in_n = Pin()
  out = Pin()
  VMax = Pin()
  VMin = Pin()
  parameter unitVoltage::Dyad.Voltage = 1
  variable vin::Dyad.Voltage
  variable s::Real
relations
  in_p.i = 0
  in_n.i = 0
  VMax.i = 0
  VMin.i = 0
  vin = in_p.v - in_n.v
  in_p.v - in_n.v = unitVoltage * identity(s < -1 ? s + 1 : (s > 1 ? s - 1 : 0))
  out.v = identity(s < -1 ? VMin.v : (s > 1 ? VMax.v : (VMax.v - VMin.v) * s / 2 + (VMax.v + VMin.v) / 2))
metadata {}
end


Test Cases ​

No test cases defined.

  • Examples

  • Experiments

  • Analyses