SaturatingInductor
Inductor model exhibiting magnetic saturation.
Represents an inductor where the inductance value decreases as the current increases, simulating the effect of magnetic core saturation. The model defines the inductance L_actual
as a function of current i
, transitioning from L_zero
(inductance at zero current) to L_inf
(inductance at large currents). The relationship between magnetic flux (\psi
), current (i
), and voltage (v
) is governed by:
where I_par
is a characteristic current derived from nominal values:
This component extends from OnePort
Usage
SaturatingInductor(I_nominal=1, L_nominal=1, L_zero=2*L_nominal, L_inf=L_nominal/2, I_par=I_nominal/tan((L_nominal-L_inf)/(L_zero-L_inf)))
Parameters:
Name | Description | Units | Default value |
---|---|---|---|
I_nominal | Nominal operating current for defining saturation characteristics. | A | 1 |
L_nominal | Inductance value at the nominal current I_nominal. | H | 1 |
L_zero | Inductance value at or near zero current (maximum inductance). | H | 2 * L_nominal |
L_inf | Inductance value at large currents (fully saturated inductance, minimum inductance). | H | L_nominal / 2 |
Connectors
Variables
Name | Description | Units |
---|---|---|
v | Voltage across the component (between pin p and pin n). | V |
i | Current flowing through the component (from pin p to pin n). | A |
L_actual | The actual current-dependent inductance of the component (psi/i). | H |
psi | The magnetic flux linking the inductor windings. | Wb |
Behavior
Source
# Inductor model exhibiting magnetic saturation.
#
# Represents an inductor where the inductance value decreases as the current increases,
# simulating the effect of magnetic core saturation. The model defines the inductance
# `L_actual` as a function of current `i`, transitioning from `L_zero` (inductance at
# zero current) to `L_inf` (inductance at large currents). The relationship between
# magnetic flux (`\psi`), current (`i`), and voltage (`v`) is governed by:
# ```math
# L_{actual} = L_{inf} + (L_{zero} - L_{inf}) \frac{atan(i/I_{par})}{i/I_{par}}
# ```
# ```math
# \psi = L_{inf}i + (L_{zero} - L_{inf})I_{par}atan(i/I_{par})
# ```
# ```math
# v = \frac{d\psi}{dt}
# ```
# where `I_par` is a characteristic current derived from nominal values:
# ```math
# I_{par} = \frac{I_{nominal}}{tan(\frac{L_{nominal} - L_{inf}}{L_{zero} - L_{inf}})}
# ```
component SaturatingInductor
extends OnePort
# Nominal operating current for defining saturation characteristics.
parameter I_nominal::Current = 1
# Inductance value at the nominal current I_nominal.
parameter L_nominal::Inductance = 1
# Inductance value at or near zero current (maximum inductance).
parameter L_zero::Inductance = 2*L_nominal
# Inductance value at large currents (fully saturated inductance, minimum inductance).
parameter L_inf::Inductance = L_nominal/2
# The actual current-dependent inductance of the component (psi/i).
variable L_actual::Inductance
# The magnetic flux linking the inductor windings.
variable psi::MagneticFlux
# Characteristic current parameter used in the saturation function, derived from other inductance and current parameters.
final parameter I_par::Current = I_nominal/tan((L_nominal-L_inf)/(L_zero-L_inf))
relations
# assert L_zero > L_nominal "L_zero $(L_zero) should be greater than L_nominal $(L_nominal)"
# assert L_inf < L_nominal "Linf $(Linf) should be less than L_nominal $(L_nominal)"
L_actual = L_inf+(L_zero-L_inf)*atan(i/I_par)/(i/I_par)
psi = L_inf*i+(L_zero-L_inf)*I_par*atan(i/I_par)
v = der(psi)
end
Flattened Source
# Inductor model exhibiting magnetic saturation.
#
# Represents an inductor where the inductance value decreases as the current increases,
# simulating the effect of magnetic core saturation. The model defines the inductance
# `L_actual` as a function of current `i`, transitioning from `L_zero` (inductance at
# zero current) to `L_inf` (inductance at large currents). The relationship between
# magnetic flux (`\psi`), current (`i`), and voltage (`v`) is governed by:
# ```math
# L_{actual} = L_{inf} + (L_{zero} - L_{inf}) \frac{atan(i/I_{par})}{i/I_{par}}
# ```
# ```math
# \psi = L_{inf}i + (L_{zero} - L_{inf})I_{par}atan(i/I_{par})
# ```
# ```math
# v = \frac{d\psi}{dt}
# ```
# where `I_par` is a characteristic current derived from nominal values:
# ```math
# I_{par} = \frac{I_{nominal}}{tan(\frac{L_{nominal} - L_{inf}}{L_{zero} - L_{inf}})}
# ```
component SaturatingInductor
# Positive electrical pin.
p = Pin() [{
"Dyad": {
"placement": {"icon": {"iconName": "pos", "x1": -50, "y1": 450, "x2": 50, "y2": 550}}
}
}]
# Negative electrical pin.
n = Pin() [{
"Dyad": {
"placement": {"icon": {"iconName": "neg", "x1": 950, "y1": 450, "x2": 1050, "y2": 550}}
}
}]
# Voltage across the component (between pin p and pin n).
variable v::Voltage
# Current flowing through the component (from pin p to pin n).
variable i::Current
# Nominal operating current for defining saturation characteristics.
parameter I_nominal::Current = 1
# Inductance value at the nominal current I_nominal.
parameter L_nominal::Inductance = 1
# Inductance value at or near zero current (maximum inductance).
parameter L_zero::Inductance = 2*L_nominal
# Inductance value at large currents (fully saturated inductance, minimum inductance).
parameter L_inf::Inductance = L_nominal/2
# The actual current-dependent inductance of the component (psi/i).
variable L_actual::Inductance
# The magnetic flux linking the inductor windings.
variable psi::MagneticFlux
# Characteristic current parameter used in the saturation function, derived from other inductance and current parameters.
final parameter I_par::Current = I_nominal/tan((L_nominal-L_inf)/(L_zero-L_inf))
relations
v = p.v-n.v
i = p.i
p.i+n.i = 0
# assert L_zero > L_nominal "L_zero $(L_zero) should be greater than L_nominal $(L_nominal)"
# assert L_inf < L_nominal "Linf $(Linf) should be less than L_nominal $(L_nominal)"
L_actual = L_inf+(L_zero-L_inf)*atan(i/I_par)/(i/I_par)
psi = L_inf*i+(L_zero-L_inf)*I_par*atan(i/I_par)
v = der(psi)
metadata {}
end
Test Cases
This is setup code, that must be run before each test case.
using ElectricalComponents
using ModelingToolkit, OrdinaryDiffEqDefault
using Plots
using CSV, DataFrames
snapshotsdir = joinpath(dirname(dirname(pathof(ElectricalComponents))), "test", "snapshots")
"/home/actions-runner-10/.julia/packages/ElectricalComponents/bmmPM/test/snapshots"
Related
Examples
Experiments
Analyses
Tests