Main Content

A Comparison of the Mutual Inductor and Ideal Transformer Library Blocks

This example shows the differences in behavior between the Mutual Inductor and Ideal Transformer blocks in the Simscape™ Foundation Library. These two blocks both represent the same system of electromagnetically-coupled windings but make different simplifying assumptions. It is important to understand the assumptions and how they impact model fidelity as a function of frequency. With this, you can make an informed decision about which block to use in a model of your circuit.

To understand the differences, it is best to start with the underlying physics which is most naturally expressed using a magnetic equivalent circuit.

Magnetic Circuit

The model below shows an electromagnetic equivalent circuit of two magnetically-coupled electrical windings. The circuit is implemented by model MagneticEquivalentCircuit.slx.

open_system("MagneticEquivalentCircuit.slx")

The equivalent circuit is implemented using Simscape™ Foundation Library magnetic components. The two electromagnetic converter blocks connect the electrical and magnetic domains with the following equations:

F= NI

V= -NdΦ/dt

where F is the magnetomotive force (mmf) across the magnetic ports, Nis the number of winding turns, I is the current flowing from positive to negative electrical ports, V is the voltage across the electical ports, and Φ is the flux flowing from the north to the south magnetic ports. The crossed magnetic connection lines ensure that the two sets of electrical ports align with the polarity of the electrical ports on the Mutual Inductor and Ideal Transformer blocks.

Blocks R1, R2, and Rc represent magnetic reluctances which are governed by the equation:

F = Φ (R)

where ®(R) is the reluctance value. A reluctance is a magnetic energy store and hence R1, R2, and Rc introduce dynamics to the relationship between the two sets of electrical connections. Reluctance Rc represents the reluctance of the main magnetic path coupling the two windings. From the reluctance equation above, you can see that the larger the reluctance, the greater the magnetomotive force (F) required to create a given level of flux. In turn, the equations for the electromagnetic converter show that a larger magnetomotive force requires a larger winding current, and that the induced voltage is proportional to the rate of change flux. Seen from the electrical connections, this is the so-called magnetizing inductance.

Reluctances R1 and R2 are leakage reluctances. It can be seen from their parallel connection to the two electromagnetic converters that they divert flux away from the main magnetic path coupling the two windings. Seen from the electrical connections, these are mathematically equivalent to leakage inductances connected in series with the two windings.

Ideal Transformer

For an ideal transformer, all of the reluctances are neglected. The leakage reluctances R1 and R2 are assumed infinity (no leakage losses). The main magnetic path reluctance is assumed zero. This gives this modified magnetic shown below which is a screenshot of model MagneticEquivalentCircuitIdealTransformer.slx.

open_system("MagneticEquivalentCircuitIdealTransformer.slx")

There are now no dynamics as there are no reluctances and hence there is no stored energy. The equations for the two electromagnetic converters are:

F1= N1I1

V1 = -N1dΦ1/dt

F2= N2I2

V2 = -N2dΦ2/dt

From the circuit, there are two constraint equations:

F1=-F2

Φ1=Φ2

Eliminating F1, F2, Φ1, and Φ2 from these six equations gives the ideal transformer equations implemented by the Simscape Foundation Library Ideal Transformer block where the winding ratio is given by N1/N2 :

N1I1=-N2I2

V1/N1=V2/N2

Neglecting all reluctances has an important impact on the transformer frequency response:

  • Neglecting the main magnetic path reluctance Rc has resulted in the ideal transformer passing DC currents. A real transformer, of course, doesn't do this.

  • Passing DC means that the primary and secondary are not galvanically isolated which could result in incorrect simulation results if the circuit design relies on this isolation.

  • Neglecting the two leakage reluctances R1 and R2 has resulted in the ideal transformer transmitting high-frequency AC. A real transformer would attenuate at high frequencies, but be designed to have small attenuation at the circuit operating frequency e.g. 60Hz.

  • Not attenuating at high frequency will have an effect at the lower operating frequency in that the lag associated with the leakage terms is not modeled.

Transformer

It is possible to add back in the lost dynamics to an Ideal Transformer by adding external inductances. The circuit below, which is a screenshot of model ElectricalEquivalentCircuitTransformer.slx, shows how.

open_system("ElectricalEquivalentCircuitTransformer.slx")

The leakage inductances l1 and l2 correspond to leakage reluctances R1 and R2 and are related by these two equations:

l1=N12/(R)1

l2=N22/(R)2

The magnetizing inductor Lm corresponds to the main magnetic path reluctance Rc and is related by the equation:

Lm=N12/(R)c

The Simscape Electrical™ Nonlinear Transformer library block adds these inductive terms plus winding resistance values. Blocking of DC arises from the magnetizing inductance behaving like a short circuit at low frequency, which results in zero voltage across both ideal transformer windings.

Mutual Inductor

The Simscape Foundation Library Mutual Inductor block (see diagram below) implements the following two equations:

V1 = L1dI1/dt + MdI2/dt

V2 = L2dI2/dt + MdI1/dt

where V1 is the primary input voltage, I1 is the primary input current, V2 is the secondary output voltage, and I2 is the secondary input current. The two inductances L1 and L2 are the winding inductances and not to be confused with leakage inductances associated with the transformer model. The mutual inductance, M, defines the coupling level between primary and secondary windings. The coefficient of coupling is defined as k=M/L1L2.

open_system("ElectricalEquivalentCircuitMutualInductor.slx")

By comparing the mutual inductor equations above with magnetic circuit equations above, it can be shown that the circuit parameters are related by the follow four equations:

L1=N12(1/(Rc)+1/(R1)

L2=N22(1/(Rc)+1/(R2)

M=N1N2/(R)c

k=1((1+(R)c/(R)1)(1+(R)c/(R)2))

There have been no simplifying assumptions applied and hence the Mutual Inductor has identical behavior to the magnetic circuit used as the starting point above. Therefore, it:

  • Does not pass DC.

  • Galvanically isolates primary and secondary circuits.

  • Attenuates high frequency transmission between primary and secondary windings.

Mutual Inductor (Simplified/No Leakage Case)

The Mutual Inductor equations, while defining the same behavior as the original magnetic circuit, do not simplify in the same way. It is not possible to remove the effect of finite core reluctance (R)C by setting it to zero as this results in infinite inductance values for L1 and L2 due to the 1/(Rc) term in the equations relating the parameters. Removing the leakage effects by making (R)1 and (R2)2 infinite results in L1=N12/(Rc), L2=N22/(Rc), and k=1 which looks more promising. However, these values, when used in the Mutual Inductor defining equations, result in an infinitely fast pole which cannot be simulated. Root cause of the infinite pole is two differential equations which define the same behavior through a constraint. Rewriting the equations to remove one of the differential equations results in the following equations used by the Mutual Inductor block when checking the Perfect coupling (no leakage) checkbox:

V1 = L1dI1/dt + (L1L2)dI2/dt

V2=L2/L1V1

Example

Transformer Data

% Magnetic parameters
R1 = 1e6; % Primary leakage reluctance (1/H)
R2 = 1e6; % Secondary leakage reluctance (1/H)
Rc = 0.1e6; % Core reluctance (1/H)
N1 = 100; % Number of primary winding turns
N2 = 500; % Number of secondary winding turns

% Derived parameters for the Ideal Transformer block
ratio = N1/N2;

% Additional components to add dynamics back to the Ideal Transformer
l1 = N1^2/R1; % Primary leakage inductance (H)
l2 = N2^2/R2; % Secondary leakage inductance (H)
Lm = N1^2/Rc; % Magnetizing inductance (H)

% Derived parameters for the Mutual Inductor block
L1 = N1^2*(1/Rc + 1/R1); % Primary inductance (H)
L2 = N2^2*(1/Rc + 1/R2); % Secondary inductance (H)
M = N1*N2/Rc; % Mutual inductance (H)
k = 1/sqrt((1+Rc/R1)*(1+Rc/R2)); % Coefficient of coupling

Test Harness

Model compareCircuits.slx implements a test harness that exercises all of equivalent circuits described above. This test harness can be used to generate time and frequency response results.

r1 = 1; % Primary circuit resistance
r2 = 1; % Secondary circuit resistance
vStep = 1; % Step voltage applied to primary
tStep = 2; % Time at which step applied
open_system("CompareCircuits")

Time Response

Here time simulation of the test harness is used to generate a plot of the secondary winding currents following a step in the voltage applied to the primary windings.

out = sim("CompareCircuits.slx");
titles = {'Magnetic Circuit','Ideal Transformer','Transformer',...
    'Mutual Inductor','Mutual Inductor (Perfect coupling - no leakage)'};
figure
for i=1:5
    subplot(5,1,i)
    out.yout{i}.Values.plot
    ylabel(sprintf('Secondary\ncurrent (A)'))
    title(titles{i})
end

Figure contains 5 axes objects. Axes object 1 with title Magnetic Circuit, xlabel Time (seconds), ylabel Secondary current (A) contains an object of type line. Axes object 2 with title Ideal Transformer, xlabel Time (seconds), ylabel Secondary current (A) contains an object of type line. Axes object 3 with title Transformer, xlabel Time (seconds), ylabel Secondary current (A) contains an object of type line. Axes object 4 with title Mutual Inductor, xlabel Time (seconds), ylabel Secondary current (A) contains an object of type line. Axes object 5 with title Mutual Inductor (Perfect coupling - no leakage), xlabel Time (seconds), ylabel Secondary current (A) contains an object of type line.

Notice that, as explained above, the Ideal Transformer transmits DC and hence the secondary current does not decay. Furthermore, the change in current is instantaneous due to the main core reluctance dynamics not being modeled. All of the other equivalent circuits do block DC.

Frequency Response

A better way to view and understand the differences between the different equivalent circuits is to generate a frequency response for each case.

% Linearize the model
sys = linmod("CompareCircuits");

% Bode plot
npts = 100; % Number of points
w = logspace(-3,4,npts); % Vector of frequencies (radians/s)
G = zeros(1,npts); % Frequency response (A/V)
for j=1:5 % Loop over the five equivalent circuits
    for i=1:npts % Determine response at all values in vector w                                                      
        G(i) = sys.c(j,:)*(1i*w(i)*eye(size(sys.a))-sys.a)^-1*sys.b(:,j) + sys.d(j,j);                      
    end
    disp(['Generating Bode plot for the ' titles{j} ' equivalent circuit:'])
    figure
    subplot(2,1,1);
    semilogx(w,20*log10(abs(G)));
    grid on
    ylabel('Magnitude (dB)');
    title(titles{j});
    subplot(2,1,2);
    semilogx(w,180/pi*unwrap(angle(G)));
    ylabel('Phase (deg)'); 
    xlabel('Frequency (rad/s)');
    grid on
end
Generating Bode plot for the Magnetic Circuit equivalent circuit:

Figure contains 2 axes objects. Axes object 1 with title Magnetic Circuit, ylabel Magnitude (dB) contains an object of type line. Axes object 2 with xlabel Frequency (rad/s), ylabel Phase (deg) contains an object of type line.

Generating Bode plot for the Ideal Transformer equivalent circuit:

Figure contains 2 axes objects. Axes object 1 with title Ideal Transformer, ylabel Magnitude (dB) contains an object of type line. Axes object 2 with xlabel Frequency (rad/s), ylabel Phase (deg) contains an object of type line.

Generating Bode plot for the Transformer equivalent circuit:

Figure contains 2 axes objects. Axes object 1 with title Transformer, ylabel Magnitude (dB) contains an object of type line. Axes object 2 with xlabel Frequency (rad/s), ylabel Phase (deg) contains an object of type line.

Generating Bode plot for the Mutual Inductor equivalent circuit:

Figure contains 2 axes objects. Axes object 1 with title Mutual Inductor, ylabel Magnitude (dB) contains an object of type line. Axes object 2 with xlabel Frequency (rad/s), ylabel Phase (deg) contains an object of type line.

Generating Bode plot for the Mutual Inductor (Perfect coupling - no leakage) equivalent circuit:

Figure contains 2 axes objects. Axes object 1 with title Mutual Inductor (Perfect coupling - no leakage), ylabel Magnitude (dB) contains an object of type line. Axes object 2 with xlabel Frequency (rad/s), ylabel Phase (deg) contains an object of type line.

Comparing the frequency plots, you can see that the Magnetic Circuit, Transformer and Mutual Inductor all have identical plots with attenuation at both low and high frequency. However, the Ideal Transformer has no attenuation at low frequency and no attenuation at high frequency, whereas the Mutual Inductor (Perfect coupling - no leakage) attenuates at low frequency, but not at high frequency. These differences are imporant to consider when deciding which block to use when modeling a particular application.