Opendss Loadshape Usage (Version 7.3.3) May 15, 2010: New Ways To Enter Array Data
Opendss Loadshape Usage (Version 7.3.3) May 15, 2010: New Ways To Enter Array Data
Opendss Loadshape Usage (Version 7.3.3) May 15, 2010: New Ways To Enter Array Data
(Version 7.3.3)
May 15, 2010
This syntax will work on just about any property of any class of element in the OpenDSS
where an array of numbers is expected.
The addition of the capability to handle the two packed binary file types should
significantly speed up the importing of AMI data into Loadshape objects. Also, the way
the Mean and Std Deviation calculation is done has been changed to delay calculation
until these values are actually needed. This should minimize the computing overhead on
reading loadshapes back in.
You can create the .DBL and .SNG files with any language that can create packed binary
files. If you are working in VBA, look at Put & Get. For an example, look for the
WriteToSingleFile macro in the SampleDSSDriver.xls file on the SourceForge website.
However, I also added options to the Action property in the Loadshape Object to allow
you to use OpenDSS to create the dbl and sng files. (see the next section)
To go along with changes allowing LoadShapes to be read from files of Singles and files
of Doubles, the CvrtLoadshapes command has been added to write all presently-loaded
LoadShape elements to either SNG or DBL files (see description of the command
below). And the command will also produce a script for reading them back in. So you can
load the LoadShapes once from text scripts or files and save them.
Note: this won't save you anything if you are changing the LoadShape objects every time
you run. You would be better off creating them initially using either SNG or DBL files.
In Matlab, use the fwrite statement with the precision for the array:
fwrite(obj,A,'precision')
1
In Excel VBA, for example:
Dim sngTemp as Single
Dim X8760(1 to 8760) as Double ‘ Array of multipliers
… (do stuff)
Open MyFileName.sng For Binary Access Write As #1
For i = 1 To 8760
sngTemp = X8760(i) ' convert double to single
Put #1, , sngTemp ' put it to the binary file
Next i
Close #
In the Result window, you will get an example script you can use for importing this data
in its new format.
Thus, you can read in your loadshapes one time from text files and save them to a file of
singles, for example. (Singles are usually sufficient for LoadShape objects). Then
subsequent simulations should go faster. (be sure to edit your scripts after the first time).
This should be a big help if loading 8760's for every Load.
2
cvrtloadshapes type=sng (this is the default)
cvrtloadshapes type=dbl
A separate file is created for each P and each Q loadshape. The naming should be
obvious. The command also creates a script file named ReloadLoadshapes.DSS for
reading the loadshapes back in.
This can create a lot of files. Be sure the present folder is really where you want the files.
Of course, you can always move the files later and change the reload script accordingly.
3
--- Handling AMI Data ---
Modifications have been made to the Load, Generator, and Loadshape objects to better
facilitate the handling of AMI data that is assumed to be in units of kW and kvar. For
example, the Load object will automatically pick up the maximum kW value and set the
kW property so that the Snapshot power flow solution will represent a non-coincident
peak load case. The UseActual property of the LoadShape object is key to this.
4
Then if all your curve data arrays are synchronized, you should be able perform a
snapshot solution and proceed with yearly simulations, for example.