# getLineInfo

Gets the information for all lines in the circuit

## Contents

- Syntax
- Description
- Inputs
- Outputs
- Example

## Syntax

    Lines = getLineInfo(DSSCircObj);
    Lines = getLineInfo(DSSCircObj, lineNames);

## Description

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

## Inputs

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

## Outputs

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

- name - Name of the line.
- bus1 - Name of the starting bus.
- bus2 - Name of the ending bus.
- 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.
- bus1Current - Average current magnitude for all included phases on bus 1.
- bus2Current - Average current magnitude for all included phases on bus 2.
- bus1PhaseCurrent - Current magnitude for each included phases on bus 1.
- bus2PhaseCurrent - Current magnitude for each included phases on bus 2.
- numPhases - Number of phases associated with the line.
- numConductors - Number of conductors associated with the line.
- lineRating - The line's current rating.
- losses - total real and imaginary power losses
- phaseLosses - real and imaginary power losses
- 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.
- parentObject - name of the line or object directly upstream (parent) of the line
- lineCode, length, R1, X1, R0, X0, C1, C0, Rmatrix, Xmatrix, Cmatrix, emergAmps, geometry, Rg, Xg, Rho, Yprim, numCust, totalCust, spacing - OpenDSS line object properties

## Example

Returns line information in the circuit

    [DSSCircObj, DSSText, gridpvPath] = DSSStartup;
    DSSText.command = ['Compile "' gridpvPath 'ExampleCircuit\master_Ckt24.dss"'];
    DSSText.command = 'solve';
    Lines = getLineInfo(DSSCircObj) %Get information for all lines
    Lines = getLineInfo(DSSCircObj,DSSCircObj.ActiveCircuit.Lines.AllNames) %Get information for all lines
    Lines = getLineInfo(DSSCircObj, {'g2102cg5800_n284428_sec_1'}); %Get information for a single line
    Lines = getLineInfo(DSSCircObj,[{'05410_8168450ug'};{'05410_52308181oh'}]); %Get info for two lines
    %

    Lines =

    5221x1 struct array with fields:

        name
        bus1
        bus2
        enabled
        bus1PhasePowerReal
        bus1PhasePowerReactive
        bus2PhasePowerReal
        bus2PhasePowerReactive
        bus1PowerReal
        bus1PowerReactive
        bus2PowerReal
        bus2PowerReactive
        bus1Current
        bus2Current
        bus1PhaseCurrent
        bus2PhaseCurrent
        numPhases
        numConductors
        lineRating
        losses
        phaseLosses
        bus1NodeOrder
        bus2NodeOrder
        bus1Coordinates
        bus1Distance
        bus1CoordDefined
        bus1VoltageAngle
        bus1Voltage
        bus1VoltagePU
        bus1PhaseVoltages
        bus1PhaseVoltagesPU
        bus1PhaseVoltagePhasors
        bus1PhaseVoltagePhasorsPU
        bus1PhaseVoltagesLL
        bus1PhaseVoltagesLLPU
        bus1VoltageLL
        bus1VoltageLLPU
        bus1Zsc1
        bus1Zsc0
        bus2Coordinates
        bus2Distance
        bus2CoordDefined
        bus2VoltageAngle
        bus2Voltage
        bus2VoltagePU
        bus2PhaseVoltages
        bus2PhaseVoltagesPU
        bus2PhaseVoltagePhasors
        bus2PhaseVoltagePhasorsPU
        bus2PhaseVoltagesLL
        bus2PhaseVoltagesLLPU
        bus2VoltageLL
        bus2VoltageLLPU
        bus2Zsc1
        bus2Zsc0
        parentObject
        lineCode
        length
        R1
        X1
        R0
        X0
        C1
        C0
        Rmatrix
        Xmatrix
        Cmatrix
        emergAmps
        geometry
        Rg
        Xg
        Rho
        Yprim
        numCust
        totalCust
        spacing
        units

    Lines =

    5221x1 struct array with fields:

        name
        bus1
        bus2
        enabled
        bus1PhasePowerReal
        bus1PhasePowerReactive
        bus2PhasePowerReal
        bus2PhasePowerReactive
        bus1PowerReal
        bus1PowerReactive
        bus2PowerReal
        bus2PowerReactive
        bus1Current
        bus2Current
        bus1PhaseCurrent
        bus2PhaseCurrent
        numPhases
        numConductors
        lineRating
        losses
        phaseLosses
        bus1NodeOrder
        bus2NodeOrder
        bus1Coordinates
        bus1Distance
        bus1CoordDefined
        bus1VoltageAngle
        bus1Voltage
        bus1VoltagePU
        bus1PhaseVoltages
        bus1PhaseVoltagesPU
        bus1PhaseVoltagePhasors
        bus1PhaseVoltagePhasorsPU
        bus1PhaseVoltagesLL
        bus1PhaseVoltagesLLPU
        bus1VoltageLL
        bus1VoltageLLPU
        bus1Zsc1
        bus1Zsc0
        bus2Coordinates
        bus2Distance
        bus2CoordDefined
        bus2VoltageAngle
        bus2Voltage
        bus2VoltagePU
        bus2PhaseVoltages
        bus2PhaseVoltagesPU
        bus2PhaseVoltagePhasors
        bus2PhaseVoltagePhasorsPU
        bus2PhaseVoltagesLL
        bus2PhaseVoltagesLLPU
        bus2VoltageLL
        bus2VoltageLLPU
        bus2Zsc1
        bus2Zsc0
        parentObject
        lineCode
        length
        R1
        X1
        R0
        X0
        C1
        C0
        Rmatrix
        Xmatrix
        Cmatrix
        emergAmps
        geometry
        Rg
        Xg
        Rho
        Yprim
        numCust
        totalCust
        spacing
        units