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
vinInput voltageV
sAuxiliary variable

Behavior

in_p.i(t)=0in_n.i(t)=0VMax.i(t)=0VMin.i(t)=0vin(t)=in_p.v(t)in_n.v(t)in_p.v(t)in_n.v(t)=unitVoltageifelse(s(t)<1,1+s(t),ifelse(s(t)>1,1+s(t),0))out.v(t)=ifelse(s(t)<1,VMin.v(t),ifelse(s(t)>1,VMax.v(t),12(VMax.v(t)+VMin.v(t))+12(VMax.v(t)VMin.v(t))s(t)))

Source

dyad
component IdealOpAmpLimited
  in_p = Pin()
  in_n = Pin()
  out = Pin()
  VMax = Pin()
  VMin = Pin()
  parameter unitVoltage::Dyad.Voltage = 1
  # Input voltage
  variable vin::Dyad.Voltage
  # Auxiliary variable
  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
  # Input voltage
  variable vin::Dyad.Voltage
  # Auxiliary variable
  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