Saving and exporting circuits#

OpenDSS has a command to save the current circuit, e.g. save circuit dir=some/path/.

During the development of the JSON functions for whole circuits (Circuit.ToJSON() and Circuit.FromJSON()) on DSS-Extensions, we took the oportunity to add some options to the save command, exposing it as a new function in API. This is thus avaiable in most projects under DSS-Extensions. Since many third-party software use OpenDSSDirect.py to inspect and export data, this is being added to the ODD.py documentation, but most of the information here applies to other Python packages and other projects in general on DSS-Extensions.

The options are controlled through a bitmask integer, with the options from DSSSaveFlags, as documented in the API reference for Circuit.Save().

This notebook shows some examples of the options.

If you have a suggestion for new flags, please feel free to suggest on GitHub, either through the ODD.py issues, or general issues/discussions on dss-extensions/dss-extensions

Remember that both the save circuit command and the function used here export snapshots of the circuit. If the original .DSS script is a complete simulation, if won’t be tracked, currently.

Another limitation is that some file references are kept as-is. This is not typically an issue since most fields are read into numeric fields, which are exported OK.

Notebook requirements

# When running via Colab, install the package first
import os, subprocess
if os.getenv("COLAB_RELEASE_TAG"):
    print(subprocess.check_output('pip install opendssdirect.py[extras]', shell=True).decode())

# Download the sample circuits and test cases if they do not exist already
from dss.examples import download_repo_snapshot
REPO_PATH = download_repo_snapshot('.', repo_name='electricdss-tst', use_version=False)
IEEE13_PATH = REPO_PATH / 'Version8/Distrib/IEEETestCases/13Bus/IEEE13Nodeckt.dss'
assert IEEE13_PATH.exists()

The Circuit.Save function#

It takes two arguments, a path for the file or directory to be used (if not saving to a string), and the options. It returns the DSS script as a string if SingleFile|ToString is used.

from dss import DSSSaveFlags
from opendssdirect import dss as odd
from IPython.display import display, Markdown
from textwrap import dedent
? odd.Circuit.Save
display(Markdown(dedent(odd.Circuit.Save.__doc__)))

Equivalent of the “save circuit” DSS command, but allows customization through the saveFlags argument, which is a set of bit flags. See the “DSSSaveFlags” enumeration for available flags:

  • CalcVoltageBases: Include the command CalcVoltageBases.

  • SetVoltageBases: Include commands to set the voltage bases individually.

  • IncludeOptions: Include most of the options (from the Set/Get DSS commands).

  • IncludeDisabled: Include disabled circuit elements (and LoadShapes).

  • ExcludeDefault: Exclude default DSS items if they are not modified by the user.

  • SingleFile: Use a single file instead of a folder for output.

  • KeepOrder: Save the circuit elements in the order they were loaded in the active circuit. Guarantees better reproducibility, especially when the system is ill-conditioned. Requires “SingleFile” flag.

  • ExcludeMeterZones: Do not export meter zones (as “feeders”) separately. Has no effect when using a single file.

  • IsOpen: Export commands to open terminals of elements.

  • ToString: to the result string. Requires “SingleFile” flag.

If SingleFile is enabled, the first argument (dirOrFilePath) is the file path, otherwise it is the folder path. For string output, the argument is not used.

(API Extension)

Saving to a folder#

This is equivalent to the save circuit dir=save_dir. Inspect the save_dir folder after running it.

# Don't forget to load a circuit first:
odd(f'redirect "{IEEE13_PATH}"')
print('Saving to', str(REPO_PATH / 'save_dir'))
Saving to /tmp/dss/OpenDSSDirect.py/docs/notebooks/electricdss-tst/save_dir
odd.Circuit.Save(str(REPO_PATH / 'save_dir'), 0)
''

Saving to a single file#

Saving to a single file can be useful to simplify copying the circuit. Sometimes the circuit is small enough that it can useful to keep everything in the same file.

Note that DSS-Extensions introduced a few lines always exported by default, since they are common sources of issues:

  • A comment with the version of the engine, making it clear what was used and/or what is the target of the script. Although OpenDSS doesn’t change frequently, it can break compatibility from time to time, and AltDSS/DSS C-API follows most of this kind of decision from the official OpenDSS (for compatibility and so on).

  • It always sets the DefaultBaseFreq. New users frequently stumble on issues like loading a 50 Hz circuit on OpenDSS, followed by a 60 Hz circuit (which doesn’t explicitly set this).

  • Similarly, it always sets the EarthModel.

As suggested in the options, CalcVoltageBases is not included by default since many system require more careful handling of the base voltages than what CalcVoltageBases provides. If the user is sure that the circuit is fine with CalcVoltageBases, the option can be used or the general compatibility flag can be configured in Basic.CompatFlags() function.

odd.Circuit.Save('saved_circuit.dss', DSSSaveFlags.SingleFile)
with open('saved_circuit.dss', 'r') as f:
    saved_data = f.read()

print(saved_data)
! Last saved by AltDSS/DSS C-API Library version 0.14.1 revision 8b3da5b576f4dedd16d2bfb88bfb911c0aca3783 based on OpenDSS SVN 3723 [FPC 3.2.2] (64-bit build) MVMULT INCREMENTAL_Y CONTEXT_API PM 20240217013457 on 2024-02-25T18:46:21.539Z
Clear
Set DefaultBaseFreq=60
New Circuit.ieee13nodeckt

Set EarthModel=Deri

New "LineCode.1" NPhases=3 BaseFreq=60 RMatrix=[0.086666667000000003 |0.029545455000000002 0.088371212000000005 |0.029071969999999999 0.029924242 0.087405303000000004 ] XMatrix=[0.204166667 |0.095018938999999997 0.19852272700000001 |0.072897726999999996 0.080227273000000002 0.20172348500000001 ] CMatrix=[2.8517100719999999 |-0.92029378699999997 3.0046318620000001 |-0.35075556600000002 -0.58501125300000001 2.7113475600000001 ]
New "LineCode.2" NPhases=3 BaseFreq=60 RMatrix=[0.088371212000000005 |0.029924240000000001 0.087405303000000004 |0.029545455000000002 0.029071969999999999 0.086666667000000003 ] XMatrix=[0.19852272700000001 |0.080227273000000002 0.20172348500000001 |0.095018938999999997 0.072897726999999996 0.204166667 ] CMatrix=[3.0046318620000001 |-0.58501125300000001 2.7113475600000001 |-0.92029378699999997 -0.35075556600000002 2.8517100719999999 ]
New "LineCode.3" NPhases=3 BaseFreq=60 RMatrix=[0.087405303000000004 |0.029071969999999999 0.086666667000000003 |0.029924242 0.029545455000000002 0.088371212000000005 ] XMatrix=[0.20172348500000001 |0.072897726999999996 0.204166667 |0.080227273000000002 0.095018938999999997 0.19852272700000001 ] CMatrix=[2.7113475600000001 |-0.35075556600000002 2.8517100719999999 |-0.58501125300000001 -0.92029378699999997 3.0046318620000001 ]
New "LineCode.4" NPhases=3 BaseFreq=60 RMatrix=[0.087405303000000004 |0.029924242 0.088371212000000005 |0.029071969999999999 0.029545455000000002 0.086666667000000003 ] XMatrix=[0.20172348500000001 |0.080227273000000002 0.19852272700000001 |0.072897726999999996 0.095018938999999997 0.204166667 ] CMatrix=[2.7113475600000001 |-0.58501125300000001 3.0046318620000001 |-0.35075556600000002 -0.92029378699999997 2.8517100719999999 ]
New "LineCode.5" NPhases=3 BaseFreq=60 RMatrix=[0.088371212000000005 |0.029545455000000002 0.086666667000000003 |0.029924242 0.029071969999999999 0.087405303000000004 ] XMatrix=[0.19852272700000001 |0.095018938999999997 0.204166667 |0.080227273000000002 0.072897726999999996 0.20172348500000001 ] CMatrix=[3.0046318620000001 |-0.92029378699999997 2.8517100719999999 |-0.58501125300000001 -0.35075556600000002 2.7113475600000001 ]
New "LineCode.6" NPhases=3 BaseFreq=60 RMatrix=[0.086666667000000003 |0.029071969999999999 0.087405303000000004 |0.029545455000000002 0.029924242 0.088371212000000005 ] XMatrix=[0.204166667 |0.072897726999999996 0.20172348500000001 |0.095018938999999997 0.080227273000000002 0.19852272700000001 ] CMatrix=[2.8517100719999999 |-0.35075556600000002 2.7113475600000001 |-0.92029378699999997 -0.58501125300000001 3.0046318620000001 ]
New "LineCode.7" NPhases=2 BaseFreq=60 RMatrix=[0.086666667000000003 |0.029071969999999999 0.087405303000000004 ] XMatrix=[0.204166667 |0.072897726999999996 0.20172348500000001 ] CMatrix=[2.5698295959999999 |-0.52995137000000003 2.5974600109999999 ]
New "LineCode.8" NPhases=2 BaseFreq=60 RMatrix=[0.086666667000000003 |0.029071969999999999 0.087405303000000004 ] XMatrix=[0.204166667 |0.072897726999999996 0.20172348500000001 ] CMatrix=[2.5698295959999999 |-0.52995137000000003 2.5974600109999999 ]
New "LineCode.9" NPhases=1 BaseFreq=60 RMatrix=[0.25174242400000002 ] XMatrix=[0.25520833300000001 ] CMatrix=[2.270366128 ]
New "LineCode.10" NPhases=1 BaseFreq=60 RMatrix=[0.25174242400000002 ] XMatrix=[0.25520833300000001 ] CMatrix=[2.270366128 ]
New "LineCode.11" NPhases=1 BaseFreq=60 RMatrix=[0.25174242400000002 ] XMatrix=[0.25520833300000001 ] CMatrix=[2.270366128 ]
New "LineCode.12" NPhases=3 BaseFreq=60 RMatrix=[0.28804924199999998 |0.098446969999999995 0.29032196999999998 |0.093257575999999995 0.098446969999999995 0.28804924199999998 ] XMatrix=[0.142443182 |0.052556817999999998 0.13564393899999999 |0.040852273000000001 0.052556817999999998 0.142443182 ] CMatrix=[33.771501489999999 |0 33.771501489999999 |0 0 33.771501489999999 ]
New "LineCode.300" NPhases=3 BaseFreq=60 RMatrix=[0.253181818 |0.039791667000000003 0.25071969700000002 |0.040340909000000001 0.039128787999999998 0.25178030299999998 ] XMatrix=[0.25270833300000001 |0.109450758 0.25698863599999999 |0.094981061000000006 0.086950758000000003 0.255132576 ] CMatrix=[2.6801503090000001 |-0.76928100600000004 2.5610381000000002 |-0.49950767600000001 -0.312072984 2.455590387 ]
New "LineCode.301" NPhases=3 BaseFreq=60 RMatrix=[0.365530303 |0.044071970000000002 0.36282196999999999 |0.044678030000000001 0.043333333000000002 0.36399621199999999 ] XMatrix=[0.267329545 |0.12200757600000001 0.27047348500000001 |0.107784091 0.099204545000000005 0.26910984799999998 ] CMatrix=[2.5724921630000002 |-0.72160597999999998 2.4643818820000001 |-0.47232939499999999 -0.29896109599999998 2.3688811190000001 ]
New "LineCode.302" NPhases=1 BaseFreq=60 RMatrix=[0.53020800000000001 ] XMatrix=[0.28134500000000001 ] CMatrix=[2.1225700000000001 ]
New "LineCode.303" NPhases=1 BaseFreq=60 RMatrix=[0.53020800000000001 ] XMatrix=[0.28134500000000001 ] CMatrix=[2.1225700000000001 ]
New "LineCode.304" NPhases=1 BaseFreq=60 RMatrix=[0.363958 ] XMatrix=[0.26916699999999999 ] CMatrix=[2.1922000000000001 ]
New "LineCode.400" NPhases=3 BaseFreq=60 RMatrix=[0.088205000000000006 |0.0312137 0.0901946 |0.030626400000000002 0.031614299999999998 0.088966500000000004 ] XMatrix=[0.20744000000000001 |0.093531400000000001 0.20078299999999999 |0.076031199999999993 0.085587899999999995 0.204877 ] CMatrix=[2.9030100000000001 |-0.67933500000000002 3.15896 |-0.22313 -0.48141600000000001 2.8965000000000001 ]
New "LineCode.601" NPhases=3 BaseFreq=60 RMatrix=[0.065625000000000003 |0.029545455000000002 0.063920455000000001 |0.029924242 0.029071969999999999 0.064659091000000002 ] XMatrix=[0.19278409099999999 |0.095018938999999997 0.19844697 |0.080227273000000002 0.072897726999999996 0.19598484799999999 ] CMatrix=[3.1648380359999999 |-1.002632425 2.993981593 |-0.63273651600000003 -0.37260871299999992 2.8326702030000002 ]
New "LineCode.602" NPhases=3 BaseFreq=60 RMatrix=[0.14253787900000001 |0.029924242 0.14157196999999999 |0.029545455000000002 0.029071969999999999 0.14083333300000001 ] XMatrix=[0.22375 |0.080227273000000002 0.226950758 |0.095018938999999997 0.072897726999999996 0.22939393899999999 ] CMatrix=[2.8630134229999999 |-0.54341491799999997 2.6020315890000001 |-0.84925849999999992 -0.33096214099999993 2.7251627679999997 ]
New "LineCode.603" NPhases=2 BaseFreq=60 RMatrix=[0.25178030299999998 |0.039128787999999998 0.25071969700000002 ] XMatrix=[0.255132576 |0.086950758000000003 0.25698863599999999 ] CMatrix=[2.366017603 |-0.45208383599999996 2.3439635079999999 ]
New "LineCode.604" NPhases=2 BaseFreq=60 RMatrix=[0.25071969700000002 |0.039128787999999998 0.25178030299999998 ] XMatrix=[0.25698863599999999 |0.086950758000000003 0.255132576 ] CMatrix=[2.3439635079999999 |-0.45208383599999996 2.366017603 ]
New "LineCode.605" NPhases=1 BaseFreq=60 RMatrix=[0.25174242400000002 ] XMatrix=[0.25520833300000001 ] CMatrix=[2.270366128 ]
New "LineCode.606" NPhases=3 BaseFreq=60 RMatrix=[0.15117424199999999 |0.060454544999999998 0.14945075799999999 |0.053958332999999997 0.060454544999999998 0.15117424199999999 ] XMatrix=[0.084526514999999997 |0.0062121210000000001 0.076534090999999999 |-0.0027083329999999998 0.0062121210000000001 0.084526514999999997 ] CMatrix=[48.674594079999999 |0 48.674594079999999 |0 0 48.674594079999999 ]
New "LineCode.607" NPhases=1 BaseFreq=60 RMatrix=[0.25426136399999999 ] XMatrix=[0.097045455000000003 ] CMatrix=[44.706615220000003 ]
New "LineCode.721" NPhases=3 BaseFreq=60 RMatrix=[0.055416667000000003 |0.012746212 0.050113636000000003 |0.006382576 0.012746212 0.055416667000000003 ] XMatrix=[0.037367424000000003 |-0.0069696970000000004 0.035984848 |-0.0078977270000000002 -0.0069696970000000004 0.037367424000000003 ] CMatrix=[80.274847280000003 |0 80.274847280000003 |0 0 80.274847280000003 ]
New "LineCode.722" NPhases=3 BaseFreq=60 RMatrix=[0.089981061000000001 |0.030852273 0.085000000000000006 |0.023371211999999999 0.030852273 0.089981061000000001 ] XMatrix=[0.056306818000000002 |-0.0061742419999999999 0.050719697000000001 |-0.011496212 -0.0061742419999999999 0.056306818000000002 ] CMatrix=[64.218410899999995 |0 64.218410899999995 |0 0 64.218410899999995 ]
New "LineCode.723" NPhases=3 BaseFreq=60 RMatrix=[0.245 |0.092253788000000003 0.24662878799999999 |0.086837121000000003 0.092253788000000003 0.245 ] XMatrix=[0.12714015200000001 |0.039981060999999998 0.119810606 |0.028806818000000001 0.039981060999999998 0.12714015200000001 ] CMatrix=[37.597711199999999 |0 37.597711199999999 |0 0 37.597711199999999 ]
New "LineCode.724" NPhases=3 BaseFreq=60 RMatrix=[0.39681818200000002 |0.098560605999999995 0.39901515199999998 |0.093295454999999999 0.098560605999999995 0.39681818200000002 ] XMatrix=[0.14693181799999999 |0.051856061000000002 0.14011363600000001 |0.040208332999999999 0.051856061000000002 0.14693181799999999 ] CMatrix=[30.267010290000005 |0 30.267010290000005 |0 0 30.267010290000005 ]
New "LineCode.mtx601" NPhases=3 BaseFreq=60 RMatrix=[0.34649999999999997 |0.156 0.33750000000000002 |0.158 0.1535 0.34139999999999998 ] XMatrix=[1.0179 |0.50170000000000003 1.0478000000000001 |0.42359999999999998 0.38490000000000002 1.0347999999999999 ] Units=mi
New "LineCode.mtx602" NPhases=3 BaseFreq=60 RMatrix=[0.75260000000000005 |0.158 0.74750000000000005 |0.156 0.1535 0.74360000000000004 ] XMatrix=[1.1814 |0.42359999999999998 1.1982999999999999 |0.50170000000000003 0.38490000000000002 1.2112000000000001 ] Units=mi
New "LineCode.mtx603" NPhases=2 BaseFreq=60 RMatrix=[1.3238000000000001 |0.20660000000000001 1.3293999999999999 ] XMatrix=[1.3569 |0.45910000000000001 1.3471 ] Units=mi
New "LineCode.mtx604" NPhases=2 BaseFreq=60 RMatrix=[1.3238000000000001 |0.20660000000000001 1.3293999999999999 ] XMatrix=[1.3569 |0.45910000000000001 1.3471 ] Units=mi
New "LineCode.mtx605" NPhases=1 BaseFreq=60 RMatrix=[1.3291999999999999 ] XMatrix=[1.3474999999999999 ] Units=mi
New "LineCode.mtx606" NPhases=3 Units=mi RMatrix=[0.79172100000000001 |0.31847599999999998 0.78164900000000004 |0.28344999999999998 0.31847599999999998 0.79172100000000001 ] XMatrix=[0.43835200000000002 |0.027683800000000001 0.39669700000000002 |-0.0184204 0.027683800000000001 0.43835200000000002 ] CMatrix=[383.94800000000004 |0 383.94800000000004 |0 0 383.94800000000004 ]
New "LineCode.mtx607" NPhases=1 BaseFreq=60 RMatrix=[1.3425 ] XMatrix=[0.51239999999999997 ] CMatrix=[236 ] Units=mi
New "LoadShape.default" NPts=24 Interval=1 Mult=[ 0.67700000000000005 0.62560000000000004 0.60870000000000002 0.58330000000000004 0.58028000000000002 0.60250000000000004 0.65700000000000003 0.74770000000000003 0.83199999999999996 0.88 0.93999999999999995 0.98899999999999999 0.98499999999999999 0.97999999999999998 0.98980000000000001 0.999 1 0.95799999999999996 0.93600000000000005 0.91300000000000003 0.876 0.876 0.82799999999999996 0.75600000000000001]
New "GrowthShape.default" NPts=2 Year=[ 1 20] Mult=[ 1.0249999999999999 1.0249999999999999]
New "TCC_Curve.a" NPts=5 C_Array=[ 1 2.5 4.5 8 14] T_Array=[ 0.14999999999999999 0.070000000000000007 0.050000000000000003 0.044999999999999998 0.044999999999999998]
New "TCC_Curve.d" NPts=5 C_Array=[ 1 2.5 4.5 8 14] T_Array=[ 6 0.69999999999999996 0.20000000000000001 0.059999999999999998 0.02]
New "TCC_Curve.tlink" NPts=7 C_Array=[ 2 2.1000000000000001 3 4 6 22 50] T_Array=[ 300 100 10.1 4 1.3999999999999999 0.10000000000000001 0.02]
New "TCC_Curve.klink" NPts=6 C_Array=[ 2 2.2000000000000002 3 4 6 30] T_Array=[ 300 20 4 1.3 0.40999999999999998 0.02]
New "TCC_Curve.uv1547" NPts=2 C_Array=[ 0.5 0.90000000000000002] T_Array=[ 0.16600000000000001 2]
New "TCC_Curve.ov1547" NPts=2 C_Array=[ 1.1000000000000001 1.2] T_Array=[ 2 0.16600000000000001]
New "TCC_Curve.mod_inv" NPts=15 C_Array=[ 1.1000000000000001 1.3 1.5 2 3 4 5 6 7 8 9 10 20 50 100] T_Array=[ 27.1053 9.9029000000000007 6.4390000000000001 3.8031999999999999 2.4321999999999999 1.9458 1.6882999999999999 1.5255000000000001 1.4117 1.3267 1.2604 1.2068000000000001 0.94810000000000005 0.74680000000000002 0.64780000000000004]
New "TCC_Curve.very_inv" NPts=15 C_Array=[ 1.1000000000000001 1.3 1.5 2 3 4 5 6 7 8 9 10 20 50 100] T_Array=[ 93.872 28.911300000000001 16.178999999999998 7.0277000000000003 2.9422999999999999 1.7983 1.3081 1.0512999999999999 0.89949999999999997 0.80230000000000001 0.73609999999999998 0.68910000000000005 0.54010000000000002 0.49880000000000002 0.49299999999999999]
New "TCC_Curve.ext_inv" NPts=15 C_Array=[ 1.1000000000000001 1.3 1.5 2 3 4 5 6 7 8 9 10 20 50 100] T_Array=[ 134.4074 40.991300000000003 22.681699999999999 9.5216999999999992 3.6467000000000001 2.0017 1.2967 0.9274 0.70920000000000005 0.56930000000000003 0.47420000000000001 0.40649999999999997 0.19239999999999999 0.13300000000000001 0.1245]
New "TCC_Curve.definite" NPts=3 C_Array=[ 1 1.0009999999999999 100] T_Array=[ 300 1 1]
New "Spectrum.default" NumHarm=7 Harmonic=[ 1 3 5 7 9 11 13] %Mag=[ 100 33 20 14.000000000000002 11 9 7.0000000000000009] Angle=[ 0 0 0 0 0 0 0]
New "Spectrum.defaultload" NumHarm=7 Harmonic=[ 1 3 5 7 9 11 13] %Mag=[ 100 1.5 20 14.000000000000002 1 9 7.0000000000000009] Angle=[ 0 180 180 180 180 180 180]
New "Spectrum.defaultgen" NumHarm=7 Harmonic=[ 1 3 5 7 9 11 13] %Mag=[ 100 5 3 1.5 1 0.69999999999999996 0.5] Angle=[ 0 0 0 0 0 0 0]
New "Spectrum.defaultvsource" NumHarm=1 Harmonic=[ 1] %Mag=[ 100] Angle=[ 0]
New "Spectrum.linear" NumHarm=1 Harmonic=[ 1] %Mag=[ 100] Angle=[ 0]
New "Spectrum.pwm6" NumHarm=13 Harmonic=[ 1 3 5 7 9 11 13 15 17 19 21 23 25] %Mag=[ 100 4.4000000000000004 76.5 62.699999999999996 2.8999999999999999 24.800000000000001 12.699999999999999 0.5 7.0999999999999996 8.4000000000000004 0.90000000000000013 4.4000000000000004 3.3000000000000003] Angle=[ -103 -5 28 -180 -33 -59 79 36 -253 -124 3 -30 86]
New "Spectrum.dc6" NumHarm=10 Harmonic=[ 1 3 5 7 9 11 13 15 17 19] %Mag=[ 100 1.2 33.600000000000001 1.6000000000000001 0.40000000000000002 8.6999999999999993 1.2 0.29999999999999999 4.5 1.3] Angle=[ -75 28 156 29 -91 49 54 148 -57 -46]
Edit "Vsource.source" BasekV=115 pu=1.0001 Phases=3 Bus1=sourcebus Angle=30 MVASC3=20000 MVASC1=21000
New "Line.650632" Phases=3 Bus1=rg60.1.2.3 Bus2=632.1.2.3 LineCode=mtx601 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=2000 Units=ft
New "Line.632670" Phases=3 Bus1=632.1.2.3 Bus2=670.1.2.3 LineCode=mtx601 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=667 Units=ft
New "Line.670671" Phases=3 Bus1=670.1.2.3 Bus2=671.1.2.3 LineCode=mtx601 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=1333 Units=ft
New "Line.671680" Phases=3 Bus1=671.1.2.3 Bus2=680.1.2.3 LineCode=mtx601 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=1000 Units=ft
New "Line.632633" Phases=3 Bus1=632.1.2.3 Bus2=633.1.2.3 LineCode=mtx602 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=500 Units=ft
New "Line.632645" Phases=2 Bus1=632.3.2 Bus2=645.3.2 LineCode=mtx603 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=500 Units=ft
New "Line.645646" Phases=2 Bus1=645.3.2 Bus2=646.3.2 LineCode=mtx603 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=300 Units=ft
New "Line.692675" Phases=3 Bus1=692.1.2.3 Bus2=675.1.2.3 LineCode=mtx606 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=500 Units=ft
New "Line.671684" Phases=2 Bus1=671.1.3 Bus2=684.1.3 LineCode=mtx604 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=300 Units=ft
New "Line.684611" Phases=1 Bus1=684.3 Bus2=611.3 LineCode=mtx605 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=300 Units=ft
New "Line.684652" Phases=1 Bus1=684.1 Bus2=652.1 LineCode=mtx607 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=800 Units=ft
New "Line.671692" Phases=3 Bus1=671 Bus2=692 Switch=Yes Length=0.001 Units=none R1=0.0001 R0=0.0001 X1=0 X0=0 C1=0 C0=0
New "Load.671" Bus1=671.1.2.3 Phases=3 Conn=delta Model=1 kV=4.16 kW=1155 kvar=660
New "Load.634a" Bus1=634.1 Phases=1 Conn=wye Model=1 kV=0.277 kW=160 kvar=110
New "Load.634b" Bus1=634.2 Phases=1 Conn=wye Model=1 kV=0.277 kW=120 kvar=90
New "Load.634c" Bus1=634.3 Phases=1 Conn=wye Model=1 kV=0.277 kW=120 kvar=90
New "Load.645" Bus1=645.2 Phases=1 Conn=wye Model=1 kV=2.4 kW=170 kvar=125
New "Load.646" Bus1=646.2.3 Phases=1 Conn=delta Model=2 kV=4.16 kW=230 kvar=132
New "Load.692" Bus1=692.3.1 Phases=1 Conn=delta Model=5 kV=4.16 kW=170 kvar=151
New "Load.675a" Bus1=675.1 Phases=1 Conn=wye Model=1 kV=2.4 kW=485 kvar=190
New "Load.675b" Bus1=675.2 Phases=1 Conn=wye Model=1 kV=2.4 kW=68 kvar=60
New "Load.675c" Bus1=675.3 Phases=1 Conn=wye Model=1 kV=2.4 kW=290 kvar=212
New "Load.611" Bus1=611.3 Phases=1 Conn=wye Model=5 kV=2.4 kW=170 kvar=80
New "Load.652" Bus1=652.1 Phases=1 Conn=wye Model=2 kV=2.4 kW=128 kvar=86
New "Load.670a" Bus1=670.1 Phases=1 Conn=wye Model=1 kV=2.4 kW=17 kvar=10
New "Load.670b" Bus1=670.2 Phases=1 Conn=wye Model=1 kV=2.4 kW=66 kvar=38
New "Load.670c" Bus1=670.3 Phases=1 Conn=wye Model=1 kV=2.4 kW=117 kvar=68
New "Transformer.sub" Phases=3 Windings=2 XHL=0.008 Buses=[sourcebus, 650, ] Conns=[delta, wye, ] kVs=[115, 4.1600000000000001, ] kVAs=[5000, 5000, ] Taps=[1, 1, ] %Rs=[0.00050000000000000001, 0.00050000000000000001, ] Wdg=1 Wdg=2
New "Transformer.reg1" Phases=1 Bank=reg1 XHL=0.01 kVAs=[1666, 1666, ] Buses=[650.1, rg60.1, ] kVs=[2.3999999999999999, 2.3999999999999999, ] %LoadLoss=0.01
New "Transformer.reg2" Phases=1 Bank=reg1 XHL=0.01 kVAs=[1666, 1666, ] Buses=[650.2, rg60.2, ] kVs=[2.3999999999999999, 2.3999999999999999, ] %LoadLoss=0.01
New "Transformer.reg3" Phases=1 Bank=reg1 XHL=0.01 kVAs=[1666, 1666, ] Buses=[650.3, rg60.3, ] kVs=[2.3999999999999999, 2.3999999999999999, ] %LoadLoss=0.01
New "Transformer.xfm1" Phases=3 Windings=2 XHL=2 Buses=[633, 634, ] Conns=[wye, wye, ] kVs=[4.1600000000000001, 0.47999999999999998, ] kVAs=[500, 500, ] Taps=[1, 1, ] %Rs=[0.55000000000000004, 0.55000000000000004, ] Wdg=1 Wdg=2
New "RegControl.reg1" Transformer=reg1 Winding=2 VReg=122 Band=2 PTRatio=20 CTPrim=700 R=3 X=9
New "RegControl.reg2" Transformer=reg2 Winding=2 VReg=122 Band=2 PTRatio=20 CTPrim=700 R=3 X=9
New "RegControl.reg3" Transformer=reg3 Winding=2 VReg=122 Band=2 PTRatio=20 CTPrim=700 R=3 X=9
New "Capacitor.cap1" Bus1=675 Phases=3 kvar=[ 600] kV=4.16
New "Capacitor.cap2" Bus1=611.3 Phases=1 kvar=[ 100] kV=2.4
MakeBusList
Set VoltageBases=(115, 4.1600000000000001, 0.47999999999999998, )
! CalcVoltageBases
SetBusXY Bus=sourcebus X=200 Y=400
SetBusXY Bus=650 X=200 Y=350
SetBusXY Bus=rg60 X=200 Y=300
SetBusXY Bus=633 X=350 Y=250
SetBusXY Bus=634 X=400 Y=250
SetBusXY Bus=671 X=200 Y=100
SetBusXY Bus=645 X=100 Y=250
SetBusXY Bus=646 X=0 Y=250
SetBusXY Bus=692 X=250 Y=100
SetBusXY Bus=675 X=400 Y=100
SetBusXY Bus=611 X=0 Y=100
SetBusXY Bus=652 X=100 Y=0
SetBusXY Bus=670 X=200 Y=200
SetBusXY Bus=632 X=200 Y=250
SetBusXY Bus=680 X=200 Y=0
SetBusXY Bus=684 X=100 Y=100

Exporting directly to a string#

One basic feature is to save circuits directly to a string, which is returned by the function. This is very useful for both inspecting and copying the data to another process.

Let’s use the IEEE13 circuit since it’s not too large. Even for this circuit, we can notice that a lot of the text is not user-provided data, but the default OpenDSS items (the basic items created automatically for every circuit).

odd(f'redirect "{IEEE13_PATH}"')
saved_data_from_str = odd.Circuit.Save('', DSSSaveFlags.SingleFile|DSSSaveFlags.ToString)

Besides the timestamp from the comment, the data is the save as when saved to the file:

print(saved_data_from_str)
! Last saved by AltDSS/DSS C-API Library version 0.14.1 revision 8b3da5b576f4dedd16d2bfb88bfb911c0aca3783 based on OpenDSS SVN 3723 [FPC 3.2.2] (64-bit build) MVMULT INCREMENTAL_Y CONTEXT_API PM 20240217013457 on 2024-02-25T18:46:21.548Z
Clear
Set DefaultBaseFreq=60
New Circuit.ieee13nodeckt

Set EarthModel=Deri

New "LineCode.1" NPhases=3 BaseFreq=60 RMatrix=[0.086666667000000003 |0.029545455000000002 0.088371212000000005 |0.029071969999999999 0.029924242 0.087405303000000004 ] XMatrix=[0.204166667 |0.095018938999999997 0.19852272700000001 |0.072897726999999996 0.080227273000000002 0.20172348500000001 ] CMatrix=[2.8517100719999999 |-0.92029378699999997 3.0046318620000001 |-0.35075556600000002 -0.58501125300000001 2.7113475600000001 ]
New "LineCode.2" NPhases=3 BaseFreq=60 RMatrix=[0.088371212000000005 |0.029924240000000001 0.087405303000000004 |0.029545455000000002 0.029071969999999999 0.086666667000000003 ] XMatrix=[0.19852272700000001 |0.080227273000000002 0.20172348500000001 |0.095018938999999997 0.072897726999999996 0.204166667 ] CMatrix=[3.0046318620000001 |-0.58501125300000001 2.7113475600000001 |-0.92029378699999997 -0.35075556600000002 2.8517100719999999 ]
New "LineCode.3" NPhases=3 BaseFreq=60 RMatrix=[0.087405303000000004 |0.029071969999999999 0.086666667000000003 |0.029924242 0.029545455000000002 0.088371212000000005 ] XMatrix=[0.20172348500000001 |0.072897726999999996 0.204166667 |0.080227273000000002 0.095018938999999997 0.19852272700000001 ] CMatrix=[2.7113475600000001 |-0.35075556600000002 2.8517100719999999 |-0.58501125300000001 -0.92029378699999997 3.0046318620000001 ]
New "LineCode.4" NPhases=3 BaseFreq=60 RMatrix=[0.087405303000000004 |0.029924242 0.088371212000000005 |0.029071969999999999 0.029545455000000002 0.086666667000000003 ] XMatrix=[0.20172348500000001 |0.080227273000000002 0.19852272700000001 |0.072897726999999996 0.095018938999999997 0.204166667 ] CMatrix=[2.7113475600000001 |-0.58501125300000001 3.0046318620000001 |-0.35075556600000002 -0.92029378699999997 2.8517100719999999 ]
New "LineCode.5" NPhases=3 BaseFreq=60 RMatrix=[0.088371212000000005 |0.029545455000000002 0.086666667000000003 |0.029924242 0.029071969999999999 0.087405303000000004 ] XMatrix=[0.19852272700000001 |0.095018938999999997 0.204166667 |0.080227273000000002 0.072897726999999996 0.20172348500000001 ] CMatrix=[3.0046318620000001 |-0.92029378699999997 2.8517100719999999 |-0.58501125300000001 -0.35075556600000002 2.7113475600000001 ]
New "LineCode.6" NPhases=3 BaseFreq=60 RMatrix=[0.086666667000000003 |0.029071969999999999 0.087405303000000004 |0.029545455000000002 0.029924242 0.088371212000000005 ] XMatrix=[0.204166667 |0.072897726999999996 0.20172348500000001 |0.095018938999999997 0.080227273000000002 0.19852272700000001 ] CMatrix=[2.8517100719999999 |-0.35075556600000002 2.7113475600000001 |-0.92029378699999997 -0.58501125300000001 3.0046318620000001 ]
New "LineCode.7" NPhases=2 BaseFreq=60 RMatrix=[0.086666667000000003 |0.029071969999999999 0.087405303000000004 ] XMatrix=[0.204166667 |0.072897726999999996 0.20172348500000001 ] CMatrix=[2.5698295959999999 |-0.52995137000000003 2.5974600109999999 ]
New "LineCode.8" NPhases=2 BaseFreq=60 RMatrix=[0.086666667000000003 |0.029071969999999999 0.087405303000000004 ] XMatrix=[0.204166667 |0.072897726999999996 0.20172348500000001 ] CMatrix=[2.5698295959999999 |-0.52995137000000003 2.5974600109999999 ]
New "LineCode.9" NPhases=1 BaseFreq=60 RMatrix=[0.25174242400000002 ] XMatrix=[0.25520833300000001 ] CMatrix=[2.270366128 ]
New "LineCode.10" NPhases=1 BaseFreq=60 RMatrix=[0.25174242400000002 ] XMatrix=[0.25520833300000001 ] CMatrix=[2.270366128 ]
New "LineCode.11" NPhases=1 BaseFreq=60 RMatrix=[0.25174242400000002 ] XMatrix=[0.25520833300000001 ] CMatrix=[2.270366128 ]
New "LineCode.12" NPhases=3 BaseFreq=60 RMatrix=[0.28804924199999998 |0.098446969999999995 0.29032196999999998 |0.093257575999999995 0.098446969999999995 0.28804924199999998 ] XMatrix=[0.142443182 |0.052556817999999998 0.13564393899999999 |0.040852273000000001 0.052556817999999998 0.142443182 ] CMatrix=[33.771501489999999 |0 33.771501489999999 |0 0 33.771501489999999 ]
New "LineCode.300" NPhases=3 BaseFreq=60 RMatrix=[0.253181818 |0.039791667000000003 0.25071969700000002 |0.040340909000000001 0.039128787999999998 0.25178030299999998 ] XMatrix=[0.25270833300000001 |0.109450758 0.25698863599999999 |0.094981061000000006 0.086950758000000003 0.255132576 ] CMatrix=[2.6801503090000001 |-0.76928100600000004 2.5610381000000002 |-0.49950767600000001 -0.312072984 2.455590387 ]
New "LineCode.301" NPhases=3 BaseFreq=60 RMatrix=[0.365530303 |0.044071970000000002 0.36282196999999999 |0.044678030000000001 0.043333333000000002 0.36399621199999999 ] XMatrix=[0.267329545 |0.12200757600000001 0.27047348500000001 |0.107784091 0.099204545000000005 0.26910984799999998 ] CMatrix=[2.5724921630000002 |-0.72160597999999998 2.4643818820000001 |-0.47232939499999999 -0.29896109599999998 2.3688811190000001 ]
New "LineCode.302" NPhases=1 BaseFreq=60 RMatrix=[0.53020800000000001 ] XMatrix=[0.28134500000000001 ] CMatrix=[2.1225700000000001 ]
New "LineCode.303" NPhases=1 BaseFreq=60 RMatrix=[0.53020800000000001 ] XMatrix=[0.28134500000000001 ] CMatrix=[2.1225700000000001 ]
New "LineCode.304" NPhases=1 BaseFreq=60 RMatrix=[0.363958 ] XMatrix=[0.26916699999999999 ] CMatrix=[2.1922000000000001 ]
New "LineCode.400" NPhases=3 BaseFreq=60 RMatrix=[0.088205000000000006 |0.0312137 0.0901946 |0.030626400000000002 0.031614299999999998 0.088966500000000004 ] XMatrix=[0.20744000000000001 |0.093531400000000001 0.20078299999999999 |0.076031199999999993 0.085587899999999995 0.204877 ] CMatrix=[2.9030100000000001 |-0.67933500000000002 3.15896 |-0.22313 -0.48141600000000001 2.8965000000000001 ]
New "LineCode.601" NPhases=3 BaseFreq=60 RMatrix=[0.065625000000000003 |0.029545455000000002 0.063920455000000001 |0.029924242 0.029071969999999999 0.064659091000000002 ] XMatrix=[0.19278409099999999 |0.095018938999999997 0.19844697 |0.080227273000000002 0.072897726999999996 0.19598484799999999 ] CMatrix=[3.1648380359999999 |-1.002632425 2.993981593 |-0.63273651600000003 -0.37260871299999992 2.8326702030000002 ]
New "LineCode.602" NPhases=3 BaseFreq=60 RMatrix=[0.14253787900000001 |0.029924242 0.14157196999999999 |0.029545455000000002 0.029071969999999999 0.14083333300000001 ] XMatrix=[0.22375 |0.080227273000000002 0.226950758 |0.095018938999999997 0.072897726999999996 0.22939393899999999 ] CMatrix=[2.8630134229999999 |-0.54341491799999997 2.6020315890000001 |-0.84925849999999992 -0.33096214099999993 2.7251627679999997 ]
New "LineCode.603" NPhases=2 BaseFreq=60 RMatrix=[0.25178030299999998 |0.039128787999999998 0.25071969700000002 ] XMatrix=[0.255132576 |0.086950758000000003 0.25698863599999999 ] CMatrix=[2.366017603 |-0.45208383599999996 2.3439635079999999 ]
New "LineCode.604" NPhases=2 BaseFreq=60 RMatrix=[0.25071969700000002 |0.039128787999999998 0.25178030299999998 ] XMatrix=[0.25698863599999999 |0.086950758000000003 0.255132576 ] CMatrix=[2.3439635079999999 |-0.45208383599999996 2.366017603 ]
New "LineCode.605" NPhases=1 BaseFreq=60 RMatrix=[0.25174242400000002 ] XMatrix=[0.25520833300000001 ] CMatrix=[2.270366128 ]
New "LineCode.606" NPhases=3 BaseFreq=60 RMatrix=[0.15117424199999999 |0.060454544999999998 0.14945075799999999 |0.053958332999999997 0.060454544999999998 0.15117424199999999 ] XMatrix=[0.084526514999999997 |0.0062121210000000001 0.076534090999999999 |-0.0027083329999999998 0.0062121210000000001 0.084526514999999997 ] CMatrix=[48.674594079999999 |0 48.674594079999999 |0 0 48.674594079999999 ]
New "LineCode.607" NPhases=1 BaseFreq=60 RMatrix=[0.25426136399999999 ] XMatrix=[0.097045455000000003 ] CMatrix=[44.706615220000003 ]
New "LineCode.721" NPhases=3 BaseFreq=60 RMatrix=[0.055416667000000003 |0.012746212 0.050113636000000003 |0.006382576 0.012746212 0.055416667000000003 ] XMatrix=[0.037367424000000003 |-0.0069696970000000004 0.035984848 |-0.0078977270000000002 -0.0069696970000000004 0.037367424000000003 ] CMatrix=[80.274847280000003 |0 80.274847280000003 |0 0 80.274847280000003 ]
New "LineCode.722" NPhases=3 BaseFreq=60 RMatrix=[0.089981061000000001 |0.030852273 0.085000000000000006 |0.023371211999999999 0.030852273 0.089981061000000001 ] XMatrix=[0.056306818000000002 |-0.0061742419999999999 0.050719697000000001 |-0.011496212 -0.0061742419999999999 0.056306818000000002 ] CMatrix=[64.218410899999995 |0 64.218410899999995 |0 0 64.218410899999995 ]
New "LineCode.723" NPhases=3 BaseFreq=60 RMatrix=[0.245 |0.092253788000000003 0.24662878799999999 |0.086837121000000003 0.092253788000000003 0.245 ] XMatrix=[0.12714015200000001 |0.039981060999999998 0.119810606 |0.028806818000000001 0.039981060999999998 0.12714015200000001 ] CMatrix=[37.597711199999999 |0 37.597711199999999 |0 0 37.597711199999999 ]
New "LineCode.724" NPhases=3 BaseFreq=60 RMatrix=[0.39681818200000002 |0.098560605999999995 0.39901515199999998 |0.093295454999999999 0.098560605999999995 0.39681818200000002 ] XMatrix=[0.14693181799999999 |0.051856061000000002 0.14011363600000001 |0.040208332999999999 0.051856061000000002 0.14693181799999999 ] CMatrix=[30.267010290000005 |0 30.267010290000005 |0 0 30.267010290000005 ]
New "LineCode.mtx601" NPhases=3 BaseFreq=60 RMatrix=[0.34649999999999997 |0.156 0.33750000000000002 |0.158 0.1535 0.34139999999999998 ] XMatrix=[1.0179 |0.50170000000000003 1.0478000000000001 |0.42359999999999998 0.38490000000000002 1.0347999999999999 ] Units=mi
New "LineCode.mtx602" NPhases=3 BaseFreq=60 RMatrix=[0.75260000000000005 |0.158 0.74750000000000005 |0.156 0.1535 0.74360000000000004 ] XMatrix=[1.1814 |0.42359999999999998 1.1982999999999999 |0.50170000000000003 0.38490000000000002 1.2112000000000001 ] Units=mi
New "LineCode.mtx603" NPhases=2 BaseFreq=60 RMatrix=[1.3238000000000001 |0.20660000000000001 1.3293999999999999 ] XMatrix=[1.3569 |0.45910000000000001 1.3471 ] Units=mi
New "LineCode.mtx604" NPhases=2 BaseFreq=60 RMatrix=[1.3238000000000001 |0.20660000000000001 1.3293999999999999 ] XMatrix=[1.3569 |0.45910000000000001 1.3471 ] Units=mi
New "LineCode.mtx605" NPhases=1 BaseFreq=60 RMatrix=[1.3291999999999999 ] XMatrix=[1.3474999999999999 ] Units=mi
New "LineCode.mtx606" NPhases=3 Units=mi RMatrix=[0.79172100000000001 |0.31847599999999998 0.78164900000000004 |0.28344999999999998 0.31847599999999998 0.79172100000000001 ] XMatrix=[0.43835200000000002 |0.027683800000000001 0.39669700000000002 |-0.0184204 0.027683800000000001 0.43835200000000002 ] CMatrix=[383.94800000000004 |0 383.94800000000004 |0 0 383.94800000000004 ]
New "LineCode.mtx607" NPhases=1 BaseFreq=60 RMatrix=[1.3425 ] XMatrix=[0.51239999999999997 ] CMatrix=[236 ] Units=mi
New "LoadShape.default" NPts=24 Interval=1 Mult=[ 0.67700000000000005 0.62560000000000004 0.60870000000000002 0.58330000000000004 0.58028000000000002 0.60250000000000004 0.65700000000000003 0.74770000000000003 0.83199999999999996 0.88 0.93999999999999995 0.98899999999999999 0.98499999999999999 0.97999999999999998 0.98980000000000001 0.999 1 0.95799999999999996 0.93600000000000005 0.91300000000000003 0.876 0.876 0.82799999999999996 0.75600000000000001]
New "GrowthShape.default" NPts=2 Year=[ 1 20] Mult=[ 1.0249999999999999 1.0249999999999999]
New "TCC_Curve.a" NPts=5 C_Array=[ 1 2.5 4.5 8 14] T_Array=[ 0.14999999999999999 0.070000000000000007 0.050000000000000003 0.044999999999999998 0.044999999999999998]
New "TCC_Curve.d" NPts=5 C_Array=[ 1 2.5 4.5 8 14] T_Array=[ 6 0.69999999999999996 0.20000000000000001 0.059999999999999998 0.02]
New "TCC_Curve.tlink" NPts=7 C_Array=[ 2 2.1000000000000001 3 4 6 22 50] T_Array=[ 300 100 10.1 4 1.3999999999999999 0.10000000000000001 0.02]
New "TCC_Curve.klink" NPts=6 C_Array=[ 2 2.2000000000000002 3 4 6 30] T_Array=[ 300 20 4 1.3 0.40999999999999998 0.02]
New "TCC_Curve.uv1547" NPts=2 C_Array=[ 0.5 0.90000000000000002] T_Array=[ 0.16600000000000001 2]
New "TCC_Curve.ov1547" NPts=2 C_Array=[ 1.1000000000000001 1.2] T_Array=[ 2 0.16600000000000001]
New "TCC_Curve.mod_inv" NPts=15 C_Array=[ 1.1000000000000001 1.3 1.5 2 3 4 5 6 7 8 9 10 20 50 100] T_Array=[ 27.1053 9.9029000000000007 6.4390000000000001 3.8031999999999999 2.4321999999999999 1.9458 1.6882999999999999 1.5255000000000001 1.4117 1.3267 1.2604 1.2068000000000001 0.94810000000000005 0.74680000000000002 0.64780000000000004]
New "TCC_Curve.very_inv" NPts=15 C_Array=[ 1.1000000000000001 1.3 1.5 2 3 4 5 6 7 8 9 10 20 50 100] T_Array=[ 93.872 28.911300000000001 16.178999999999998 7.0277000000000003 2.9422999999999999 1.7983 1.3081 1.0512999999999999 0.89949999999999997 0.80230000000000001 0.73609999999999998 0.68910000000000005 0.54010000000000002 0.49880000000000002 0.49299999999999999]
New "TCC_Curve.ext_inv" NPts=15 C_Array=[ 1.1000000000000001 1.3 1.5 2 3 4 5 6 7 8 9 10 20 50 100] T_Array=[ 134.4074 40.991300000000003 22.681699999999999 9.5216999999999992 3.6467000000000001 2.0017 1.2967 0.9274 0.70920000000000005 0.56930000000000003 0.47420000000000001 0.40649999999999997 0.19239999999999999 0.13300000000000001 0.1245]
New "TCC_Curve.definite" NPts=3 C_Array=[ 1 1.0009999999999999 100] T_Array=[ 300 1 1]
New "Spectrum.default" NumHarm=7 Harmonic=[ 1 3 5 7 9 11 13] %Mag=[ 100 33 20 14.000000000000002 11 9 7.0000000000000009] Angle=[ 0 0 0 0 0 0 0]
New "Spectrum.defaultload" NumHarm=7 Harmonic=[ 1 3 5 7 9 11 13] %Mag=[ 100 1.5 20 14.000000000000002 1 9 7.0000000000000009] Angle=[ 0 180 180 180 180 180 180]
New "Spectrum.defaultgen" NumHarm=7 Harmonic=[ 1 3 5 7 9 11 13] %Mag=[ 100 5 3 1.5 1 0.69999999999999996 0.5] Angle=[ 0 0 0 0 0 0 0]
New "Spectrum.defaultvsource" NumHarm=1 Harmonic=[ 1] %Mag=[ 100] Angle=[ 0]
New "Spectrum.linear" NumHarm=1 Harmonic=[ 1] %Mag=[ 100] Angle=[ 0]
New "Spectrum.pwm6" NumHarm=13 Harmonic=[ 1 3 5 7 9 11 13 15 17 19 21 23 25] %Mag=[ 100 4.4000000000000004 76.5 62.699999999999996 2.8999999999999999 24.800000000000001 12.699999999999999 0.5 7.0999999999999996 8.4000000000000004 0.90000000000000013 4.4000000000000004 3.3000000000000003] Angle=[ -103 -5 28 -180 -33 -59 79 36 -253 -124 3 -30 86]
New "Spectrum.dc6" NumHarm=10 Harmonic=[ 1 3 5 7 9 11 13 15 17 19] %Mag=[ 100 1.2 33.600000000000001 1.6000000000000001 0.40000000000000002 8.6999999999999993 1.2 0.29999999999999999 4.5 1.3] Angle=[ -75 28 156 29 -91 49 54 148 -57 -46]
Edit "Vsource.source" BasekV=115 pu=1.0001 Phases=3 Bus1=sourcebus Angle=30 MVASC3=20000 MVASC1=21000
New "Line.650632" Phases=3 Bus1=rg60.1.2.3 Bus2=632.1.2.3 LineCode=mtx601 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=2000 Units=ft
New "Line.632670" Phases=3 Bus1=632.1.2.3 Bus2=670.1.2.3 LineCode=mtx601 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=667 Units=ft
New "Line.670671" Phases=3 Bus1=670.1.2.3 Bus2=671.1.2.3 LineCode=mtx601 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=1333 Units=ft
New "Line.671680" Phases=3 Bus1=671.1.2.3 Bus2=680.1.2.3 LineCode=mtx601 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=1000 Units=ft
New "Line.632633" Phases=3 Bus1=632.1.2.3 Bus2=633.1.2.3 LineCode=mtx602 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=500 Units=ft
New "Line.632645" Phases=2 Bus1=632.3.2 Bus2=645.3.2 LineCode=mtx603 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=500 Units=ft
New "Line.645646" Phases=2 Bus1=645.3.2 Bus2=646.3.2 LineCode=mtx603 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=300 Units=ft
New "Line.692675" Phases=3 Bus1=692.1.2.3 Bus2=675.1.2.3 LineCode=mtx606 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=500 Units=ft
New "Line.671684" Phases=2 Bus1=671.1.3 Bus2=684.1.3 LineCode=mtx604 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=300 Units=ft
New "Line.684611" Phases=1 Bus1=684.3 Bus2=611.3 LineCode=mtx605 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=300 Units=ft
New "Line.684652" Phases=1 Bus1=684.1 Bus2=652.1 LineCode=mtx607 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=800 Units=ft
New "Line.671692" Phases=3 Bus1=671 Bus2=692 Switch=Yes Length=0.001 Units=none R1=0.0001 R0=0.0001 X1=0 X0=0 C1=0 C0=0
New "Load.671" Bus1=671.1.2.3 Phases=3 Conn=delta Model=1 kV=4.16 kW=1155 kvar=660
New "Load.634a" Bus1=634.1 Phases=1 Conn=wye Model=1 kV=0.277 kW=160 kvar=110
New "Load.634b" Bus1=634.2 Phases=1 Conn=wye Model=1 kV=0.277 kW=120 kvar=90
New "Load.634c" Bus1=634.3 Phases=1 Conn=wye Model=1 kV=0.277 kW=120 kvar=90
New "Load.645" Bus1=645.2 Phases=1 Conn=wye Model=1 kV=2.4 kW=170 kvar=125
New "Load.646" Bus1=646.2.3 Phases=1 Conn=delta Model=2 kV=4.16 kW=230 kvar=132
New "Load.692" Bus1=692.3.1 Phases=1 Conn=delta Model=5 kV=4.16 kW=170 kvar=151
New "Load.675a" Bus1=675.1 Phases=1 Conn=wye Model=1 kV=2.4 kW=485 kvar=190
New "Load.675b" Bus1=675.2 Phases=1 Conn=wye Model=1 kV=2.4 kW=68 kvar=60
New "Load.675c" Bus1=675.3 Phases=1 Conn=wye Model=1 kV=2.4 kW=290 kvar=212
New "Load.611" Bus1=611.3 Phases=1 Conn=wye Model=5 kV=2.4 kW=170 kvar=80
New "Load.652" Bus1=652.1 Phases=1 Conn=wye Model=2 kV=2.4 kW=128 kvar=86
New "Load.670a" Bus1=670.1 Phases=1 Conn=wye Model=1 kV=2.4 kW=17 kvar=10
New "Load.670b" Bus1=670.2 Phases=1 Conn=wye Model=1 kV=2.4 kW=66 kvar=38
New "Load.670c" Bus1=670.3 Phases=1 Conn=wye Model=1 kV=2.4 kW=117 kvar=68
New "Transformer.sub" Phases=3 Windings=2 XHL=0.008 Buses=[sourcebus, 650, ] Conns=[delta, wye, ] kVs=[115, 4.1600000000000001, ] kVAs=[5000, 5000, ] Taps=[1, 1, ] %Rs=[0.00050000000000000001, 0.00050000000000000001, ] Wdg=1 Wdg=2
New "Transformer.reg1" Phases=1 Bank=reg1 XHL=0.01 kVAs=[1666, 1666, ] Buses=[650.1, rg60.1, ] kVs=[2.3999999999999999, 2.3999999999999999, ] %LoadLoss=0.01
New "Transformer.reg2" Phases=1 Bank=reg1 XHL=0.01 kVAs=[1666, 1666, ] Buses=[650.2, rg60.2, ] kVs=[2.3999999999999999, 2.3999999999999999, ] %LoadLoss=0.01
New "Transformer.reg3" Phases=1 Bank=reg1 XHL=0.01 kVAs=[1666, 1666, ] Buses=[650.3, rg60.3, ] kVs=[2.3999999999999999, 2.3999999999999999, ] %LoadLoss=0.01
New "Transformer.xfm1" Phases=3 Windings=2 XHL=2 Buses=[633, 634, ] Conns=[wye, wye, ] kVs=[4.1600000000000001, 0.47999999999999998, ] kVAs=[500, 500, ] Taps=[1, 1, ] %Rs=[0.55000000000000004, 0.55000000000000004, ] Wdg=1 Wdg=2
New "RegControl.reg1" Transformer=reg1 Winding=2 VReg=122 Band=2 PTRatio=20 CTPrim=700 R=3 X=9
New "RegControl.reg2" Transformer=reg2 Winding=2 VReg=122 Band=2 PTRatio=20 CTPrim=700 R=3 X=9
New "RegControl.reg3" Transformer=reg3 Winding=2 VReg=122 Band=2 PTRatio=20 CTPrim=700 R=3 X=9
New "Capacitor.cap1" Bus1=675 Phases=3 kvar=[ 600] kV=4.16
New "Capacitor.cap2" Bus1=611.3 Phases=1 kvar=[ 100] kV=2.4
MakeBusList
Set VoltageBases=(115, 4.1600000000000001, 0.47999999999999998, )
! CalcVoltageBases
SetBusXY Bus=sourcebus X=200 Y=400
SetBusXY Bus=650 X=200 Y=350
SetBusXY Bus=rg60 X=200 Y=300
SetBusXY Bus=633 X=350 Y=250
SetBusXY Bus=634 X=400 Y=250
SetBusXY Bus=671 X=200 Y=100
SetBusXY Bus=645 X=100 Y=250
SetBusXY Bus=646 X=0 Y=250
SetBusXY Bus=692 X=250 Y=100
SetBusXY Bus=675 X=400 Y=100
SetBusXY Bus=611 X=0 Y=100
SetBusXY Bus=652 X=100 Y=0
SetBusXY Bus=670 X=200 Y=200
SetBusXY Bus=632 X=200 Y=250
SetBusXY Bus=680 X=200 Y=0
SetBusXY Bus=684 X=100 Y=100

Supressing defaults#

Since most circuits do not actually use most of the default items, suppressing them can remove some noise from the output.

Note that if a default object is edited, they will be

print(odd.Circuit.Save('', DSSSaveFlags.SingleFile|DSSSaveFlags.ToString|DSSSaveFlags.ExcludeDefault))
! Last saved by AltDSS/DSS C-API Library version 0.14.1 revision 8b3da5b576f4dedd16d2bfb88bfb911c0aca3783 based on OpenDSS SVN 3723 [FPC 3.2.2] (64-bit build) MVMULT INCREMENTAL_Y CONTEXT_API PM 20240217013457 on 2024-02-25T18:46:21.552Z
Clear
Set DefaultBaseFreq=60
New Circuit.ieee13nodeckt

Set EarthModel=Deri

New "LineCode.1" NPhases=3 BaseFreq=60 RMatrix=[0.086666667000000003 |0.029545455000000002 0.088371212000000005 |0.029071969999999999 0.029924242 0.087405303000000004 ] XMatrix=[0.204166667 |0.095018938999999997 0.19852272700000001 |0.072897726999999996 0.080227273000000002 0.20172348500000001 ] CMatrix=[2.8517100719999999 |-0.92029378699999997 3.0046318620000001 |-0.35075556600000002 -0.58501125300000001 2.7113475600000001 ]
New "LineCode.2" NPhases=3 BaseFreq=60 RMatrix=[0.088371212000000005 |0.029924240000000001 0.087405303000000004 |0.029545455000000002 0.029071969999999999 0.086666667000000003 ] XMatrix=[0.19852272700000001 |0.080227273000000002 0.20172348500000001 |0.095018938999999997 0.072897726999999996 0.204166667 ] CMatrix=[3.0046318620000001 |-0.58501125300000001 2.7113475600000001 |-0.92029378699999997 -0.35075556600000002 2.8517100719999999 ]
New "LineCode.3" NPhases=3 BaseFreq=60 RMatrix=[0.087405303000000004 |0.029071969999999999 0.086666667000000003 |0.029924242 0.029545455000000002 0.088371212000000005 ] XMatrix=[0.20172348500000001 |0.072897726999999996 0.204166667 |0.080227273000000002 0.095018938999999997 0.19852272700000001 ] CMatrix=[2.7113475600000001 |-0.35075556600000002 2.8517100719999999 |-0.58501125300000001 -0.92029378699999997 3.0046318620000001 ]
New "LineCode.4" NPhases=3 BaseFreq=60 RMatrix=[0.087405303000000004 |0.029924242 0.088371212000000005 |0.029071969999999999 0.029545455000000002 0.086666667000000003 ] XMatrix=[0.20172348500000001 |0.080227273000000002 0.19852272700000001 |0.072897726999999996 0.095018938999999997 0.204166667 ] CMatrix=[2.7113475600000001 |-0.58501125300000001 3.0046318620000001 |-0.35075556600000002 -0.92029378699999997 2.8517100719999999 ]
New "LineCode.5" NPhases=3 BaseFreq=60 RMatrix=[0.088371212000000005 |0.029545455000000002 0.086666667000000003 |0.029924242 0.029071969999999999 0.087405303000000004 ] XMatrix=[0.19852272700000001 |0.095018938999999997 0.204166667 |0.080227273000000002 0.072897726999999996 0.20172348500000001 ] CMatrix=[3.0046318620000001 |-0.92029378699999997 2.8517100719999999 |-0.58501125300000001 -0.35075556600000002 2.7113475600000001 ]
New "LineCode.6" NPhases=3 BaseFreq=60 RMatrix=[0.086666667000000003 |0.029071969999999999 0.087405303000000004 |0.029545455000000002 0.029924242 0.088371212000000005 ] XMatrix=[0.204166667 |0.072897726999999996 0.20172348500000001 |0.095018938999999997 0.080227273000000002 0.19852272700000001 ] CMatrix=[2.8517100719999999 |-0.35075556600000002 2.7113475600000001 |-0.92029378699999997 -0.58501125300000001 3.0046318620000001 ]
New "LineCode.7" NPhases=2 BaseFreq=60 RMatrix=[0.086666667000000003 |0.029071969999999999 0.087405303000000004 ] XMatrix=[0.204166667 |0.072897726999999996 0.20172348500000001 ] CMatrix=[2.5698295959999999 |-0.52995137000000003 2.5974600109999999 ]
New "LineCode.8" NPhases=2 BaseFreq=60 RMatrix=[0.086666667000000003 |0.029071969999999999 0.087405303000000004 ] XMatrix=[0.204166667 |0.072897726999999996 0.20172348500000001 ] CMatrix=[2.5698295959999999 |-0.52995137000000003 2.5974600109999999 ]
New "LineCode.9" NPhases=1 BaseFreq=60 RMatrix=[0.25174242400000002 ] XMatrix=[0.25520833300000001 ] CMatrix=[2.270366128 ]
New "LineCode.10" NPhases=1 BaseFreq=60 RMatrix=[0.25174242400000002 ] XMatrix=[0.25520833300000001 ] CMatrix=[2.270366128 ]
New "LineCode.11" NPhases=1 BaseFreq=60 RMatrix=[0.25174242400000002 ] XMatrix=[0.25520833300000001 ] CMatrix=[2.270366128 ]
New "LineCode.12" NPhases=3 BaseFreq=60 RMatrix=[0.28804924199999998 |0.098446969999999995 0.29032196999999998 |0.093257575999999995 0.098446969999999995 0.28804924199999998 ] XMatrix=[0.142443182 |0.052556817999999998 0.13564393899999999 |0.040852273000000001 0.052556817999999998 0.142443182 ] CMatrix=[33.771501489999999 |0 33.771501489999999 |0 0 33.771501489999999 ]
New "LineCode.300" NPhases=3 BaseFreq=60 RMatrix=[0.253181818 |0.039791667000000003 0.25071969700000002 |0.040340909000000001 0.039128787999999998 0.25178030299999998 ] XMatrix=[0.25270833300000001 |0.109450758 0.25698863599999999 |0.094981061000000006 0.086950758000000003 0.255132576 ] CMatrix=[2.6801503090000001 |-0.76928100600000004 2.5610381000000002 |-0.49950767600000001 -0.312072984 2.455590387 ]
New "LineCode.301" NPhases=3 BaseFreq=60 RMatrix=[0.365530303 |0.044071970000000002 0.36282196999999999 |0.044678030000000001 0.043333333000000002 0.36399621199999999 ] XMatrix=[0.267329545 |0.12200757600000001 0.27047348500000001 |0.107784091 0.099204545000000005 0.26910984799999998 ] CMatrix=[2.5724921630000002 |-0.72160597999999998 2.4643818820000001 |-0.47232939499999999 -0.29896109599999998 2.3688811190000001 ]
New "LineCode.302" NPhases=1 BaseFreq=60 RMatrix=[0.53020800000000001 ] XMatrix=[0.28134500000000001 ] CMatrix=[2.1225700000000001 ]
New "LineCode.303" NPhases=1 BaseFreq=60 RMatrix=[0.53020800000000001 ] XMatrix=[0.28134500000000001 ] CMatrix=[2.1225700000000001 ]
New "LineCode.304" NPhases=1 BaseFreq=60 RMatrix=[0.363958 ] XMatrix=[0.26916699999999999 ] CMatrix=[2.1922000000000001 ]
New "LineCode.400" NPhases=3 BaseFreq=60 RMatrix=[0.088205000000000006 |0.0312137 0.0901946 |0.030626400000000002 0.031614299999999998 0.088966500000000004 ] XMatrix=[0.20744000000000001 |0.093531400000000001 0.20078299999999999 |0.076031199999999993 0.085587899999999995 0.204877 ] CMatrix=[2.9030100000000001 |-0.67933500000000002 3.15896 |-0.22313 -0.48141600000000001 2.8965000000000001 ]
New "LineCode.601" NPhases=3 BaseFreq=60 RMatrix=[0.065625000000000003 |0.029545455000000002 0.063920455000000001 |0.029924242 0.029071969999999999 0.064659091000000002 ] XMatrix=[0.19278409099999999 |0.095018938999999997 0.19844697 |0.080227273000000002 0.072897726999999996 0.19598484799999999 ] CMatrix=[3.1648380359999999 |-1.002632425 2.993981593 |-0.63273651600000003 -0.37260871299999992 2.8326702030000002 ]
New "LineCode.602" NPhases=3 BaseFreq=60 RMatrix=[0.14253787900000001 |0.029924242 0.14157196999999999 |0.029545455000000002 0.029071969999999999 0.14083333300000001 ] XMatrix=[0.22375 |0.080227273000000002 0.226950758 |0.095018938999999997 0.072897726999999996 0.22939393899999999 ] CMatrix=[2.8630134229999999 |-0.54341491799999997 2.6020315890000001 |-0.84925849999999992 -0.33096214099999993 2.7251627679999997 ]
New "LineCode.603" NPhases=2 BaseFreq=60 RMatrix=[0.25178030299999998 |0.039128787999999998 0.25071969700000002 ] XMatrix=[0.255132576 |0.086950758000000003 0.25698863599999999 ] CMatrix=[2.366017603 |-0.45208383599999996 2.3439635079999999 ]
New "LineCode.604" NPhases=2 BaseFreq=60 RMatrix=[0.25071969700000002 |0.039128787999999998 0.25178030299999998 ] XMatrix=[0.25698863599999999 |0.086950758000000003 0.255132576 ] CMatrix=[2.3439635079999999 |-0.45208383599999996 2.366017603 ]
New "LineCode.605" NPhases=1 BaseFreq=60 RMatrix=[0.25174242400000002 ] XMatrix=[0.25520833300000001 ] CMatrix=[2.270366128 ]
New "LineCode.606" NPhases=3 BaseFreq=60 RMatrix=[0.15117424199999999 |0.060454544999999998 0.14945075799999999 |0.053958332999999997 0.060454544999999998 0.15117424199999999 ] XMatrix=[0.084526514999999997 |0.0062121210000000001 0.076534090999999999 |-0.0027083329999999998 0.0062121210000000001 0.084526514999999997 ] CMatrix=[48.674594079999999 |0 48.674594079999999 |0 0 48.674594079999999 ]
New "LineCode.607" NPhases=1 BaseFreq=60 RMatrix=[0.25426136399999999 ] XMatrix=[0.097045455000000003 ] CMatrix=[44.706615220000003 ]
New "LineCode.721" NPhases=3 BaseFreq=60 RMatrix=[0.055416667000000003 |0.012746212 0.050113636000000003 |0.006382576 0.012746212 0.055416667000000003 ] XMatrix=[0.037367424000000003 |-0.0069696970000000004 0.035984848 |-0.0078977270000000002 -0.0069696970000000004 0.037367424000000003 ] CMatrix=[80.274847280000003 |0 80.274847280000003 |0 0 80.274847280000003 ]
New "LineCode.722" NPhases=3 BaseFreq=60 RMatrix=[0.089981061000000001 |0.030852273 0.085000000000000006 |0.023371211999999999 0.030852273 0.089981061000000001 ] XMatrix=[0.056306818000000002 |-0.0061742419999999999 0.050719697000000001 |-0.011496212 -0.0061742419999999999 0.056306818000000002 ] CMatrix=[64.218410899999995 |0 64.218410899999995 |0 0 64.218410899999995 ]
New "LineCode.723" NPhases=3 BaseFreq=60 RMatrix=[0.245 |0.092253788000000003 0.24662878799999999 |0.086837121000000003 0.092253788000000003 0.245 ] XMatrix=[0.12714015200000001 |0.039981060999999998 0.119810606 |0.028806818000000001 0.039981060999999998 0.12714015200000001 ] CMatrix=[37.597711199999999 |0 37.597711199999999 |0 0 37.597711199999999 ]
New "LineCode.724" NPhases=3 BaseFreq=60 RMatrix=[0.39681818200000002 |0.098560605999999995 0.39901515199999998 |0.093295454999999999 0.098560605999999995 0.39681818200000002 ] XMatrix=[0.14693181799999999 |0.051856061000000002 0.14011363600000001 |0.040208332999999999 0.051856061000000002 0.14693181799999999 ] CMatrix=[30.267010290000005 |0 30.267010290000005 |0 0 30.267010290000005 ]
New "LineCode.mtx601" NPhases=3 BaseFreq=60 RMatrix=[0.34649999999999997 |0.156 0.33750000000000002 |0.158 0.1535 0.34139999999999998 ] XMatrix=[1.0179 |0.50170000000000003 1.0478000000000001 |0.42359999999999998 0.38490000000000002 1.0347999999999999 ] Units=mi
New "LineCode.mtx602" NPhases=3 BaseFreq=60 RMatrix=[0.75260000000000005 |0.158 0.74750000000000005 |0.156 0.1535 0.74360000000000004 ] XMatrix=[1.1814 |0.42359999999999998 1.1982999999999999 |0.50170000000000003 0.38490000000000002 1.2112000000000001 ] Units=mi
New "LineCode.mtx603" NPhases=2 BaseFreq=60 RMatrix=[1.3238000000000001 |0.20660000000000001 1.3293999999999999 ] XMatrix=[1.3569 |0.45910000000000001 1.3471 ] Units=mi
New "LineCode.mtx604" NPhases=2 BaseFreq=60 RMatrix=[1.3238000000000001 |0.20660000000000001 1.3293999999999999 ] XMatrix=[1.3569 |0.45910000000000001 1.3471 ] Units=mi
New "LineCode.mtx605" NPhases=1 BaseFreq=60 RMatrix=[1.3291999999999999 ] XMatrix=[1.3474999999999999 ] Units=mi
New "LineCode.mtx606" NPhases=3 Units=mi RMatrix=[0.79172100000000001 |0.31847599999999998 0.78164900000000004 |0.28344999999999998 0.31847599999999998 0.79172100000000001 ] XMatrix=[0.43835200000000002 |0.027683800000000001 0.39669700000000002 |-0.0184204 0.027683800000000001 0.43835200000000002 ] CMatrix=[383.94800000000004 |0 383.94800000000004 |0 0 383.94800000000004 ]
New "LineCode.mtx607" NPhases=1 BaseFreq=60 RMatrix=[1.3425 ] XMatrix=[0.51239999999999997 ] CMatrix=[236 ] Units=mi
Edit "Vsource.source" BasekV=115 pu=1.0001 Phases=3 Bus1=sourcebus Angle=30 MVASC3=20000 MVASC1=21000
New "Line.650632" Phases=3 Bus1=rg60.1.2.3 Bus2=632.1.2.3 LineCode=mtx601 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=2000 Units=ft
New "Line.632670" Phases=3 Bus1=632.1.2.3 Bus2=670.1.2.3 LineCode=mtx601 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=667 Units=ft
New "Line.670671" Phases=3 Bus1=670.1.2.3 Bus2=671.1.2.3 LineCode=mtx601 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=1333 Units=ft
New "Line.671680" Phases=3 Bus1=671.1.2.3 Bus2=680.1.2.3 LineCode=mtx601 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=1000 Units=ft
New "Line.632633" Phases=3 Bus1=632.1.2.3 Bus2=633.1.2.3 LineCode=mtx602 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=500 Units=ft
New "Line.632645" Phases=2 Bus1=632.3.2 Bus2=645.3.2 LineCode=mtx603 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=500 Units=ft
New "Line.645646" Phases=2 Bus1=645.3.2 Bus2=646.3.2 LineCode=mtx603 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=300 Units=ft
New "Line.692675" Phases=3 Bus1=692.1.2.3 Bus2=675.1.2.3 LineCode=mtx606 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=500 Units=ft
New "Line.671684" Phases=2 Bus1=671.1.3 Bus2=684.1.3 LineCode=mtx604 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=300 Units=ft
New "Line.684611" Phases=1 Bus1=684.3 Bus2=611.3 LineCode=mtx605 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=300 Units=ft
New "Line.684652" Phases=1 Bus1=684.1 Bus2=652.1 LineCode=mtx607 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=800 Units=ft
New "Line.671692" Phases=3 Bus1=671 Bus2=692 Switch=Yes Length=0.001 Units=none R1=0.0001 R0=0.0001 X1=0 X0=0 C1=0 C0=0
New "Load.671" Bus1=671.1.2.3 Phases=3 Conn=delta Model=1 kV=4.16 kW=1155 kvar=660
New "Load.634a" Bus1=634.1 Phases=1 Conn=wye Model=1 kV=0.277 kW=160 kvar=110
New "Load.634b" Bus1=634.2 Phases=1 Conn=wye Model=1 kV=0.277 kW=120 kvar=90
New "Load.634c" Bus1=634.3 Phases=1 Conn=wye Model=1 kV=0.277 kW=120 kvar=90
New "Load.645" Bus1=645.2 Phases=1 Conn=wye Model=1 kV=2.4 kW=170 kvar=125
New "Load.646" Bus1=646.2.3 Phases=1 Conn=delta Model=2 kV=4.16 kW=230 kvar=132
New "Load.692" Bus1=692.3.1 Phases=1 Conn=delta Model=5 kV=4.16 kW=170 kvar=151
New "Load.675a" Bus1=675.1 Phases=1 Conn=wye Model=1 kV=2.4 kW=485 kvar=190
New "Load.675b" Bus1=675.2 Phases=1 Conn=wye Model=1 kV=2.4 kW=68 kvar=60
New "Load.675c" Bus1=675.3 Phases=1 Conn=wye Model=1 kV=2.4 kW=290 kvar=212
New "Load.611" Bus1=611.3 Phases=1 Conn=wye Model=5 kV=2.4 kW=170 kvar=80
New "Load.652" Bus1=652.1 Phases=1 Conn=wye Model=2 kV=2.4 kW=128 kvar=86
New "Load.670a" Bus1=670.1 Phases=1 Conn=wye Model=1 kV=2.4 kW=17 kvar=10
New "Load.670b" Bus1=670.2 Phases=1 Conn=wye Model=1 kV=2.4 kW=66 kvar=38
New "Load.670c" Bus1=670.3 Phases=1 Conn=wye Model=1 kV=2.4 kW=117 kvar=68
New "Transformer.sub" Phases=3 Windings=2 XHL=0.008 Buses=[sourcebus, 650, ] Conns=[delta, wye, ] kVs=[115, 4.1600000000000001, ] kVAs=[5000, 5000, ] Taps=[1, 1, ] %Rs=[0.00050000000000000001, 0.00050000000000000001, ] Wdg=1 Wdg=2
New "Transformer.reg1" Phases=1 Bank=reg1 XHL=0.01 kVAs=[1666, 1666, ] Buses=[650.1, rg60.1, ] kVs=[2.3999999999999999, 2.3999999999999999, ] %LoadLoss=0.01
New "Transformer.reg2" Phases=1 Bank=reg1 XHL=0.01 kVAs=[1666, 1666, ] Buses=[650.2, rg60.2, ] kVs=[2.3999999999999999, 2.3999999999999999, ] %LoadLoss=0.01
New "Transformer.reg3" Phases=1 Bank=reg1 XHL=0.01 kVAs=[1666, 1666, ] Buses=[650.3, rg60.3, ] kVs=[2.3999999999999999, 2.3999999999999999, ] %LoadLoss=0.01
New "Transformer.xfm1" Phases=3 Windings=2 XHL=2 Buses=[633, 634, ] Conns=[wye, wye, ] kVs=[4.1600000000000001, 0.47999999999999998, ] kVAs=[500, 500, ] Taps=[1, 1, ] %Rs=[0.55000000000000004, 0.55000000000000004, ] Wdg=1 Wdg=2
New "RegControl.reg1" Transformer=reg1 Winding=2 VReg=122 Band=2 PTRatio=20 CTPrim=700 R=3 X=9
New "RegControl.reg2" Transformer=reg2 Winding=2 VReg=122 Band=2 PTRatio=20 CTPrim=700 R=3 X=9
New "RegControl.reg3" Transformer=reg3 Winding=2 VReg=122 Band=2 PTRatio=20 CTPrim=700 R=3 X=9
New "Capacitor.cap1" Bus1=675 Phases=3 kvar=[ 600] kV=4.16
New "Capacitor.cap2" Bus1=611.3 Phases=1 kvar=[ 100] kV=2.4
MakeBusList
Set VoltageBases=(115, 4.1600000000000001, 0.47999999999999998, )
! CalcVoltageBases
SetBusXY Bus=sourcebus X=200 Y=400
SetBusXY Bus=650 X=200 Y=350
SetBusXY Bus=rg60 X=200 Y=300
SetBusXY Bus=633 X=350 Y=250
SetBusXY Bus=634 X=400 Y=250
SetBusXY Bus=671 X=200 Y=100
SetBusXY Bus=645 X=100 Y=250
SetBusXY Bus=646 X=0 Y=250
SetBusXY Bus=692 X=250 Y=100
SetBusXY Bus=675 X=400 Y=100
SetBusXY Bus=611 X=0 Y=100
SetBusXY Bus=652 X=100 Y=0
SetBusXY Bus=670 X=200 Y=200
SetBusXY Bus=632 X=200 Y=250
SetBusXY Bus=680 X=200 Y=0
SetBusXY Bus=684 X=100 Y=100

Keeping the order of elements#

Some circuits, probably somewhat ill-conditioned, are very sensible to the order of elements. This means that saving the circuit and reloading it can give slightly different results. This is expected, given how the numerical methods used in the engine work, but it is understandable it the user needs to keep the save results. This is used, for example, to test some of the DSS-Extensions functions related to JSON imports/exports.

print(odd.Circuit.Save('', DSSSaveFlags.SingleFile|DSSSaveFlags.ToString|DSSSaveFlags.ExcludeDefault|DSSSaveFlags.KeepOrder))
! Last saved by AltDSS/DSS C-API Library version 0.14.1 revision 8b3da5b576f4dedd16d2bfb88bfb911c0aca3783 based on OpenDSS SVN 3723 [FPC 3.2.2] (64-bit build) MVMULT INCREMENTAL_Y CONTEXT_API PM 20240217013457 on 2024-02-25T18:46:21.555Z
Clear
Set DefaultBaseFreq=60
New Circuit.ieee13nodeckt

Set EarthModel=Deri

New "LineCode.1" NPhases=3 BaseFreq=60 RMatrix=[0.086666667000000003 |0.029545455000000002 0.088371212000000005 |0.029071969999999999 0.029924242 0.087405303000000004 ] XMatrix=[0.204166667 |0.095018938999999997 0.19852272700000001 |0.072897726999999996 0.080227273000000002 0.20172348500000001 ] CMatrix=[2.8517100719999999 |-0.92029378699999997 3.0046318620000001 |-0.35075556600000002 -0.58501125300000001 2.7113475600000001 ]
New "LineCode.2" NPhases=3 BaseFreq=60 RMatrix=[0.088371212000000005 |0.029924240000000001 0.087405303000000004 |0.029545455000000002 0.029071969999999999 0.086666667000000003 ] XMatrix=[0.19852272700000001 |0.080227273000000002 0.20172348500000001 |0.095018938999999997 0.072897726999999996 0.204166667 ] CMatrix=[3.0046318620000001 |-0.58501125300000001 2.7113475600000001 |-0.92029378699999997 -0.35075556600000002 2.8517100719999999 ]
New "LineCode.3" NPhases=3 BaseFreq=60 RMatrix=[0.087405303000000004 |0.029071969999999999 0.086666667000000003 |0.029924242 0.029545455000000002 0.088371212000000005 ] XMatrix=[0.20172348500000001 |0.072897726999999996 0.204166667 |0.080227273000000002 0.095018938999999997 0.19852272700000001 ] CMatrix=[2.7113475600000001 |-0.35075556600000002 2.8517100719999999 |-0.58501125300000001 -0.92029378699999997 3.0046318620000001 ]
New "LineCode.4" NPhases=3 BaseFreq=60 RMatrix=[0.087405303000000004 |0.029924242 0.088371212000000005 |0.029071969999999999 0.029545455000000002 0.086666667000000003 ] XMatrix=[0.20172348500000001 |0.080227273000000002 0.19852272700000001 |0.072897726999999996 0.095018938999999997 0.204166667 ] CMatrix=[2.7113475600000001 |-0.58501125300000001 3.0046318620000001 |-0.35075556600000002 -0.92029378699999997 2.8517100719999999 ]
New "LineCode.5" NPhases=3 BaseFreq=60 RMatrix=[0.088371212000000005 |0.029545455000000002 0.086666667000000003 |0.029924242 0.029071969999999999 0.087405303000000004 ] XMatrix=[0.19852272700000001 |0.095018938999999997 0.204166667 |0.080227273000000002 0.072897726999999996 0.20172348500000001 ] CMatrix=[3.0046318620000001 |-0.92029378699999997 2.8517100719999999 |-0.58501125300000001 -0.35075556600000002 2.7113475600000001 ]
New "LineCode.6" NPhases=3 BaseFreq=60 RMatrix=[0.086666667000000003 |0.029071969999999999 0.087405303000000004 |0.029545455000000002 0.029924242 0.088371212000000005 ] XMatrix=[0.204166667 |0.072897726999999996 0.20172348500000001 |0.095018938999999997 0.080227273000000002 0.19852272700000001 ] CMatrix=[2.8517100719999999 |-0.35075556600000002 2.7113475600000001 |-0.92029378699999997 -0.58501125300000001 3.0046318620000001 ]
New "LineCode.7" NPhases=2 BaseFreq=60 RMatrix=[0.086666667000000003 |0.029071969999999999 0.087405303000000004 ] XMatrix=[0.204166667 |0.072897726999999996 0.20172348500000001 ] CMatrix=[2.5698295959999999 |-0.52995137000000003 2.5974600109999999 ]
New "LineCode.8" NPhases=2 BaseFreq=60 RMatrix=[0.086666667000000003 |0.029071969999999999 0.087405303000000004 ] XMatrix=[0.204166667 |0.072897726999999996 0.20172348500000001 ] CMatrix=[2.5698295959999999 |-0.52995137000000003 2.5974600109999999 ]
New "LineCode.9" NPhases=1 BaseFreq=60 RMatrix=[0.25174242400000002 ] XMatrix=[0.25520833300000001 ] CMatrix=[2.270366128 ]
New "LineCode.10" NPhases=1 BaseFreq=60 RMatrix=[0.25174242400000002 ] XMatrix=[0.25520833300000001 ] CMatrix=[2.270366128 ]
New "LineCode.11" NPhases=1 BaseFreq=60 RMatrix=[0.25174242400000002 ] XMatrix=[0.25520833300000001 ] CMatrix=[2.270366128 ]
New "LineCode.12" NPhases=3 BaseFreq=60 RMatrix=[0.28804924199999998 |0.098446969999999995 0.29032196999999998 |0.093257575999999995 0.098446969999999995 0.28804924199999998 ] XMatrix=[0.142443182 |0.052556817999999998 0.13564393899999999 |0.040852273000000001 0.052556817999999998 0.142443182 ] CMatrix=[33.771501489999999 |0 33.771501489999999 |0 0 33.771501489999999 ]
New "LineCode.300" NPhases=3 BaseFreq=60 RMatrix=[0.253181818 |0.039791667000000003 0.25071969700000002 |0.040340909000000001 0.039128787999999998 0.25178030299999998 ] XMatrix=[0.25270833300000001 |0.109450758 0.25698863599999999 |0.094981061000000006 0.086950758000000003 0.255132576 ] CMatrix=[2.6801503090000001 |-0.76928100600000004 2.5610381000000002 |-0.49950767600000001 -0.312072984 2.455590387 ]
New "LineCode.301" NPhases=3 BaseFreq=60 RMatrix=[0.365530303 |0.044071970000000002 0.36282196999999999 |0.044678030000000001 0.043333333000000002 0.36399621199999999 ] XMatrix=[0.267329545 |0.12200757600000001 0.27047348500000001 |0.107784091 0.099204545000000005 0.26910984799999998 ] CMatrix=[2.5724921630000002 |-0.72160597999999998 2.4643818820000001 |-0.47232939499999999 -0.29896109599999998 2.3688811190000001 ]
New "LineCode.302" NPhases=1 BaseFreq=60 RMatrix=[0.53020800000000001 ] XMatrix=[0.28134500000000001 ] CMatrix=[2.1225700000000001 ]
New "LineCode.303" NPhases=1 BaseFreq=60 RMatrix=[0.53020800000000001 ] XMatrix=[0.28134500000000001 ] CMatrix=[2.1225700000000001 ]
New "LineCode.304" NPhases=1 BaseFreq=60 RMatrix=[0.363958 ] XMatrix=[0.26916699999999999 ] CMatrix=[2.1922000000000001 ]
New "LineCode.400" NPhases=3 BaseFreq=60 RMatrix=[0.088205000000000006 |0.0312137 0.0901946 |0.030626400000000002 0.031614299999999998 0.088966500000000004 ] XMatrix=[0.20744000000000001 |0.093531400000000001 0.20078299999999999 |0.076031199999999993 0.085587899999999995 0.204877 ] CMatrix=[2.9030100000000001 |-0.67933500000000002 3.15896 |-0.22313 -0.48141600000000001 2.8965000000000001 ]
New "LineCode.601" NPhases=3 BaseFreq=60 RMatrix=[0.065625000000000003 |0.029545455000000002 0.063920455000000001 |0.029924242 0.029071969999999999 0.064659091000000002 ] XMatrix=[0.19278409099999999 |0.095018938999999997 0.19844697 |0.080227273000000002 0.072897726999999996 0.19598484799999999 ] CMatrix=[3.1648380359999999 |-1.002632425 2.993981593 |-0.63273651600000003 -0.37260871299999992 2.8326702030000002 ]
New "LineCode.602" NPhases=3 BaseFreq=60 RMatrix=[0.14253787900000001 |0.029924242 0.14157196999999999 |0.029545455000000002 0.029071969999999999 0.14083333300000001 ] XMatrix=[0.22375 |0.080227273000000002 0.226950758 |0.095018938999999997 0.072897726999999996 0.22939393899999999 ] CMatrix=[2.8630134229999999 |-0.54341491799999997 2.6020315890000001 |-0.84925849999999992 -0.33096214099999993 2.7251627679999997 ]
New "LineCode.603" NPhases=2 BaseFreq=60 RMatrix=[0.25178030299999998 |0.039128787999999998 0.25071969700000002 ] XMatrix=[0.255132576 |0.086950758000000003 0.25698863599999999 ] CMatrix=[2.366017603 |-0.45208383599999996 2.3439635079999999 ]
New "LineCode.604" NPhases=2 BaseFreq=60 RMatrix=[0.25071969700000002 |0.039128787999999998 0.25178030299999998 ] XMatrix=[0.25698863599999999 |0.086950758000000003 0.255132576 ] CMatrix=[2.3439635079999999 |-0.45208383599999996 2.366017603 ]
New "LineCode.605" NPhases=1 BaseFreq=60 RMatrix=[0.25174242400000002 ] XMatrix=[0.25520833300000001 ] CMatrix=[2.270366128 ]
New "LineCode.606" NPhases=3 BaseFreq=60 RMatrix=[0.15117424199999999 |0.060454544999999998 0.14945075799999999 |0.053958332999999997 0.060454544999999998 0.15117424199999999 ] XMatrix=[0.084526514999999997 |0.0062121210000000001 0.076534090999999999 |-0.0027083329999999998 0.0062121210000000001 0.084526514999999997 ] CMatrix=[48.674594079999999 |0 48.674594079999999 |0 0 48.674594079999999 ]
New "LineCode.607" NPhases=1 BaseFreq=60 RMatrix=[0.25426136399999999 ] XMatrix=[0.097045455000000003 ] CMatrix=[44.706615220000003 ]
New "LineCode.721" NPhases=3 BaseFreq=60 RMatrix=[0.055416667000000003 |0.012746212 0.050113636000000003 |0.006382576 0.012746212 0.055416667000000003 ] XMatrix=[0.037367424000000003 |-0.0069696970000000004 0.035984848 |-0.0078977270000000002 -0.0069696970000000004 0.037367424000000003 ] CMatrix=[80.274847280000003 |0 80.274847280000003 |0 0 80.274847280000003 ]
New "LineCode.722" NPhases=3 BaseFreq=60 RMatrix=[0.089981061000000001 |0.030852273 0.085000000000000006 |0.023371211999999999 0.030852273 0.089981061000000001 ] XMatrix=[0.056306818000000002 |-0.0061742419999999999 0.050719697000000001 |-0.011496212 -0.0061742419999999999 0.056306818000000002 ] CMatrix=[64.218410899999995 |0 64.218410899999995 |0 0 64.218410899999995 ]
New "LineCode.723" NPhases=3 BaseFreq=60 RMatrix=[0.245 |0.092253788000000003 0.24662878799999999 |0.086837121000000003 0.092253788000000003 0.245 ] XMatrix=[0.12714015200000001 |0.039981060999999998 0.119810606 |0.028806818000000001 0.039981060999999998 0.12714015200000001 ] CMatrix=[37.597711199999999 |0 37.597711199999999 |0 0 37.597711199999999 ]
New "LineCode.724" NPhases=3 BaseFreq=60 RMatrix=[0.39681818200000002 |0.098560605999999995 0.39901515199999998 |0.093295454999999999 0.098560605999999995 0.39681818200000002 ] XMatrix=[0.14693181799999999 |0.051856061000000002 0.14011363600000001 |0.040208332999999999 0.051856061000000002 0.14693181799999999 ] CMatrix=[30.267010290000005 |0 30.267010290000005 |0 0 30.267010290000005 ]
New "LineCode.mtx601" NPhases=3 BaseFreq=60 RMatrix=[0.34649999999999997 |0.156 0.33750000000000002 |0.158 0.1535 0.34139999999999998 ] XMatrix=[1.0179 |0.50170000000000003 1.0478000000000001 |0.42359999999999998 0.38490000000000002 1.0347999999999999 ] Units=mi
New "LineCode.mtx602" NPhases=3 BaseFreq=60 RMatrix=[0.75260000000000005 |0.158 0.74750000000000005 |0.156 0.1535 0.74360000000000004 ] XMatrix=[1.1814 |0.42359999999999998 1.1982999999999999 |0.50170000000000003 0.38490000000000002 1.2112000000000001 ] Units=mi
New "LineCode.mtx603" NPhases=2 BaseFreq=60 RMatrix=[1.3238000000000001 |0.20660000000000001 1.3293999999999999 ] XMatrix=[1.3569 |0.45910000000000001 1.3471 ] Units=mi
New "LineCode.mtx604" NPhases=2 BaseFreq=60 RMatrix=[1.3238000000000001 |0.20660000000000001 1.3293999999999999 ] XMatrix=[1.3569 |0.45910000000000001 1.3471 ] Units=mi
New "LineCode.mtx605" NPhases=1 BaseFreq=60 RMatrix=[1.3291999999999999 ] XMatrix=[1.3474999999999999 ] Units=mi
New "LineCode.mtx606" NPhases=3 Units=mi RMatrix=[0.79172100000000001 |0.31847599999999998 0.78164900000000004 |0.28344999999999998 0.31847599999999998 0.79172100000000001 ] XMatrix=[0.43835200000000002 |0.027683800000000001 0.39669700000000002 |-0.0184204 0.027683800000000001 0.43835200000000002 ] CMatrix=[383.94800000000004 |0 383.94800000000004 |0 0 383.94800000000004 ]
New "LineCode.mtx607" NPhases=1 BaseFreq=60 RMatrix=[1.3425 ] XMatrix=[0.51239999999999997 ] CMatrix=[236 ] Units=mi
Edit "Vsource.source" BasekV=115 pu=1.0001 Phases=3 Bus1=sourcebus Angle=30 MVASC3=20000 MVASC1=21000
New "Transformer.sub" Phases=3 Windings=2 XHL=0.008 Buses=[sourcebus, 650, ] Conns=[delta, wye, ] kVs=[115, 4.1600000000000001, ] kVAs=[5000, 5000, ] Taps=[1, 1, ] %Rs=[0.00050000000000000001, 0.00050000000000000001, ] Wdg=1 Wdg=2
New "Transformer.reg1" Phases=1 Bank=reg1 XHL=0.01 kVAs=[1666, 1666, ] Buses=[650.1, rg60.1, ] kVs=[2.3999999999999999, 2.3999999999999999, ] %LoadLoss=0.01
New "RegControl.reg1" Transformer=reg1 Winding=2 VReg=122 Band=2 PTRatio=20 CTPrim=700 R=3 X=9
New "Transformer.reg2" Phases=1 Bank=reg1 XHL=0.01 kVAs=[1666, 1666, ] Buses=[650.2, rg60.2, ] kVs=[2.3999999999999999, 2.3999999999999999, ] %LoadLoss=0.01
New "RegControl.reg2" Transformer=reg2 Winding=2 VReg=122 Band=2 PTRatio=20 CTPrim=700 R=3 X=9
New "Transformer.reg3" Phases=1 Bank=reg1 XHL=0.01 kVAs=[1666, 1666, ] Buses=[650.3, rg60.3, ] kVs=[2.3999999999999999, 2.3999999999999999, ] %LoadLoss=0.01
New "RegControl.reg3" Transformer=reg3 Winding=2 VReg=122 Band=2 PTRatio=20 CTPrim=700 R=3 X=9
New "Transformer.xfm1" Phases=3 Windings=2 XHL=2 Buses=[633, 634, ] Conns=[wye, wye, ] kVs=[4.1600000000000001, 0.47999999999999998, ] kVAs=[500, 500, ] Taps=[1, 1, ] %Rs=[0.55000000000000004, 0.55000000000000004, ] Wdg=1 Wdg=2
New "Load.671" Bus1=671.1.2.3 Phases=3 Conn=delta Model=1 kV=4.16 kW=1155 kvar=660
New "Load.634a" Bus1=634.1 Phases=1 Conn=wye Model=1 kV=0.277 kW=160 kvar=110
New "Load.634b" Bus1=634.2 Phases=1 Conn=wye Model=1 kV=0.277 kW=120 kvar=90
New "Load.634c" Bus1=634.3 Phases=1 Conn=wye Model=1 kV=0.277 kW=120 kvar=90
New "Load.645" Bus1=645.2 Phases=1 Conn=wye Model=1 kV=2.4 kW=170 kvar=125
New "Load.646" Bus1=646.2.3 Phases=1 Conn=delta Model=2 kV=4.16 kW=230 kvar=132
New "Load.692" Bus1=692.3.1 Phases=1 Conn=delta Model=5 kV=4.16 kW=170 kvar=151
New "Load.675a" Bus1=675.1 Phases=1 Conn=wye Model=1 kV=2.4 kW=485 kvar=190
New "Load.675b" Bus1=675.2 Phases=1 Conn=wye Model=1 kV=2.4 kW=68 kvar=60
New "Load.675c" Bus1=675.3 Phases=1 Conn=wye Model=1 kV=2.4 kW=290 kvar=212
New "Load.611" Bus1=611.3 Phases=1 Conn=wye Model=5 kV=2.4 kW=170 kvar=80
New "Load.652" Bus1=652.1 Phases=1 Conn=wye Model=2 kV=2.4 kW=128 kvar=86
New "Load.670a" Bus1=670.1 Phases=1 Conn=wye Model=1 kV=2.4 kW=17 kvar=10
New "Load.670b" Bus1=670.2 Phases=1 Conn=wye Model=1 kV=2.4 kW=66 kvar=38
New "Load.670c" Bus1=670.3 Phases=1 Conn=wye Model=1 kV=2.4 kW=117 kvar=68
New "Capacitor.cap1" Bus1=675 Phases=3 kvar=[ 600] kV=4.16
New "Capacitor.cap2" Bus1=611.3 Phases=1 kvar=[ 100] kV=2.4
New "Line.650632" Phases=3 Bus1=rg60.1.2.3 Bus2=632.1.2.3 LineCode=mtx601 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=2000 Units=ft
New "Line.632670" Phases=3 Bus1=632.1.2.3 Bus2=670.1.2.3 LineCode=mtx601 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=667 Units=ft
New "Line.670671" Phases=3 Bus1=670.1.2.3 Bus2=671.1.2.3 LineCode=mtx601 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=1333 Units=ft
New "Line.671680" Phases=3 Bus1=671.1.2.3 Bus2=680.1.2.3 LineCode=mtx601 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=1000 Units=ft
New "Line.632633" Phases=3 Bus1=632.1.2.3 Bus2=633.1.2.3 LineCode=mtx602 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=500 Units=ft
New "Line.632645" Phases=2 Bus1=632.3.2 Bus2=645.3.2 LineCode=mtx603 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=500 Units=ft
New "Line.645646" Phases=2 Bus1=645.3.2 Bus2=646.3.2 LineCode=mtx603 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=300 Units=ft
New "Line.692675" Phases=3 Bus1=692.1.2.3 Bus2=675.1.2.3 LineCode=mtx606 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=500 Units=ft
New "Line.671684" Phases=2 Bus1=671.1.3 Bus2=684.1.3 LineCode=mtx604 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=300 Units=ft
New "Line.684611" Phases=1 Bus1=684.3 Bus2=611.3 LineCode=mtx605 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=300 Units=ft
New "Line.684652" Phases=1 Bus1=684.1 Bus2=652.1 LineCode=mtx607 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=800 Units=ft
New "Line.671692" Phases=3 Bus1=671 Bus2=692 Switch=Yes Length=0.001 Units=none R1=0.0001 R0=0.0001 X1=0 X0=0 C1=0 C0=0
MakeBusList
Set VoltageBases=(115, 4.1600000000000001, 0.47999999999999998, )
! CalcVoltageBases
SetBusXY Bus=sourcebus X=200 Y=400
SetBusXY Bus=650 X=200 Y=350
SetBusXY Bus=rg60 X=200 Y=300
SetBusXY Bus=633 X=350 Y=250
SetBusXY Bus=634 X=400 Y=250
SetBusXY Bus=671 X=200 Y=100
SetBusXY Bus=645 X=100 Y=250
SetBusXY Bus=646 X=0 Y=250
SetBusXY Bus=692 X=250 Y=100
SetBusXY Bus=675 X=400 Y=100
SetBusXY Bus=611 X=0 Y=100
SetBusXY Bus=652 X=100 Y=0
SetBusXY Bus=670 X=200 Y=200
SetBusXY Bus=632 X=200 Y=250
SetBusXY Bus=680 X=200 Y=0
SetBusXY Bus=684 X=100 Y=100

Open elements#

Keeping the order is generally enough to reproduce the save SystemY matrix, but there are also situations that some elements are normal-open.

odd(f'''
    redirect "{IEEE13_PATH}"
    open Line.671692 terminal=1
''')
print(odd.Circuit.Save('', DSSSaveFlags.SingleFile|DSSSaveFlags.ToString|DSSSaveFlags.ExcludeDefault|DSSSaveFlags.KeepOrder|DSSSaveFlags.IsOpen))
! Last saved by AltDSS/DSS C-API Library version 0.14.1 revision 8b3da5b576f4dedd16d2bfb88bfb911c0aca3783 based on OpenDSS SVN 3723 [FPC 3.2.2] (64-bit build) MVMULT INCREMENTAL_Y CONTEXT_API PM 20240217013457 on 2024-02-25T18:46:21.563Z
Clear
Set DefaultBaseFreq=60
New Circuit.ieee13nodeckt

Set EarthModel=Deri

New "LineCode.1" NPhases=3 BaseFreq=60 RMatrix=[0.086666667000000003 |0.029545455000000002 0.088371212000000005 |0.029071969999999999 0.029924242 0.087405303000000004 ] XMatrix=[0.204166667 |0.095018938999999997 0.19852272700000001 |0.072897726999999996 0.080227273000000002 0.20172348500000001 ] CMatrix=[2.8517100719999999 |-0.92029378699999997 3.0046318620000001 |-0.35075556600000002 -0.58501125300000001 2.7113475600000001 ]
New "LineCode.2" NPhases=3 BaseFreq=60 RMatrix=[0.088371212000000005 |0.029924240000000001 0.087405303000000004 |0.029545455000000002 0.029071969999999999 0.086666667000000003 ] XMatrix=[0.19852272700000001 |0.080227273000000002 0.20172348500000001 |0.095018938999999997 0.072897726999999996 0.204166667 ] CMatrix=[3.0046318620000001 |-0.58501125300000001 2.7113475600000001 |-0.92029378699999997 -0.35075556600000002 2.8517100719999999 ]
New "LineCode.3" NPhases=3 BaseFreq=60 RMatrix=[0.087405303000000004 |0.029071969999999999 0.086666667000000003 |0.029924242 0.029545455000000002 0.088371212000000005 ] XMatrix=[0.20172348500000001 |0.072897726999999996 0.204166667 |0.080227273000000002 0.095018938999999997 0.19852272700000001 ] CMatrix=[2.7113475600000001 |-0.35075556600000002 2.8517100719999999 |-0.58501125300000001 -0.92029378699999997 3.0046318620000001 ]
New "LineCode.4" NPhases=3 BaseFreq=60 RMatrix=[0.087405303000000004 |0.029924242 0.088371212000000005 |0.029071969999999999 0.029545455000000002 0.086666667000000003 ] XMatrix=[0.20172348500000001 |0.080227273000000002 0.19852272700000001 |0.072897726999999996 0.095018938999999997 0.204166667 ] CMatrix=[2.7113475600000001 |-0.58501125300000001 3.0046318620000001 |-0.35075556600000002 -0.92029378699999997 2.8517100719999999 ]
New "LineCode.5" NPhases=3 BaseFreq=60 RMatrix=[0.088371212000000005 |0.029545455000000002 0.086666667000000003 |0.029924242 0.029071969999999999 0.087405303000000004 ] XMatrix=[0.19852272700000001 |0.095018938999999997 0.204166667 |0.080227273000000002 0.072897726999999996 0.20172348500000001 ] CMatrix=[3.0046318620000001 |-0.92029378699999997 2.8517100719999999 |-0.58501125300000001 -0.35075556600000002 2.7113475600000001 ]
New "LineCode.6" NPhases=3 BaseFreq=60 RMatrix=[0.086666667000000003 |0.029071969999999999 0.087405303000000004 |0.029545455000000002 0.029924242 0.088371212000000005 ] XMatrix=[0.204166667 |0.072897726999999996 0.20172348500000001 |0.095018938999999997 0.080227273000000002 0.19852272700000001 ] CMatrix=[2.8517100719999999 |-0.35075556600000002 2.7113475600000001 |-0.92029378699999997 -0.58501125300000001 3.0046318620000001 ]
New "LineCode.7" NPhases=2 BaseFreq=60 RMatrix=[0.086666667000000003 |0.029071969999999999 0.087405303000000004 ] XMatrix=[0.204166667 |0.072897726999999996 0.20172348500000001 ] CMatrix=[2.5698295959999999 |-0.52995137000000003 2.5974600109999999 ]
New "LineCode.8" NPhases=2 BaseFreq=60 RMatrix=[0.086666667000000003 |0.029071969999999999 0.087405303000000004 ] XMatrix=[0.204166667 |0.072897726999999996 0.20172348500000001 ] CMatrix=[2.5698295959999999 |-0.52995137000000003 2.5974600109999999 ]
New "LineCode.9" NPhases=1 BaseFreq=60 RMatrix=[0.25174242400000002 ] XMatrix=[0.25520833300000001 ] CMatrix=[2.270366128 ]
New "LineCode.10" NPhases=1 BaseFreq=60 RMatrix=[0.25174242400000002 ] XMatrix=[0.25520833300000001 ] CMatrix=[2.270366128 ]
New "LineCode.11" NPhases=1 BaseFreq=60 RMatrix=[0.25174242400000002 ] XMatrix=[0.25520833300000001 ] CMatrix=[2.270366128 ]
New "LineCode.12" NPhases=3 BaseFreq=60 RMatrix=[0.28804924199999998 |0.098446969999999995 0.29032196999999998 |0.093257575999999995 0.098446969999999995 0.28804924199999998 ] XMatrix=[0.142443182 |0.052556817999999998 0.13564393899999999 |0.040852273000000001 0.052556817999999998 0.142443182 ] CMatrix=[33.771501489999999 |0 33.771501489999999 |0 0 33.771501489999999 ]
New "LineCode.300" NPhases=3 BaseFreq=60 RMatrix=[0.253181818 |0.039791667000000003 0.25071969700000002 |0.040340909000000001 0.039128787999999998 0.25178030299999998 ] XMatrix=[0.25270833300000001 |0.109450758 0.25698863599999999 |0.094981061000000006 0.086950758000000003 0.255132576 ] CMatrix=[2.6801503090000001 |-0.76928100600000004 2.5610381000000002 |-0.49950767600000001 -0.312072984 2.455590387 ]
New "LineCode.301" NPhases=3 BaseFreq=60 RMatrix=[0.365530303 |0.044071970000000002 0.36282196999999999 |0.044678030000000001 0.043333333000000002 0.36399621199999999 ] XMatrix=[0.267329545 |0.12200757600000001 0.27047348500000001 |0.107784091 0.099204545000000005 0.26910984799999998 ] CMatrix=[2.5724921630000002 |-0.72160597999999998 2.4643818820000001 |-0.47232939499999999 -0.29896109599999998 2.3688811190000001 ]
New "LineCode.302" NPhases=1 BaseFreq=60 RMatrix=[0.53020800000000001 ] XMatrix=[0.28134500000000001 ] CMatrix=[2.1225700000000001 ]
New "LineCode.303" NPhases=1 BaseFreq=60 RMatrix=[0.53020800000000001 ] XMatrix=[0.28134500000000001 ] CMatrix=[2.1225700000000001 ]
New "LineCode.304" NPhases=1 BaseFreq=60 RMatrix=[0.363958 ] XMatrix=[0.26916699999999999 ] CMatrix=[2.1922000000000001 ]
New "LineCode.400" NPhases=3 BaseFreq=60 RMatrix=[0.088205000000000006 |0.0312137 0.0901946 |0.030626400000000002 0.031614299999999998 0.088966500000000004 ] XMatrix=[0.20744000000000001 |0.093531400000000001 0.20078299999999999 |0.076031199999999993 0.085587899999999995 0.204877 ] CMatrix=[2.9030100000000001 |-0.67933500000000002 3.15896 |-0.22313 -0.48141600000000001 2.8965000000000001 ]
New "LineCode.601" NPhases=3 BaseFreq=60 RMatrix=[0.065625000000000003 |0.029545455000000002 0.063920455000000001 |0.029924242 0.029071969999999999 0.064659091000000002 ] XMatrix=[0.19278409099999999 |0.095018938999999997 0.19844697 |0.080227273000000002 0.072897726999999996 0.19598484799999999 ] CMatrix=[3.1648380359999999 |-1.002632425 2.993981593 |-0.63273651600000003 -0.37260871299999992 2.8326702030000002 ]
New "LineCode.602" NPhases=3 BaseFreq=60 RMatrix=[0.14253787900000001 |0.029924242 0.14157196999999999 |0.029545455000000002 0.029071969999999999 0.14083333300000001 ] XMatrix=[0.22375 |0.080227273000000002 0.226950758 |0.095018938999999997 0.072897726999999996 0.22939393899999999 ] CMatrix=[2.8630134229999999 |-0.54341491799999997 2.6020315890000001 |-0.84925849999999992 -0.33096214099999993 2.7251627679999997 ]
New "LineCode.603" NPhases=2 BaseFreq=60 RMatrix=[0.25178030299999998 |0.039128787999999998 0.25071969700000002 ] XMatrix=[0.255132576 |0.086950758000000003 0.25698863599999999 ] CMatrix=[2.366017603 |-0.45208383599999996 2.3439635079999999 ]
New "LineCode.604" NPhases=2 BaseFreq=60 RMatrix=[0.25071969700000002 |0.039128787999999998 0.25178030299999998 ] XMatrix=[0.25698863599999999 |0.086950758000000003 0.255132576 ] CMatrix=[2.3439635079999999 |-0.45208383599999996 2.366017603 ]
New "LineCode.605" NPhases=1 BaseFreq=60 RMatrix=[0.25174242400000002 ] XMatrix=[0.25520833300000001 ] CMatrix=[2.270366128 ]
New "LineCode.606" NPhases=3 BaseFreq=60 RMatrix=[0.15117424199999999 |0.060454544999999998 0.14945075799999999 |0.053958332999999997 0.060454544999999998 0.15117424199999999 ] XMatrix=[0.084526514999999997 |0.0062121210000000001 0.076534090999999999 |-0.0027083329999999998 0.0062121210000000001 0.084526514999999997 ] CMatrix=[48.674594079999999 |0 48.674594079999999 |0 0 48.674594079999999 ]
New "LineCode.607" NPhases=1 BaseFreq=60 RMatrix=[0.25426136399999999 ] XMatrix=[0.097045455000000003 ] CMatrix=[44.706615220000003 ]
New "LineCode.721" NPhases=3 BaseFreq=60 RMatrix=[0.055416667000000003 |0.012746212 0.050113636000000003 |0.006382576 0.012746212 0.055416667000000003 ] XMatrix=[0.037367424000000003 |-0.0069696970000000004 0.035984848 |-0.0078977270000000002 -0.0069696970000000004 0.037367424000000003 ] CMatrix=[80.274847280000003 |0 80.274847280000003 |0 0 80.274847280000003 ]
New "LineCode.722" NPhases=3 BaseFreq=60 RMatrix=[0.089981061000000001 |0.030852273 0.085000000000000006 |0.023371211999999999 0.030852273 0.089981061000000001 ] XMatrix=[0.056306818000000002 |-0.0061742419999999999 0.050719697000000001 |-0.011496212 -0.0061742419999999999 0.056306818000000002 ] CMatrix=[64.218410899999995 |0 64.218410899999995 |0 0 64.218410899999995 ]
New "LineCode.723" NPhases=3 BaseFreq=60 RMatrix=[0.245 |0.092253788000000003 0.24662878799999999 |0.086837121000000003 0.092253788000000003 0.245 ] XMatrix=[0.12714015200000001 |0.039981060999999998 0.119810606 |0.028806818000000001 0.039981060999999998 0.12714015200000001 ] CMatrix=[37.597711199999999 |0 37.597711199999999 |0 0 37.597711199999999 ]
New "LineCode.724" NPhases=3 BaseFreq=60 RMatrix=[0.39681818200000002 |0.098560605999999995 0.39901515199999998 |0.093295454999999999 0.098560605999999995 0.39681818200000002 ] XMatrix=[0.14693181799999999 |0.051856061000000002 0.14011363600000001 |0.040208332999999999 0.051856061000000002 0.14693181799999999 ] CMatrix=[30.267010290000005 |0 30.267010290000005 |0 0 30.267010290000005 ]
New "LineCode.mtx601" NPhases=3 BaseFreq=60 RMatrix=[0.34649999999999997 |0.156 0.33750000000000002 |0.158 0.1535 0.34139999999999998 ] XMatrix=[1.0179 |0.50170000000000003 1.0478000000000001 |0.42359999999999998 0.38490000000000002 1.0347999999999999 ] Units=mi
New "LineCode.mtx602" NPhases=3 BaseFreq=60 RMatrix=[0.75260000000000005 |0.158 0.74750000000000005 |0.156 0.1535 0.74360000000000004 ] XMatrix=[1.1814 |0.42359999999999998 1.1982999999999999 |0.50170000000000003 0.38490000000000002 1.2112000000000001 ] Units=mi
New "LineCode.mtx603" NPhases=2 BaseFreq=60 RMatrix=[1.3238000000000001 |0.20660000000000001 1.3293999999999999 ] XMatrix=[1.3569 |0.45910000000000001 1.3471 ] Units=mi
New "LineCode.mtx604" NPhases=2 BaseFreq=60 RMatrix=[1.3238000000000001 |0.20660000000000001 1.3293999999999999 ] XMatrix=[1.3569 |0.45910000000000001 1.3471 ] Units=mi
New "LineCode.mtx605" NPhases=1 BaseFreq=60 RMatrix=[1.3291999999999999 ] XMatrix=[1.3474999999999999 ] Units=mi
New "LineCode.mtx606" NPhases=3 Units=mi RMatrix=[0.79172100000000001 |0.31847599999999998 0.78164900000000004 |0.28344999999999998 0.31847599999999998 0.79172100000000001 ] XMatrix=[0.43835200000000002 |0.027683800000000001 0.39669700000000002 |-0.0184204 0.027683800000000001 0.43835200000000002 ] CMatrix=[383.94800000000004 |0 383.94800000000004 |0 0 383.94800000000004 ]
New "LineCode.mtx607" NPhases=1 BaseFreq=60 RMatrix=[1.3425 ] XMatrix=[0.51239999999999997 ] CMatrix=[236 ] Units=mi
Edit "Vsource.source" BasekV=115 pu=1.0001 Phases=3 Bus1=sourcebus Angle=30 MVASC3=20000 MVASC1=21000
New "Transformer.sub" Phases=3 Windings=2 XHL=0.008 Buses=[sourcebus, 650, ] Conns=[delta, wye, ] kVs=[115, 4.1600000000000001, ] kVAs=[5000, 5000, ] Taps=[1, 1, ] %Rs=[0.00050000000000000001, 0.00050000000000000001, ] Wdg=1 Wdg=2
New "Transformer.reg1" Phases=1 Bank=reg1 XHL=0.01 kVAs=[1666, 1666, ] Buses=[650.1, rg60.1, ] kVs=[2.3999999999999999, 2.3999999999999999, ] %LoadLoss=0.01
New "RegControl.reg1" Transformer=reg1 Winding=2 VReg=122 Band=2 PTRatio=20 CTPrim=700 R=3 X=9
New "Transformer.reg2" Phases=1 Bank=reg1 XHL=0.01 kVAs=[1666, 1666, ] Buses=[650.2, rg60.2, ] kVs=[2.3999999999999999, 2.3999999999999999, ] %LoadLoss=0.01
New "RegControl.reg2" Transformer=reg2 Winding=2 VReg=122 Band=2 PTRatio=20 CTPrim=700 R=3 X=9
New "Transformer.reg3" Phases=1 Bank=reg1 XHL=0.01 kVAs=[1666, 1666, ] Buses=[650.3, rg60.3, ] kVs=[2.3999999999999999, 2.3999999999999999, ] %LoadLoss=0.01
New "RegControl.reg3" Transformer=reg3 Winding=2 VReg=122 Band=2 PTRatio=20 CTPrim=700 R=3 X=9
New "Transformer.xfm1" Phases=3 Windings=2 XHL=2 Buses=[633, 634, ] Conns=[wye, wye, ] kVs=[4.1600000000000001, 0.47999999999999998, ] kVAs=[500, 500, ] Taps=[1, 1, ] %Rs=[0.55000000000000004, 0.55000000000000004, ] Wdg=1 Wdg=2
New "Load.671" Bus1=671.1.2.3 Phases=3 Conn=delta Model=1 kV=4.16 kW=1155 kvar=660
New "Load.634a" Bus1=634.1 Phases=1 Conn=wye Model=1 kV=0.277 kW=160 kvar=110
New "Load.634b" Bus1=634.2 Phases=1 Conn=wye Model=1 kV=0.277 kW=120 kvar=90
New "Load.634c" Bus1=634.3 Phases=1 Conn=wye Model=1 kV=0.277 kW=120 kvar=90
New "Load.645" Bus1=645.2 Phases=1 Conn=wye Model=1 kV=2.4 kW=170 kvar=125
New "Load.646" Bus1=646.2.3 Phases=1 Conn=delta Model=2 kV=4.16 kW=230 kvar=132
New "Load.692" Bus1=692.3.1 Phases=1 Conn=delta Model=5 kV=4.16 kW=170 kvar=151
New "Load.675a" Bus1=675.1 Phases=1 Conn=wye Model=1 kV=2.4 kW=485 kvar=190
New "Load.675b" Bus1=675.2 Phases=1 Conn=wye Model=1 kV=2.4 kW=68 kvar=60
New "Load.675c" Bus1=675.3 Phases=1 Conn=wye Model=1 kV=2.4 kW=290 kvar=212
New "Load.611" Bus1=611.3 Phases=1 Conn=wye Model=5 kV=2.4 kW=170 kvar=80
New "Load.652" Bus1=652.1 Phases=1 Conn=wye Model=2 kV=2.4 kW=128 kvar=86
New "Load.670a" Bus1=670.1 Phases=1 Conn=wye Model=1 kV=2.4 kW=17 kvar=10
New "Load.670b" Bus1=670.2 Phases=1 Conn=wye Model=1 kV=2.4 kW=66 kvar=38
New "Load.670c" Bus1=670.3 Phases=1 Conn=wye Model=1 kV=2.4 kW=117 kvar=68
New "Capacitor.cap1" Bus1=675 Phases=3 kvar=[ 600] kV=4.16
New "Capacitor.cap2" Bus1=611.3 Phases=1 kvar=[ 100] kV=2.4
New "Line.650632" Phases=3 Bus1=rg60.1.2.3 Bus2=632.1.2.3 LineCode=mtx601 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=2000 Units=ft
New "Line.632670" Phases=3 Bus1=632.1.2.3 Bus2=670.1.2.3 LineCode=mtx601 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=667 Units=ft
New "Line.670671" Phases=3 Bus1=670.1.2.3 Bus2=671.1.2.3 LineCode=mtx601 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=1333 Units=ft
New "Line.671680" Phases=3 Bus1=671.1.2.3 Bus2=680.1.2.3 LineCode=mtx601 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=1000 Units=ft
New "Line.632633" Phases=3 Bus1=632.1.2.3 Bus2=633.1.2.3 LineCode=mtx602 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=500 Units=ft
New "Line.632645" Phases=2 Bus1=632.3.2 Bus2=645.3.2 LineCode=mtx603 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=500 Units=ft
New "Line.645646" Phases=2 Bus1=645.3.2 Bus2=646.3.2 LineCode=mtx603 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=300 Units=ft
New "Line.692675" Phases=3 Bus1=692.1.2.3 Bus2=675.1.2.3 LineCode=mtx606 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=500 Units=ft
New "Line.671684" Phases=2 Bus1=671.1.3 Bus2=684.1.3 LineCode=mtx604 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=300 Units=ft
New "Line.684611" Phases=1 Bus1=684.3 Bus2=611.3 LineCode=mtx605 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=300 Units=ft
New "Line.684652" Phases=1 Bus1=684.1 Bus2=652.1 LineCode=mtx607 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=800 Units=ft
New "Line.671692" Phases=3 Bus1=671 Bus2=692 Switch=Yes Length=0.001 Units=none R1=0.0001 R0=0.0001 X1=0 X0=0 C1=0 C0=0
MakeBusList
Set VoltageBases=(115, 4.1600000000000001, 0.47999999999999998, )
! CalcVoltageBases
SetBusXY Bus=sourcebus X=200 Y=400
SetBusXY Bus=650 X=200 Y=350
SetBusXY Bus=rg60 X=200 Y=300
SetBusXY Bus=633 X=350 Y=250
SetBusXY Bus=634 X=400 Y=250
SetBusXY Bus=671 X=200 Y=100
SetBusXY Bus=645 X=100 Y=250
SetBusXY Bus=646 X=0 Y=250
SetBusXY Bus=692 X=250 Y=100
SetBusXY Bus=675 X=400 Y=100
SetBusXY Bus=611 X=0 Y=100
SetBusXY Bus=652 X=100 Y=0
SetBusXY Bus=670 X=200 Y=200
SetBusXY Bus=632 X=200 Y=250
SetBusXY Bus=680 X=200 Y=0
SetBusXY Bus=684 X=100 Y=100
Open Line.671692 1

Including the options#

Finally, including the circuit options might be important to reproduce it:

print(odd.Circuit.Save('', DSSSaveFlags.SingleFile|DSSSaveFlags.ToString|DSSSaveFlags.ExcludeDefault|DSSSaveFlags.KeepOrder|DSSSaveFlags.IsOpen|DSSSaveFlags.IncludeOptions))
! Last saved by AltDSS/DSS C-API Library version 0.14.1 revision 8b3da5b576f4dedd16d2bfb88bfb911c0aca3783 based on OpenDSS SVN 3723 [FPC 3.2.2] (64-bit build) MVMULT INCREMENTAL_Y CONTEXT_API PM 20240217013457 on 2024-02-25T18:46:21.566Z
Clear
Set DefaultBaseFreq=60
New Circuit.ieee13nodeckt

Set EarthModel=Deri
! OPTIONS
! NumNodes = 41
Set ControlMode=Static
Set Random=Gaussian
Set frequency=60
Set stepsize=0.001
Set number=100
Set tolerance=0.0001
Set maxiterations=15
Set miniterations=2
Set loadmodel=PowerFlow
Set loadmult=1
Set Normvminpu=0.94999999999999996
Set Normvmaxpu=1.05
Set Emergvminpu=0.90000000000000002
Set Emergvmaxpu=1.0800000000000001
Set %mean=82.58
Set %stddev=15.31
Set LDCurve=
Set %growth=2.5
Set genkw=1000
Set genpf=1
Set capkvar=600
Set addtype=generator
Set zonelock=No
Set ueweight=    1.00
Set lossweight=    1.00
Set ueregs=[10]
Set lossregs=[13]
Set algorithm=Normal
Set Trapezoidal=No
Set genmult=1
Set Basefrequency=60
Set harmonics=(ALL)
Set maxcontroliter=10


New "LineCode.1" NPhases=3 BaseFreq=60 RMatrix=[0.086666667000000003 |0.029545455000000002 0.088371212000000005 |0.029071969999999999 0.029924242 0.087405303000000004 ] XMatrix=[0.204166667 |0.095018938999999997 0.19852272700000001 |0.072897726999999996 0.080227273000000002 0.20172348500000001 ] CMatrix=[2.8517100719999999 |-0.92029378699999997 3.0046318620000001 |-0.35075556600000002 -0.58501125300000001 2.7113475600000001 ]
New "LineCode.2" NPhases=3 BaseFreq=60 RMatrix=[0.088371212000000005 |0.029924240000000001 0.087405303000000004 |0.029545455000000002 0.029071969999999999 0.086666667000000003 ] XMatrix=[0.19852272700000001 |0.080227273000000002 0.20172348500000001 |0.095018938999999997 0.072897726999999996 0.204166667 ] CMatrix=[3.0046318620000001 |-0.58501125300000001 2.7113475600000001 |-0.92029378699999997 -0.35075556600000002 2.8517100719999999 ]
New "LineCode.3" NPhases=3 BaseFreq=60 RMatrix=[0.087405303000000004 |0.029071969999999999 0.086666667000000003 |0.029924242 0.029545455000000002 0.088371212000000005 ] XMatrix=[0.20172348500000001 |0.072897726999999996 0.204166667 |0.080227273000000002 0.095018938999999997 0.19852272700000001 ] CMatrix=[2.7113475600000001 |-0.35075556600000002 2.8517100719999999 |-0.58501125300000001 -0.92029378699999997 3.0046318620000001 ]
New "LineCode.4" NPhases=3 BaseFreq=60 RMatrix=[0.087405303000000004 |0.029924242 0.088371212000000005 |0.029071969999999999 0.029545455000000002 0.086666667000000003 ] XMatrix=[0.20172348500000001 |0.080227273000000002 0.19852272700000001 |0.072897726999999996 0.095018938999999997 0.204166667 ] CMatrix=[2.7113475600000001 |-0.58501125300000001 3.0046318620000001 |-0.35075556600000002 -0.92029378699999997 2.8517100719999999 ]
New "LineCode.5" NPhases=3 BaseFreq=60 RMatrix=[0.088371212000000005 |0.029545455000000002 0.086666667000000003 |0.029924242 0.029071969999999999 0.087405303000000004 ] XMatrix=[0.19852272700000001 |0.095018938999999997 0.204166667 |0.080227273000000002 0.072897726999999996 0.20172348500000001 ] CMatrix=[3.0046318620000001 |-0.92029378699999997 2.8517100719999999 |-0.58501125300000001 -0.35075556600000002 2.7113475600000001 ]
New "LineCode.6" NPhases=3 BaseFreq=60 RMatrix=[0.086666667000000003 |0.029071969999999999 0.087405303000000004 |0.029545455000000002 0.029924242 0.088371212000000005 ] XMatrix=[0.204166667 |0.072897726999999996 0.20172348500000001 |0.095018938999999997 0.080227273000000002 0.19852272700000001 ] CMatrix=[2.8517100719999999 |-0.35075556600000002 2.7113475600000001 |-0.92029378699999997 -0.58501125300000001 3.0046318620000001 ]
New "LineCode.7" NPhases=2 BaseFreq=60 RMatrix=[0.086666667000000003 |0.029071969999999999 0.087405303000000004 ] XMatrix=[0.204166667 |0.072897726999999996 0.20172348500000001 ] CMatrix=[2.5698295959999999 |-0.52995137000000003 2.5974600109999999 ]
New "LineCode.8" NPhases=2 BaseFreq=60 RMatrix=[0.086666667000000003 |0.029071969999999999 0.087405303000000004 ] XMatrix=[0.204166667 |0.072897726999999996 0.20172348500000001 ] CMatrix=[2.5698295959999999 |-0.52995137000000003 2.5974600109999999 ]
New "LineCode.9" NPhases=1 BaseFreq=60 RMatrix=[0.25174242400000002 ] XMatrix=[0.25520833300000001 ] CMatrix=[2.270366128 ]
New "LineCode.10" NPhases=1 BaseFreq=60 RMatrix=[0.25174242400000002 ] XMatrix=[0.25520833300000001 ] CMatrix=[2.270366128 ]
New "LineCode.11" NPhases=1 BaseFreq=60 RMatrix=[0.25174242400000002 ] XMatrix=[0.25520833300000001 ] CMatrix=[2.270366128 ]
New "LineCode.12" NPhases=3 BaseFreq=60 RMatrix=[0.28804924199999998 |0.098446969999999995 0.29032196999999998 |0.093257575999999995 0.098446969999999995 0.28804924199999998 ] XMatrix=[0.142443182 |0.052556817999999998 0.13564393899999999 |0.040852273000000001 0.052556817999999998 0.142443182 ] CMatrix=[33.771501489999999 |0 33.771501489999999 |0 0 33.771501489999999 ]
New "LineCode.300" NPhases=3 BaseFreq=60 RMatrix=[0.253181818 |0.039791667000000003 0.25071969700000002 |0.040340909000000001 0.039128787999999998 0.25178030299999998 ] XMatrix=[0.25270833300000001 |0.109450758 0.25698863599999999 |0.094981061000000006 0.086950758000000003 0.255132576 ] CMatrix=[2.6801503090000001 |-0.76928100600000004 2.5610381000000002 |-0.49950767600000001 -0.312072984 2.455590387 ]
New "LineCode.301" NPhases=3 BaseFreq=60 RMatrix=[0.365530303 |0.044071970000000002 0.36282196999999999 |0.044678030000000001 0.043333333000000002 0.36399621199999999 ] XMatrix=[0.267329545 |0.12200757600000001 0.27047348500000001 |0.107784091 0.099204545000000005 0.26910984799999998 ] CMatrix=[2.5724921630000002 |-0.72160597999999998 2.4643818820000001 |-0.47232939499999999 -0.29896109599999998 2.3688811190000001 ]
New "LineCode.302" NPhases=1 BaseFreq=60 RMatrix=[0.53020800000000001 ] XMatrix=[0.28134500000000001 ] CMatrix=[2.1225700000000001 ]
New "LineCode.303" NPhases=1 BaseFreq=60 RMatrix=[0.53020800000000001 ] XMatrix=[0.28134500000000001 ] CMatrix=[2.1225700000000001 ]
New "LineCode.304" NPhases=1 BaseFreq=60 RMatrix=[0.363958 ] XMatrix=[0.26916699999999999 ] CMatrix=[2.1922000000000001 ]
New "LineCode.400" NPhases=3 BaseFreq=60 RMatrix=[0.088205000000000006 |0.0312137 0.0901946 |0.030626400000000002 0.031614299999999998 0.088966500000000004 ] XMatrix=[0.20744000000000001 |0.093531400000000001 0.20078299999999999 |0.076031199999999993 0.085587899999999995 0.204877 ] CMatrix=[2.9030100000000001 |-0.67933500000000002 3.15896 |-0.22313 -0.48141600000000001 2.8965000000000001 ]
New "LineCode.601" NPhases=3 BaseFreq=60 RMatrix=[0.065625000000000003 |0.029545455000000002 0.063920455000000001 |0.029924242 0.029071969999999999 0.064659091000000002 ] XMatrix=[0.19278409099999999 |0.095018938999999997 0.19844697 |0.080227273000000002 0.072897726999999996 0.19598484799999999 ] CMatrix=[3.1648380359999999 |-1.002632425 2.993981593 |-0.63273651600000003 -0.37260871299999992 2.8326702030000002 ]
New "LineCode.602" NPhases=3 BaseFreq=60 RMatrix=[0.14253787900000001 |0.029924242 0.14157196999999999 |0.029545455000000002 0.029071969999999999 0.14083333300000001 ] XMatrix=[0.22375 |0.080227273000000002 0.226950758 |0.095018938999999997 0.072897726999999996 0.22939393899999999 ] CMatrix=[2.8630134229999999 |-0.54341491799999997 2.6020315890000001 |-0.84925849999999992 -0.33096214099999993 2.7251627679999997 ]
New "LineCode.603" NPhases=2 BaseFreq=60 RMatrix=[0.25178030299999998 |0.039128787999999998 0.25071969700000002 ] XMatrix=[0.255132576 |0.086950758000000003 0.25698863599999999 ] CMatrix=[2.366017603 |-0.45208383599999996 2.3439635079999999 ]
New "LineCode.604" NPhases=2 BaseFreq=60 RMatrix=[0.25071969700000002 |0.039128787999999998 0.25178030299999998 ] XMatrix=[0.25698863599999999 |0.086950758000000003 0.255132576 ] CMatrix=[2.3439635079999999 |-0.45208383599999996 2.366017603 ]
New "LineCode.605" NPhases=1 BaseFreq=60 RMatrix=[0.25174242400000002 ] XMatrix=[0.25520833300000001 ] CMatrix=[2.270366128 ]
New "LineCode.606" NPhases=3 BaseFreq=60 RMatrix=[0.15117424199999999 |0.060454544999999998 0.14945075799999999 |0.053958332999999997 0.060454544999999998 0.15117424199999999 ] XMatrix=[0.084526514999999997 |0.0062121210000000001 0.076534090999999999 |-0.0027083329999999998 0.0062121210000000001 0.084526514999999997 ] CMatrix=[48.674594079999999 |0 48.674594079999999 |0 0 48.674594079999999 ]
New "LineCode.607" NPhases=1 BaseFreq=60 RMatrix=[0.25426136399999999 ] XMatrix=[0.097045455000000003 ] CMatrix=[44.706615220000003 ]
New "LineCode.721" NPhases=3 BaseFreq=60 RMatrix=[0.055416667000000003 |0.012746212 0.050113636000000003 |0.006382576 0.012746212 0.055416667000000003 ] XMatrix=[0.037367424000000003 |-0.0069696970000000004 0.035984848 |-0.0078977270000000002 -0.0069696970000000004 0.037367424000000003 ] CMatrix=[80.274847280000003 |0 80.274847280000003 |0 0 80.274847280000003 ]
New "LineCode.722" NPhases=3 BaseFreq=60 RMatrix=[0.089981061000000001 |0.030852273 0.085000000000000006 |0.023371211999999999 0.030852273 0.089981061000000001 ] XMatrix=[0.056306818000000002 |-0.0061742419999999999 0.050719697000000001 |-0.011496212 -0.0061742419999999999 0.056306818000000002 ] CMatrix=[64.218410899999995 |0 64.218410899999995 |0 0 64.218410899999995 ]
New "LineCode.723" NPhases=3 BaseFreq=60 RMatrix=[0.245 |0.092253788000000003 0.24662878799999999 |0.086837121000000003 0.092253788000000003 0.245 ] XMatrix=[0.12714015200000001 |0.039981060999999998 0.119810606 |0.028806818000000001 0.039981060999999998 0.12714015200000001 ] CMatrix=[37.597711199999999 |0 37.597711199999999 |0 0 37.597711199999999 ]
New "LineCode.724" NPhases=3 BaseFreq=60 RMatrix=[0.39681818200000002 |0.098560605999999995 0.39901515199999998 |0.093295454999999999 0.098560605999999995 0.39681818200000002 ] XMatrix=[0.14693181799999999 |0.051856061000000002 0.14011363600000001 |0.040208332999999999 0.051856061000000002 0.14693181799999999 ] CMatrix=[30.267010290000005 |0 30.267010290000005 |0 0 30.267010290000005 ]
New "LineCode.mtx601" NPhases=3 BaseFreq=60 RMatrix=[0.34649999999999997 |0.156 0.33750000000000002 |0.158 0.1535 0.34139999999999998 ] XMatrix=[1.0179 |0.50170000000000003 1.0478000000000001 |0.42359999999999998 0.38490000000000002 1.0347999999999999 ] Units=mi
New "LineCode.mtx602" NPhases=3 BaseFreq=60 RMatrix=[0.75260000000000005 |0.158 0.74750000000000005 |0.156 0.1535 0.74360000000000004 ] XMatrix=[1.1814 |0.42359999999999998 1.1982999999999999 |0.50170000000000003 0.38490000000000002 1.2112000000000001 ] Units=mi
New "LineCode.mtx603" NPhases=2 BaseFreq=60 RMatrix=[1.3238000000000001 |0.20660000000000001 1.3293999999999999 ] XMatrix=[1.3569 |0.45910000000000001 1.3471 ] Units=mi
New "LineCode.mtx604" NPhases=2 BaseFreq=60 RMatrix=[1.3238000000000001 |0.20660000000000001 1.3293999999999999 ] XMatrix=[1.3569 |0.45910000000000001 1.3471 ] Units=mi
New "LineCode.mtx605" NPhases=1 BaseFreq=60 RMatrix=[1.3291999999999999 ] XMatrix=[1.3474999999999999 ] Units=mi
New "LineCode.mtx606" NPhases=3 Units=mi RMatrix=[0.79172100000000001 |0.31847599999999998 0.78164900000000004 |0.28344999999999998 0.31847599999999998 0.79172100000000001 ] XMatrix=[0.43835200000000002 |0.027683800000000001 0.39669700000000002 |-0.0184204 0.027683800000000001 0.43835200000000002 ] CMatrix=[383.94800000000004 |0 383.94800000000004 |0 0 383.94800000000004 ]
New "LineCode.mtx607" NPhases=1 BaseFreq=60 RMatrix=[1.3425 ] XMatrix=[0.51239999999999997 ] CMatrix=[236 ] Units=mi
Edit "Vsource.source" BasekV=115 pu=1.0001 Phases=3 Bus1=sourcebus Angle=30 MVASC3=20000 MVASC1=21000
New "Transformer.sub" Phases=3 Windings=2 XHL=0.008 Buses=[sourcebus, 650, ] Conns=[delta, wye, ] kVs=[115, 4.1600000000000001, ] kVAs=[5000, 5000, ] Taps=[1, 1, ] %Rs=[0.00050000000000000001, 0.00050000000000000001, ] Wdg=1 Wdg=2
New "Transformer.reg1" Phases=1 Bank=reg1 XHL=0.01 kVAs=[1666, 1666, ] Buses=[650.1, rg60.1, ] kVs=[2.3999999999999999, 2.3999999999999999, ] %LoadLoss=0.01
New "RegControl.reg1" Transformer=reg1 Winding=2 VReg=122 Band=2 PTRatio=20 CTPrim=700 R=3 X=9
New "Transformer.reg2" Phases=1 Bank=reg1 XHL=0.01 kVAs=[1666, 1666, ] Buses=[650.2, rg60.2, ] kVs=[2.3999999999999999, 2.3999999999999999, ] %LoadLoss=0.01
New "RegControl.reg2" Transformer=reg2 Winding=2 VReg=122 Band=2 PTRatio=20 CTPrim=700 R=3 X=9
New "Transformer.reg3" Phases=1 Bank=reg1 XHL=0.01 kVAs=[1666, 1666, ] Buses=[650.3, rg60.3, ] kVs=[2.3999999999999999, 2.3999999999999999, ] %LoadLoss=0.01
New "RegControl.reg3" Transformer=reg3 Winding=2 VReg=122 Band=2 PTRatio=20 CTPrim=700 R=3 X=9
New "Transformer.xfm1" Phases=3 Windings=2 XHL=2 Buses=[633, 634, ] Conns=[wye, wye, ] kVs=[4.1600000000000001, 0.47999999999999998, ] kVAs=[500, 500, ] Taps=[1, 1, ] %Rs=[0.55000000000000004, 0.55000000000000004, ] Wdg=1 Wdg=2
New "Load.671" Bus1=671.1.2.3 Phases=3 Conn=delta Model=1 kV=4.16 kW=1155 kvar=660
New "Load.634a" Bus1=634.1 Phases=1 Conn=wye Model=1 kV=0.277 kW=160 kvar=110
New "Load.634b" Bus1=634.2 Phases=1 Conn=wye Model=1 kV=0.277 kW=120 kvar=90
New "Load.634c" Bus1=634.3 Phases=1 Conn=wye Model=1 kV=0.277 kW=120 kvar=90
New "Load.645" Bus1=645.2 Phases=1 Conn=wye Model=1 kV=2.4 kW=170 kvar=125
New "Load.646" Bus1=646.2.3 Phases=1 Conn=delta Model=2 kV=4.16 kW=230 kvar=132
New "Load.692" Bus1=692.3.1 Phases=1 Conn=delta Model=5 kV=4.16 kW=170 kvar=151
New "Load.675a" Bus1=675.1 Phases=1 Conn=wye Model=1 kV=2.4 kW=485 kvar=190
New "Load.675b" Bus1=675.2 Phases=1 Conn=wye Model=1 kV=2.4 kW=68 kvar=60
New "Load.675c" Bus1=675.3 Phases=1 Conn=wye Model=1 kV=2.4 kW=290 kvar=212
New "Load.611" Bus1=611.3 Phases=1 Conn=wye Model=5 kV=2.4 kW=170 kvar=80
New "Load.652" Bus1=652.1 Phases=1 Conn=wye Model=2 kV=2.4 kW=128 kvar=86
New "Load.670a" Bus1=670.1 Phases=1 Conn=wye Model=1 kV=2.4 kW=17 kvar=10
New "Load.670b" Bus1=670.2 Phases=1 Conn=wye Model=1 kV=2.4 kW=66 kvar=38
New "Load.670c" Bus1=670.3 Phases=1 Conn=wye Model=1 kV=2.4 kW=117 kvar=68
New "Capacitor.cap1" Bus1=675 Phases=3 kvar=[ 600] kV=4.16
New "Capacitor.cap2" Bus1=611.3 Phases=1 kvar=[ 100] kV=2.4
New "Line.650632" Phases=3 Bus1=rg60.1.2.3 Bus2=632.1.2.3 LineCode=mtx601 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=2000 Units=ft
New "Line.632670" Phases=3 Bus1=632.1.2.3 Bus2=670.1.2.3 LineCode=mtx601 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=667 Units=ft
New "Line.670671" Phases=3 Bus1=670.1.2.3 Bus2=671.1.2.3 LineCode=mtx601 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=1333 Units=ft
New "Line.671680" Phases=3 Bus1=671.1.2.3 Bus2=680.1.2.3 LineCode=mtx601 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=1000 Units=ft
New "Line.632633" Phases=3 Bus1=632.1.2.3 Bus2=633.1.2.3 LineCode=mtx602 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=500 Units=ft
New "Line.632645" Phases=2 Bus1=632.3.2 Bus2=645.3.2 LineCode=mtx603 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=500 Units=ft
New "Line.645646" Phases=2 Bus1=645.3.2 Bus2=646.3.2 LineCode=mtx603 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=300 Units=ft
New "Line.692675" Phases=3 Bus1=692.1.2.3 Bus2=675.1.2.3 LineCode=mtx606 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=500 Units=ft
New "Line.671684" Phases=2 Bus1=671.1.3 Bus2=684.1.3 LineCode=mtx604 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=300 Units=ft
New "Line.684611" Phases=1 Bus1=684.3 Bus2=611.3 LineCode=mtx605 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=300 Units=ft
New "Line.684652" Phases=1 Bus1=684.1 Bus2=652.1 LineCode=mtx607 Ratings=[ 400] NormAmps=400 EmergAmps=600 Length=800 Units=ft
New "Line.671692" Phases=3 Bus1=671 Bus2=692 Switch=Yes Length=0.001 Units=none R1=0.0001 R0=0.0001 X1=0 X0=0 C1=0 C0=0
MakeBusList
Set VoltageBases=(115, 4.1600000000000001, 0.47999999999999998, )
! CalcVoltageBases
SetBusXY Bus=sourcebus X=200 Y=400
SetBusXY Bus=650 X=200 Y=350
SetBusXY Bus=rg60 X=200 Y=300
SetBusXY Bus=633 X=350 Y=250
SetBusXY Bus=634 X=400 Y=250
SetBusXY Bus=671 X=200 Y=100
SetBusXY Bus=645 X=100 Y=250
SetBusXY Bus=646 X=0 Y=250
SetBusXY Bus=692 X=250 Y=100
SetBusXY Bus=675 X=400 Y=100
SetBusXY Bus=611 X=0 Y=100
SetBusXY Bus=652 X=100 Y=0
SetBusXY Bus=670 X=200 Y=200
SetBusXY Bus=632 X=200 Y=250
SetBusXY Bus=680 X=200 Y=0
SetBusXY Bus=684 X=100 Y=100
Open Line.671692 1

Interaction with CompatFlags()#

Besides the CalcVoltageBases mentioned before, the PropertyTracking flag also affects some output. Property tracking was introduced as an attempt to make the saved data (both DSS scripts and JSON) less ambiguous.

IEEE4_DSS = '''
clear
Set DefaultBaseFrequency=60
new circuit.4busDYBal   basekV=12.47 phases=3 mvasc3=200000 200000
set earthmodel=carson
new wiredata.conductor Runits=mi Rac=0.306 GMRunits=ft GMRac=0.0244  Radunits=in Diam=0.721 normamps=530
new wiredata.neutral   Runits=mi Rac=0.592 GMRunits=ft GMRac=0.00814 Radunits=in Diam=0.563 normamps=340
new linegeometry.4wire nconds=4 nphases=3 reduce=yes 
~ cond=1 wire=conductor units=ft x=-4   h=28 
~ cond=2 wire=conductor units=ft x=-1.5 h=28 
~ cond=3 wire=conductor units=ft x=3    h=28 
~ cond=4 wire=neutral   units=ft x=0    h=24 
new line.line1 geometry=4wire length=2000 units=ft bus1=sourcebus bus2=n2
new transformer.t1 xhl=6
~ wdg=1 bus=n2 conn=delta kV=12.47 kVA=6000 %r=0.5 
~ wdg=2 bus=n3 conn=wye   kV=4.16  kVA=6000 %r=0.5 
new line.line2 bus1=n3 bus2=n4 geometry=4wire length=2500 units=ft  
new load.load1 phases=3 bus1=n4 conn=wye kV=4.16 kW=5400 pf=0.9  model=1 vminpu=0.75
set voltagebases=[12.47, 4.16] 
'''

Without property tracking#

Note here that when the load is edited, it still outputs kW, PF and kvar, which can be misleading and could confuse third-party parsers that don’t fully implement the OpenDSS parser:

from dss import DSSCompatFlags
odd.Basic.CompatFlags(DSSCompatFlags.NoPropertyTracking)
odd(IEEE4_DSS)
odd('load.load1.kvar=1000')
print(odd.Circuit.Save('', DSSSaveFlags.SingleFile|DSSSaveFlags.ToString|DSSSaveFlags.ExcludeDefault|DSSSaveFlags.KeepOrder))
! Last saved by AltDSS/DSS C-API Library version 0.14.1 revision 8b3da5b576f4dedd16d2bfb88bfb911c0aca3783 based on OpenDSS SVN 3723 [FPC 3.2.2] (64-bit build) MVMULT INCREMENTAL_Y CONTEXT_API PM 20240217013457 on 2024-02-25T18:46:21.573Z
Clear
Set DefaultBaseFreq=60
New Circuit.4busdybal

Set EarthModel=Carson

New "WireData.conductor" RUnits=mi RAC=0.306 GMRUnits=ft GMRAC=0.0244 RadUnits=in Diam=0.721 NormAmps=530
New "WireData.neutral" RUnits=mi RAC=0.592 GMRUnits=ft GMRAC=0.00814 RadUnits=in Diam=0.563 NormAmps=340
New "LineGeometry.4wire"
~ NConds=4
~ NPhases=3
~ Reduce=Yes
~ Cond=1 wire=conductor X=-4 h=28 units=ft
~ Cond=2 wire=conductor X=-1.5 h=28 units=ft
~ Cond=3 wire=conductor X=3 h=28 units=ft
~ Cond=4 wire=neutral X=0 h=24 units=ft

Edit "Vsource.source" Bus1=sourcebus BasekV=12.47 Phases=3 MVASC3=200000 MVASC1=200000
New "Line.line1" Geometry=4wire Ratings=[ 0] NormAmps=530 EmergAmps=795 Length=2000 Units=ft Bus1=sourcebus Bus2=n2
New "Transformer.t1" XHL=6 Buses=[n2, n3, ] Conns=[delta, wye, ] kVs=[12.470000000000001, 4.1600000000000001, ] kVAs=[6000, 6000, ] Taps=[1, 1, ] %Rs=[0.5, 0.5, ] Wdg=1 Wdg=2
New "Line.line2" Bus1=n3 Bus2=n4 Geometry=4wire Ratings=[ 0] NormAmps=530 EmergAmps=795 Length=2500 Units=ft
New "Load.load1" Phases=3 Bus1=n4 Conn=wye kV=4.16 kW=5400 PF=0.98328200498446 Model=1 VMinpu=0.75 kvar=1000
MakeBusList
Set VoltageBases=(12.470000000000001, 4.1600000000000001, )
! CalcVoltageBases

With property tracking (default)#

With property tracking, PF is supressed from the load, since the load definition switches from (kW, PF) to (kW, kvar).

Property tracking is an added functionaly on DSS-Extensions, the default OpenDSS does not implement this.

odd.Basic.CompatFlags(0)
odd(IEEE4_DSS)
odd('load.load1.kvar=1000')
print(odd.Circuit.Save('', DSSSaveFlags.SingleFile|DSSSaveFlags.ToString|DSSSaveFlags.ExcludeDefault|DSSSaveFlags.KeepOrder))
! Last saved by AltDSS/DSS C-API Library version 0.14.1 revision 8b3da5b576f4dedd16d2bfb88bfb911c0aca3783 based on OpenDSS SVN 3723 [FPC 3.2.2] (64-bit build) MVMULT INCREMENTAL_Y CONTEXT_API PM 20240217013457 on 2024-02-25T18:46:21.578Z
Clear
Set DefaultBaseFreq=60
New Circuit.4busdybal

Set EarthModel=Carson

New "WireData.conductor" RUnits=mi RAC=0.306 GMRUnits=ft GMRAC=0.0244 RadUnits=in Diam=0.721 NormAmps=530
New "WireData.neutral" RUnits=mi RAC=0.592 GMRUnits=ft GMRAC=0.00814 RadUnits=in Diam=0.563 NormAmps=340
New "LineGeometry.4wire"
~ NConds=4
~ NPhases=3
~ Reduce=Yes
~ Cond=1 wire=conductor X=-4 h=28 units=ft
~ Cond=2 wire=conductor X=-1.5 h=28 units=ft
~ Cond=3 wire=conductor X=3 h=28 units=ft
~ Cond=4 wire=neutral X=0 h=24 units=ft

Edit "Vsource.source" Bus1=sourcebus BasekV=12.47 Phases=3 MVASC3=200000 MVASC1=200000
New "Line.line1" Geometry=4wire Ratings=[ 0] NormAmps=530 EmergAmps=795 Length=2000 Units=ft Bus1=sourcebus Bus2=n2
New "Transformer.t1" XHL=6 Buses=[n2, n3, ] Conns=[delta, wye, ] kVs=[12.470000000000001, 4.1600000000000001, ] kVAs=[6000, 6000, ] Taps=[1, 1, ] %Rs=[0.5, 0.5, ] Wdg=1 Wdg=2
New "Line.line2" Bus1=n3 Bus2=n4 Geometry=4wire Ratings=[ 0] NormAmps=530 EmergAmps=795 Length=2500 Units=ft
New "Load.load1" Phases=3 Bus1=n4 Conn=wye kV=4.16 kW=5400 Model=1 VMinpu=0.75 kvar=1000
MakeBusList
Set VoltageBases=(12.470000000000001, 4.1600000000000001, )
! CalcVoltageBases

Is JSON a better alternative?#

If the exported circuit will be used for other software, the engine in DSS-Extensions include work-in-progress implementation of JSON export and import functions. The repository for general discussions on this is at dss-extensions/AltDSS-Schema and the docs are also being updated.

For short, there are some small changes to match JSON expectations (this is encoded in the JSON Schema), some DSS properties (like winding and conductor iterators) are suppressed, etc.

Currently, some options and commands are included in the PreCommands and PostCommands lists. They will be formalized as JSON objects later.

import json
json_data = json.loads(odd.Circuit.ToJSON())
json_data
{'$schema': 'https://dss-extensions.org/altdss-schema/2023-12-13.schema.json',
 'Name': '4busdybal',
 'DefaultBaseFreq': 60.0,
 'PreCommands': ['! Last saved by AltDSS/DSS C-API Library version 0.14.1 revision 8b3da5b576f4dedd16d2bfb88bfb911c0aca3783 based on OpenDSS SVN 3723 [FPC 3.2.2] (64-bit build) MVMULT INCREMENTAL_Y CONTEXT_API PM 20240217013457 on 2024-02-25T18:46:21.581Z',
  'Set EarthModel=Carson',
  'Set VoltageBases=[ 12.470000000000001 4.1600000000000001]'],
 'Bus': [],
 'PostCommands': ['Set ControlMode=Static',
  'Set Random=Gaussian',
  'Set frequency=60',
  'Set stepsize=0.001',
  'Set number=100',
  'Set tolerance=0.0001',
  'Set maxiterations=15',
  'Set miniterations=2',
  'Set loadmodel=PowerFlow',
  'Set loadmult=1',
  'Set Normvminpu=0.94999999999999996',
  'Set Normvmaxpu=1.05',
  'Set Emergvminpu=0.90000000000000002',
  'Set Emergvmaxpu=1.0800000000000001',
  'Set %mean=82.58',
  'Set %stddev=15.31',
  'Set LDCurve=',
  'Set %growth=2.5',
  'Set genkw=1000',
  'Set genpf=1',
  'Set capkvar=600',
  'Set addtype=Generator',
  'Set zonelock=No',
  'Set ueweight=    1.00',
  'Set lossweight=    1.00',
  'Set ueregs=[10]',
  'Set lossregs=[13]',
  'Set algorithm=Normal',
  'Set Trapezoidal=No',
  'Set genmult=1',
  'Set Basefrequency=60',
  'Set harmonics=ALL',
  'Set maxcontroliter=10'],
 'WireData': [{'Name': 'conductor',
   'RUnits': 'mi',
   'RAC': 0.306,
   'GMRUnits': 'ft',
   'GMRAC': 0.0244,
   'RadUnits': 'in',
   'Radius': 0.3605,
   'NormAmps': 530.0},
  {'Name': 'neutral',
   'RUnits': 'mi',
   'RAC': 0.592,
   'GMRUnits': 'ft',
   'GMRAC': 0.00814,
   'RadUnits': 'in',
   'Radius': 0.2815,
   'NormAmps': 340.0}],
 'LineGeometry': [{'Name': '4wire',
   'NConds': 4,
   'NPhases': 3,
   'Reduce': True,
   'Conductors': ['WireData.conductor',
    'WireData.conductor',
    'WireData.conductor',
    'WireData.neutral'],
   'Units': ['ft', 'ft', 'ft', 'ft'],
   'X': [-4.0, -1.5, 3.0, 0.0],
   'H': [28.0, 28.0, 28.0, 24.0]}],
 'Line': [{'Name': 'line1',
   'Geometry': '4wire',
   'Ratings': [0.0],
   'NormAmps': 530.0,
   'EmergAmps': 795.0,
   'Length': 2000.0,
   'Units': 'ft',
   'Bus1': 'sourcebus',
   'Bus2': 'n2'},
  {'Name': 'line2',
   'Bus1': 'n3',
   'Bus2': 'n4',
   'Geometry': '4wire',
   'Ratings': [0.0],
   'NormAmps': 530.0,
   'EmergAmps': 795.0,
   'Length': 2500.0,
   'Units': 'ft'}],
 'Vsource': [{'Name': 'source',
   'Bus1': 'sourcebus',
   'BasekV': 12.47,
   'Phases': 3,
   'MVASC3': 200000.0,
   'MVASC1': 200000.0}],
 'Load': [{'Name': 'load1',
   'Phases': 3,
   'Bus1': 'n4',
   'Conn': 'wye',
   'kV': 4.16,
   'kW': 5400.0,
   'Model': 1,
   'VMinpu': 0.75,
   'kvar': 1000.0}],
 'Transformer': [{'Name': 't1',
   'X12': 6.0,
   'Bus': ['n2', 'n3'],
   'Conn': ['delta', 'wye'],
   'kV': [12.47, 4.16],
   'kVA': [6000.0, 6000.0],
   'pctR': [0.5, 0.5]}]}
# If you are running on Jupyter, better display
from IPython.display import JSON
display(JSON(json_data))
<IPython.core.display.JSON object>