Analog.Basic.Transformer
Transformer with two ports.
Models an ideal transformer with mutual inductance coupling between primary and secondary windings. The voltage-current relationships are:
where L1 and L2 are the primary and secondary self-inductances, and M is the mutual (coupling) inductance.
Corresponds to Modelica.Electrical.Analog.Basic.Transformer.
This component extends from ElectricalComponents.Analog.Interfaces.TwoPort
Usage
ElectricalComponents.Analog.Basic.Transformer(L1=1, L2=1, M=1)
Parameters:
| Name | Description | Units | Default value |
|---|---|---|---|
L1 | Primary inductance | H | 1 |
L2 | Secondary inductance | H | 1 |
M | Coupling inductance | H | 1 |
Connectors
p1- This connector represents an electrical pin with voltage and current as the potential and flow variables, respectively. (Pin)n1- This connector represents an electrical pin with voltage and current as the potential and flow variables, respectively. (Pin)p2- This connector represents an electrical pin with voltage and current as the potential and flow variables, respectively. (Pin)n2- This connector represents an electrical pin with voltage and current as the potential and flow variables, respectively. (Pin)
Variables
| Name | Description | Units |
|---|---|---|
v1 | Voltage drop of port 1 (= p1.v - n1.v) | V |
v2 | Voltage drop of port 2 (= p2.v - n2.v) | V |
i1 | Current flowing from pos. to neg. pin of port 1 | A |
i2 | Current flowing from pos. to neg. pin of port 2 | A |
Behavior
Source
"""
Transformer with two ports.
Models an ideal transformer with mutual inductance coupling between
primary and secondary windings. The voltage-current relationships are:math v_1 = L_1 \cdot \frac{di_1}{dt} + M \cdot \frac{di_2}
math v_2 = M \cdot \frac{di_1}{dt} + L_2 \cdot \frac{di_2}
where `L1` and `L2` are the primary and secondary self-inductances,
and `M` is the mutual (coupling) inductance.
Corresponds to `Modelica.Electrical.Analog.Basic.Transformer`.
"""
component Transformer
extends ElectricalComponents.Analog.Interfaces.TwoPort
"Primary inductance"
parameter L1::Inductance = 1
"Secondary inductance"
parameter L2::Inductance = 1
"Coupling inductance"
parameter M::Inductance = 1
relations
v1 = L1 * der(i1) + M * der(i2)
v2 = M * der(i1) + L2 * der(i2)
metadata {
"Dyad": {
"labels": [{"label": "$(instance)", "x": 500, "y": 1100, "rot": 0}],
"icons": {"default": "dyad://ElectricalComponents/Transformer.svg"}
}
}
endFlattened Source
"""
Transformer with two ports.
Models an ideal transformer with mutual inductance coupling between
primary and secondary windings. The voltage-current relationships are:math v_1 = L_1 \cdot \frac{di_1}{dt} + M \cdot \frac{di_2}
math v_2 = M \cdot \frac{di_1}{dt} + L_2 \cdot \frac{di_2}
where `L1` and `L2` are the primary and secondary self-inductances,
and `M` is the mutual (coupling) inductance.
Corresponds to `Modelica.Electrical.Analog.Basic.Transformer`.
"""
component Transformer
"Positive electrical pin of port 1"
p1 = Pin() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": -40, "y1": -40, "x2": 60, "y2": 60, "rot": 0}
},
"tags": []
}
}
"Negative electrical pin of port 1"
n1 = Pin() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": -40, "y1": 940, "x2": 60, "y2": 1040, "rot": 0}
},
"tags": []
}
}
"Positive electrical pin of port 2"
p2 = Pin() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 960, "y1": -40, "x2": 1060, "y2": 60, "rot": 0}
},
"tags": []
}
}
"Negative electrical pin of port 2"
n2 = Pin() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 960, "y1": 950, "x2": 1060, "y2": 1050, "rot": 0}
},
"tags": []
}
}
"Voltage drop of port 1 (= p1.v - n1.v)"
variable v1::Voltage
"Voltage drop of port 2 (= p2.v - n2.v)"
variable v2::Voltage
"Current flowing from pos. to neg. pin of port 1"
variable i1::Current
"Current flowing from pos. to neg. pin of port 2"
variable i2::Current
"Primary inductance"
parameter L1::Inductance = 1
"Secondary inductance"
parameter L2::Inductance = 1
"Coupling inductance"
parameter M::Inductance = 1
relations
v1 = p1.v - n1.v
v2 = p2.v - n2.v
i1 = p1.i
i2 = p2.i
0 = p1.i + n1.i
0 = p2.i + n2.i
v1 = L1 * der(i1) + M * der(i2)
v2 = M * der(i1) + L2 * der(i2)
metadata {
"Dyad": {
"labels": [{"label": "$(instance)", "x": 500, "y": 1100, "rot": 0}],
"icons": {"default": "dyad://ElectricalComponents/Transformer.svg"}
}
}
endTest Cases
No test cases defined.
Related
Examples
Experiments
Analyses