# Electrical Transformer with Hysteresis

This example shows how to model a custom transformer that exhibits hysteresis by using the Non Linear Reluctance block in a magnetic circuit. The transformer is rated for a 50W load and steps down from 120V to 12V rms. The magnetizing resistance Rm is modeled in the magnetic domain using an Eddy Loss block.

The transformer initially operates under no-load conditions. At time t=0.05s, the rated load is turned on. For comparison purposes, the transformer is modeled with and without hysteresis by two separate subsystems. The primary and secondary inductance values L1 and L2 plus associated winding numbers N1 and N2 are used to determine the two leakage reluctances.

The magnetic hysteresis losses are determined by calculating the total electrical power flowing into the magnetic circuit from both windings. The difference between power in and power out over a complete AC cycle reflects the hysteresis and eddy losses. In order to obtain just the hysteresis loss, the eddy loss is subtracted from the total. The loss is calculated separately for the no-load and rated load conditions.

### Model ### Transformer Subsystem ### Simulation Results from Simscape Logging

```Warning: The file containing block diagram 'ee_transformer' is shadowed by a file of the same name higher on the MATLAB path. This can cause unexpected behavior. For more information see <a href="matlab:helpview([docroot '/toolbox/simulink/helptargets.map'], 'shadowing')">"Avoiding Problems with Shadowed Files"</a> in the Simulink documentation. The file containing the block diagram is: /mathworks/devel/bat/Bdoc20a/build/matlab/toolbox/physmod/elec/eedemos/ee_transformer.slx. The file higher on the MATLAB path is: /mathworks/devel/bat/Bdoc20a/build/matlab/toolbox/physmod/elec/eedemos/html/ee_transformer.m No-load hysteresis loss = 2.3108 watts Rated-load hysteresis loss = 2.2044 watts ``` 