Skip to content
Analog.IdealTransformer.md

Analog.IdealTransformer ​

This component extends from TwoPort

Usage ​

TranslatedComponents.Analog.IdealTransformer(n=1, Lm1=1)

Parameters: ​

NameDescriptionUnitsDefault value
considerMagnetization–false
n–1
Lm1H1

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 ​

NameDescriptionUnits
v1V
v2V
i1A
i2A
im1A
psim1Wb

Behavior ​

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

Source ​

dyad
component IdealTransformer
  extends TwoPort
  parameter n::Real = 1
  structural parameter considerMagnetization::Boolean = false
  parameter Lm1::Dyad.Inductance = 1
  variable im1::Dyad.Current
  variable psim1::Dyad.MagneticFlux
relations
  im1 = i1 + i2 / n
  if considerMagnetization
    psim1 = Lm1 * im1
    v1 = der(psim1)
  else
    psim1 = 0
    im1 = 0
  end
  v1 = n * v2
end
Flattened Source
dyad
component IdealTransformer
  p1 = Pin()
  n1 = Pin()
  p2 = Pin()
  n2 = Pin()
  variable v1::Dyad.Voltage
  variable v2::Dyad.Voltage
  variable i1::Dyad.Current
  variable i2::Dyad.Current
  parameter n::Real = 1
  structural parameter considerMagnetization::Boolean = false
  parameter Lm1::Dyad.Inductance = 1
  variable im1::Dyad.Current
  variable psim1::Dyad.MagneticFlux
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
  im1 = i1 + i2 / n
  if considerMagnetization
    psim1 = Lm1 * im1
    v1 = der(psim1)
  else
    psim1 = 0
    im1 = 0
  end
  v1 = n * v2
metadata {}
end


Test Cases ​

No test cases defined.

  • Examples

  • Experiments

  • Analyses