# getTransformerInfo

Gets the information for all transformers in the circuit

## Contents

- Syntax
- Description
- Inputs
- Outputs
- Example

## Syntax

    Transformers = getTransformerInfo(DSSCircObj)
    Transformers = getTransformerInfo(DSSCircObj, transformerNames)

## Description

Function to get the information about the transformers in the circuit and return a structure with the information. If the optional input of transformerNames is filled, the function returns information for the specified subset of transformers, excluding the miscellaneous parameters mentioned in the outputs below.

## Inputs

- `DSSCircObj` - link to OpenDSS active circuit and command text (from DSSStartup)
- `transformerNames` - optional cell array of transformer names to get information for

## Outputs

`Transformers` is a structure with all the parameters for the transformers in the active circuit. Fields are:

- name - Name of the transformer.
- bus1 - Primary bus.
- bus2 - Secondary bus.
- numPhases - Number of phases associated with the transformer.
- enabled - {1|0} indicates whether this element is enabled in the simulation.
- bus1PhasePowerReal - 3-element array of the real components of each phase's complex power at bus 1. Phases that are not present will return 0.
- bus1PhasePowerReactive - 3-element array of the imaginary components of each phase's complex power at bus 1. Phases that are not present will return 0.
- bus2PhasePowerReal - 3-element array of the real components of each phase's complex power at bus 2. Phases that are not present will return 0.
- bus2PhasePowerReactive - 3-element array of the imaginary components of each phase's complex power at bus 2. Phases that are not present will return 0.
- bus1PowerReal - Total real component at bus 1 of all present phases.
- bus1PowerReactive - Total imaginary component at bus 1 of all present phases.
- bus2PowerReal - Total real component at bus 2 of all present phases.
- bus2PowerReactive - Total imaginary component at bus 2 of all present phases.
- bus1NodeOrder, bus1Coordinates, bus1Distance, bus1PhaseVoltages, bus1PhaseVoltagesPU, bus1Voltage, bus1VoltagePU, bus1VoltagePhasors, bus1PhaseVoltagesLL, bus1PhaseVoltagesLLPU, - Information regarding the starting bus. All obtained from the corresponding fields of the structure returned by getBusInfo when called with 'bus1' as an input.
- bus2NodeOrder, bus2Coordinates, bus2Distance, bus2PhaseVoltages, bus2PhaseVoltagesPU, bus2Voltage, bus2VoltagePU, bus2VoltagePhasors, bus2PhaseVoltagePhasorsPU, bus2PhaseVoltagePhasorsPU, bus2PhaseVoltagesLL, bus2PhaseVoltagesLLPU - Information regarding the ending bus. All obtained from the corresponding fields of the structure returned by getBusInfo when called with 'bus2' as an input.
- losses - total real and imaginary power losses
- phaseLosses - real and imaginary power losses
- seqVoltages, cplxVoltages, seqCurrents, cplxSeqCurrents - zero, positive, and negative sequence voltages and currents magnitude or complex phasors
- inputkva - apparent power magnitude coming into the transformer
- controlled - Whether or not the transformer is tap-controlled.
- kva - Transformer power rating.
- XfmrCode - name of the transformer code if one is assigned
- wdg1R, wdg1Tap, wdg1minTap, wdg1maxTap, wdg1numTaps, bus1kV, isDelta - properties for the first winding of the transformer. All properties exist for the wdg2 side as well
- Xneut, Rneut, Xhl, Xht, PCTnoLoadLoss - OpenDSS Transformer properties
- CTPrimary, delay, forwardBand, forwardR, forwardVreg, forwardX, isInverseTime, _isReversible, maxTapChange, monitoredBus, PTratio, reverseBand, reverseR, reverseVreg, reverseX, tapDelay, tapWinding, voltageLimit, winding - OpenDSS properties for the RegControl object for transformers on which one is present

## Example

Returns transformer information in the circuit

    [DSSCircObj, DSSText, gridpvPath] = DSSStartup;
    DSSText.command = ['Compile "' gridpvPath 'ExampleCircuit\master_Ckt24.dss"'];
    DSSText.command = 'solve';
    Transformers = getTransformerInfo(DSSCircObj) %Get information for all transformers
    Transformers = getTransformerInfo(DSSCircObj,DSSCircObj.ActiveCircuit.Transformers.AllNames) %Get information for all transformers
    Transformers = getTransformerInfo(DSSCircObj, {'05410_g2101ak7700'}) %Get information for one transformer
    Transformers = getTransformerInfo(DSSCircObj, [{'05410_g2101ah4300'};{'05410_g2101ae2300'}]); %Get information for two transformers
    %

    Transformers =

    843x1 struct array with fields:

        name
        bus1
        bus2
        numPhases
        enabled
        bus1PhasePowerReal
        bus1PhasePowerReactive
        bus2PhasePowerReal
        bus2PhasePowerReactive
        bus1PowerReal
        bus1PowerReactive
        bus2PowerReal
        bus2PowerReactive
        bus1NodeOrder
        bus2NodeOrder
        bus1Voltage
        bus1VoltagePU
        bus1PhaseVoltages
        bus1PhaseVoltagesPU
        bus1PhaseVoltagePhasors
        bus1PhaseVoltagePhasorsPU
        bus1PhaseVoltagesLL
        bus1PhaseVoltagesLLPU
        bus1VoltageLL
        bus1VoltageLLPU
        bus2Voltage
        bus2VoltagePU
        bus2PhaseVoltages
        bus2PhaseVoltagesPU
        bus2PhaseVoltagePhasors
        bus2PhaseVoltagePhasorsPU
        bus2PhaseVoltagesLL
        bus2PhaseVoltagesLLPU
        bus2VoltageLL
        bus2VoltageLLPU
        bus1Distance
        bus2Distance
        losses
        phaseLosses
        seqVoltages
        cplxSeqVoltages
        seqCurrents
        cplxSeqCurrents
        seqPower
        inputkva
        controlled
        kva
        XfmrCode
        wdg1R
        wdg1Tap
        wdg1minTap
        wdg1maxTap
        wdg1numTaps
        bus1kV
        Xneut
        Rneut
        wdg1IsDelta
        Xhl
        Xht
        bus2kV
        wdg2R
        wdg2Tap
        wdg2minTap
        wdg2maxTap
        wdg2numTaps
        wdg2IsDelta
        PCTloadLoss
        PCTnoLoadLoss
        controller
        CTPrimary
        delay
        forwardBand
        forwardR
        forwardVreg
        forwardX
        isInverseTime
        isReversible
        maxTapChange
        monitoredBus
        PTratio
        reverseBand
        reverseR
        reverseVreg
        reverseX
        tapDelay
        tapWinding
        voltageLimit
        winding

    Transformers =

    843x1 struct array with fields:

        name
        bus1
        bus2
        numPhases
        enabled
        bus1PhasePowerReal
        bus1PhasePowerReactive
        bus2PhasePowerReal
        bus2PhasePowerReactive
        bus1PowerReal
        bus1PowerReactive
        bus2PowerReal
        bus2PowerReactive
        bus1NodeOrder
        bus2NodeOrder
        bus1Voltage
        bus1VoltagePU
        bus1PhaseVoltages
        bus1PhaseVoltagesPU
        bus1PhaseVoltagePhasors
        bus1PhaseVoltagePhasorsPU
        bus1PhaseVoltagesLL
        bus1PhaseVoltagesLLPU
        bus1VoltageLL
        bus1VoltageLLPU
        bus2Voltage
        bus2VoltagePU
        bus2PhaseVoltages
        bus2PhaseVoltagesPU
        bus2PhaseVoltagePhasors
        bus2PhaseVoltagePhasorsPU
        bus2PhaseVoltagesLL
        bus2PhaseVoltagesLLPU
        bus2VoltageLL
        bus2VoltageLLPU
        bus1Distance
        bus2Distance
        losses
        phaseLosses
        seqVoltages
        cplxSeqVoltages
        seqCurrents
        cplxSeqCurrents
        seqPower
        inputkva
        controlled
        kva
        XfmrCode
        wdg1R
        wdg1Tap
        wdg1minTap
        wdg1maxTap
        wdg1numTaps
        bus1kV
        Xneut
        Rneut
        wdg1IsDelta
        Xhl
        Xht
        bus2kV
        wdg2R
        wdg2Tap
        wdg2minTap
        wdg2maxTap
        wdg2numTaps
        wdg2IsDelta
        PCTloadLoss
        PCTnoLoadLoss
        controller
        CTPrimary
        delay
        forwardBand
        forwardR
        forwardVreg
        forwardX
        isInverseTime
        isReversible
        maxTapChange
        monitoredBus
        PTratio
        reverseBand
        reverseR
        reverseVreg
        reverseX
        tapDelay
        tapWinding
        voltageLimit
        winding

    Transformers =

                             name: '05410_g2101ak7700'
                             bus1: 'n284223.1'
                             bus2: 'g2101ak7700_n284223_sec.1'
                        numPhases: 1
                          enabled: 1
               bus1PhasePowerReal: [18.7850 0 0]
           bus1PhasePowerReactive: [4.1436 0 0]
               bus2PhasePowerReal: [-18.6304 0 0]
           bus2PhasePowerReactive: [-3.7457 0 0]
                    bus1PowerReal: 18.7850
                bus1PowerReactive: 4.1436
                    bus2PowerReal: -18.6304
                bus2PowerReactive: -3.7457
                    bus1NodeOrder: 1
                    bus2NodeOrder: 1
                      bus1Voltage: 7.6399e+03
                    bus1VoltagePU: 1.0025
                bus1PhaseVoltages: [7.6399e+03 0 0]
              bus1PhaseVoltagesPU: [1.0025 0 0]
          bus1PhaseVoltagePhasors: [1x3 double]
        bus1PhaseVoltagePhasorsPU: [1x3 double]
              bus1PhaseVoltagesLL: [7.6399e+03 0 0]
            bus1PhaseVoltagesLLPU: [1.0025 0 0]
                    bus1VoltageLL: 7.6399e+03
                  bus1VoltageLLPU: 1.0025
                      bus2Voltage: 239.4107
                    bus2VoltagePU: 0.9992
                bus2PhaseVoltages: [239.4107 0 0]
              bus2PhaseVoltagesPU: [0.9992 0 0]
          bus2PhaseVoltagePhasors: [1x3 double]
        bus2PhaseVoltagePhasorsPU: [1x3 double]
              bus2PhaseVoltagesLL: [239.4107 0 0]
            bus2PhaseVoltagesLLPU: [0.9992 0 0]
                    bus2VoltageLL: 239.4107
                  bus2VoltageLLPU: 0.9992
                     bus1Distance: 7.5266
                     bus2Distance: 7.5266
                           losses: 0.1546 + 0.3980i
                      phaseLosses: 0.1546 + 0.3980i
                      seqVoltages: [1 1 1 1 1 1]
                  cplxSeqVoltages: [-1 0 -1 0 -1 0 -1 0 -1 0 -1 0]
                      seqCurrents: [1 1 1 1 1 1]
                  cplxSeqCurrents: [-1 0 -1 0 -1 0 -1 0 -1 0 -1 0]
                         seqPower: [-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1]
                         inputkva: 19.2366
                       controlled: 0
                              kva: 50
                         XfmrCode: ''
                            wdg1R: 0.0044
                          wdg1Tap: 1
                       wdg1minTap: 0.9000
                       wdg1maxTap: 1.1000
                      wdg1numTaps: 32
                           bus1kV: 7.6210
                            Xneut: 0
                            Rneut: -1
                      wdg1IsDelta: 0
                              Xhl: 0.0203
                              Xht: 0.3000
                           bus2kV: 0.2400
                            wdg2R: 0.0044
                          wdg2Tap: 1
                       wdg2minTap: 0.9000
                       wdg2maxTap: 1.1000
                      wdg2numTaps: 32
                      wdg2IsDelta: 0
                      PCTloadLoss: 0.8770
                    PCTnoLoadLoss: 0.8770