Analog.IdealOpAmpLimited
Usage
TranslatedComponents.Analog.IdealOpAmpLimited(unitVoltage=1)
Parameters:
| Name | Description | Units | Default value |
|---|---|---|---|
unitVoltage | V | 1 |
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
| Name | Description | Units |
|---|---|---|
vin | Input voltage | V |
s | Auxiliary variable | – |
Behavior
Source
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))
endFlattened Source
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 {}
endTest Cases
No test cases defined.
Related
Examples
Experiments
Analyses