# circuitCheck

Used to error-check the circuit for any obvious abnormalities.

## Contents

- Syntax
- Description
- Inputs
- Outputs
- Example

## Syntax

    warnSt = circuitCheck(DSSCircObj);
    warnSt = circuitCheck(DSSCircObj,'Warnings','off');

## Description

Used for checking OpenDSS circuits for errors or abnormalities that do not prevent OpenDSS from running but will cause errors during analysis (e.g. Phase-a line downstream of a bus with only phases b and c). It is capable of performing a complete circuit check with a warning describing each error found. Warnings can be turned off. A more comprehensive list of elements that cause the errors can be found inside the structure, warnSt, that is outputted at the end of the check.

## Inputs

- `DSSCircObj` - link to OpenDSS active circuit and command text (from DSSStartup)
- `'Warnings'` - indicates if the user wants command-prompt warnings on or not `{'on'} | 'off'`

## Outputs

- `warnSt` is a structure with parameters relating to the results of various validity check. If the circuit failed a check, an entry for that check appears in this structure with fields for the check name, a string with the description, and a list of offenders that caused the fail.

## Example

Example of a circuit test:

    [DSSCircObj, DSSText, gridpvPath] = DSSStartup;
    DSSText.command = ['Compile "' gridpvPath 'ExampleCircuit\master_Ckt24.dss"'];
    DSSText.command = 'solve';
    warnSt = circuitCheck(DSSCircObj)
    warnSt = circuitCheck(DSSCircObj, 'Warnings', 'off');
    %

    warnSt =

                        Loops: [1x1 struct]
             MissingBusCoords: [1x1 struct]
        TransformerOverloaded: [1x1 struct]
            TransformerNoLoad: [1x1 struct]
           TransformerLowLoad: [1x1 struct]
           LineRatingMismatch: [1x1 struct]