# findDownstreamBuses

Finds all buses downstream of the busName

## Contents

- Syntax
- Description
- Inputs
- Outputs
- Example

## Syntax

    downstreamBuses = findDownstreamBuses(DSSCircObj,busName);
    downstreamBuses = findDownstreamBuses(DSSCircObj,busName, _'PropertyName'_ ,PropertyValue);

## Description

Function to get all the bus names for buses that are downstream of the busName. The downstream buses are defined as buses that are farther from the substation on the electrical path of busName.

## Inputs

- `DSSCircObj` - link to OpenDSS active circuit and command text (from DSSStartup)
- `busName` - string of the bus name to start search downstream
- `Properties` - optional properties as one or more name-value pairs in any order
- -- `'Lines'` - Structure of the circuit lines from getLineInfo. If no input is given, the structure is filled from the most current power flow solution in DSSCircObj COM.
- -- `'Transformers'` - Structure of the circuit transformers from getTransformerInfo. If no input is given, the structure is filled from the most current power flow solution in DSSCircObj COM.

## Outputs

- `downstreamBuses` is a cell array of the bus names downstream from busName

## Example

Returns downstream buses

    [DSSCircObj, DSSText, gridpvPath] = DSSStartup;
    DSSText.command = ['Compile "' gridpvPath 'ExampleCircuit\master_Ckt24.dss"'];
    DSSText.command = 'solve';
    downstreamBuses = findDownstreamBuses(DSSCircObj,'N292792')
    %

    downstreamBuses =

        'n292792'
        'n292783'
        'g2101fk7100_n292792_sec'
        'n292782'
        'g2101fj5700_n292783_sec'
        'g2101fk7100_n292792_sec_1'
        'g2101fk7100_n292792_sec_2'
        'g2101fk7100_n292792_sec_3'
        'g2101fk7100_n292792_sec_4'
        'g2101fk7100_n292792_sec_5'
        'n292769'
        'g2101fj5700_n292783_sec_1'
        'g2101fj5700_n292783_sec_2'
        'g2101fj5700_n292783_sec_3'
        'g2101fj5700_n292783_sec_4'
        'g2101fj5700_n292783_sec_5'
        'g2101fj5700_n292783_sec_6'
        'n292752'