1.1 Buckley, release April 2008, includes java module link and additional objects in existing modules.
make install. This will install GridLAB-D in the /usr/local folder and make it available for use by all users.gridlabd.exe options filename ...
options are listed is the Command-line Arguments. A list of parameters can also be displayed by using the –-help command-line parameter.
The filename parameter is the name of one or more model definition input files to load. By convention, model definition input files are given the extension .glm (see Model Definition).
.glm. There are three main declaration blocks that may be defined in a model definition file:clock module object
Of these, only module and object declarations are required. Additionally a class block may be provided to enforce modeling consistency.
Comments within the model file are introduced using a hash (#) character. All text between a hash mark and the end of a line is ignored.
A number of sample model definition files are included with the GridLAB-D distribution.
clock {
tick double;
timestamp [int64[s|m|h|d] | 'timestamp'];
timezone std[+|-]hh[:mm[:ss]][dst];
}
tick - The tick property specifies the time resolution of the simulation engine in seconds. The clock tick is set to 1 second by default. It may be any value for which the log10 is a negative integer between 0 and 9, e.g., 1, 1e-1, 1e-2, ..., 1e-9. A value of 1 second is recommended for early releases of GridLAB-D.timestamp - The timestamp property specifies the start of the simulation. This number is specified in one of two formats:int64 and int64s assume seconds, int64m assumes minutes, int64h assumes hours, and int64d assumes days.timestamp, e.g., 'yyyy-mm-dd hh:mm:ss'. This form must be enclosed in single quotes (apostrophes).timezone - The timezone property is used to specify which timezone rules are in effect and whether daylight saving time rules are to be applied. The syntax of the timezone variable must be Posix compliant, as follows: std[+|-]hh[:mm[:ss]][dst]
tzinfo.txt file. The currently defined timezones are: ; $Id: tzinfo.txt,v 1.4 2007/11/08 01:20:50 d3g637 Exp $ ; Copyright (C) Battelle Memorial Institute, 2007 ; This file is distributed under the same terms as GridLAB-D ; ; Entries in this file follow the Posix standard for TZ ; The years specify which TZ rules go into effect that year ; ; IMPORTANT NOTE: year sections must be in chronological order ; EST5 ; Eastern no DST CST6 ; Central no DST MST7 ; Mountain no DST PST8 ; Pacific no DST [1970] ; Rules as of 1967 EST+5EDT,M4.5.0/02:00,M10.5.0/02:00 ; Eastern, DST last Sun/Apr to last Sun/Oct CST+6CDT,M4.5.0/02:00,M10.5.0/02:00 ; Central, DST last Sun/Apr to last Sun/Oct MST+7MDT,M4.5.0/02:00,M10.5.0/02:00 ; Mountain, DST last Sun/Apr to last Sun/Oct PST+8PDT,M4.5.0/02:00,M10.5.0/02:00 ; Pacific, DST last Sun/Apr to last Sun/Oct [1986] ; Rules as of 1986 EST+5EDT,M4.1.0/02:00,M10.5.0/02:00 ; Eastern, DST first Sun/Apr to last Sun/Oct CST+6CDT,M4.1.0/02:00,M10.5.0/02:00 ; Central, DST first Sun/Apr to last Sun/Oct MST+7MDT,M4.1.0/02:00,M10.5.0/02:00 ; Mountain, DST first Sun/Apr to last Sun/Oct PST+8PDT,M4.1.0/02:00,M10.5.0/02:00 ; Pacific, DST first Sun/Apr to last Sun/Oct [2007] ; Rules as of 2007 EST+5EDT,M3.2.0/02:00,M11.1.0/02:00 ; Eastern, DST second Sun/Mar to first Sun/Nov CST+6CDT,M3.2.0/02:00,M11.1.0/02:00 ; Central, DST second Sun/Mar to first Sun/Nov MST+7MDT,M3.2.0/02:00,M11.1.0/02:00 ; Mountain, DST second Sun/Mar to first Sun/Nov PST+8PDT,M3.2.0/02:00,M11.1.0/02:00 ; Pacific, DST second Sun/Mar to first Sun/Nov
If unspecified, the clock is initialized to zero, which starts the clock on Jan 1, 1970 GMT.
Multiple clock blocks may be specified. The effect of each clock is to set the initial clock value of any object subsequently defined to the timestamp given. This can be used to create an initially unsynchronized model and should be used with great caution.
Additional modules may be added. The module names correspond to .dll names (Windows) or .so (Linux) that are distributed with GridLAB-D.
A module declaration typically looks like this:
module module_name {
property value;
}
Where property is a variable supported by that module and value is the value to which the property should be initialized at the start of the simulation. Property values must be one of the defined formats outlined in Section 4.4, Properties.
Modules can be declared without initializing any properties by omitting the bracketed section above and adding a semi-colon after the module name. The following example shows what a modules section might look like:
# modules
module gauss_method {
acceleration_factor 1.4;
convergence_limit 0.001;
}
module tape;
module climate;
module commercial;
object <class>:<int> {
[root | parent [<class>:<int> | <object.name>];
clock [<int64>[s|m|h|d] | '<timestamp>'];
latitute <latitude>;
longitude <longitude>;
in '<timestamp>';
out '<timestamp>';
name <string>;
...
}
<class>:<int> refers to an object by specifying a class supported by one of the modules included in the modules section of the module definition file. The <int> id is a positive 32-bit integer that must be unique for the entire model, but not necessarily sequential. The object id can be specified as a range, such as 12..18 to construct multiple objects in a series. If the first number is left out, then the second number is used as a count of how many objects are created. For example, an id of ..19 will construct 19 separate objects.
Properties for different objects are described in subsequent sections. However, some properties are attributes of all objects. These attribute properties include:
The parent property can be specified as <class>:*, which has the effect of using the first as-yet childless object with that name. This is typically used in conjunction with multiple object ids (see above). For example, the following declaration will create one node object, 10 office objects, and 10 recorder objects. The office objects will all have the same parent (node:1) but the recorder objects will each have a different parent (office:1 through office:10). Once the office objects are assigned as parents to the recorder objects, the office:* nomenclature cannot be used to assign those same office objects as parents to other objects (i.e. they are no longer unreferenced).
object node:1 {
type 3;
name "Feeder";
}
object office:1..10 {
parent Feeder;
}
object recorder:..10 {
parent office:*;
}
latitude / longitude - The latitude and longitude are optional properties used to enable GIS systems to map the objects on a map. In the absence of a specification for these properties, no mapping of the object will be supported.in_svc / out_svc - The in_svc and out_svc properties define the dates and times at which object go into and come out of service. Objects will only be synchronized between these two dates. Omitting the in_svc property will cause the object to be synchronized starting with the initial simulation clock. Omitting the out_svc property will cause the object to be synchronized until the end of the simulation.name - The name provides a canonical name that can be used to refer to the object without using the <class>:<id> specification. This is particularly important when linking multiple models together from diverse files. However, a name must be unique over the entire simulation.Additional properties that are supported by each object can be set. For the specific properties that are supported by an object, see Section ___ or consult the documentation for that module.
int16 - a 16-bit integerint32 - a 32-bit integerint64 - a 64-bit integer
char8 - a string with at most 8 characterschar32 - a string with at most 32 characterschar256 - a string with at most 256 characterschar1024 - a string with at most 1024 characters
double precision floating point numbers. They can be specified as a decimal number containing a decimal point, optionally preceded by a + or - sign and optionally followed by the e or E character and a decimal number. Floating point values may be provided with units, provided the units given are compatible with the units specified for the property. The following describe 71,200 square feet: 71200.0 ft^2 7.12e4 sf 6740.8 m^2
complex numbers take the form of two decimal numbers with a + or - sign between them and followed by the imaginary flag desired, either i, j, or d, to indicate rectangular or polar coordinates, as appropriate. Valid examples include: 12.3+4.56j 12.3-4.56i 12.3+4.56d
kW, kVA, and kVAR is lost when units are converted. This is a shortcoming that will be remedied in the near future, so we recommend care be taken in specifying units correctly, e.g., kW for the real component of power, kVA for the magnitude of power, and kVAR for the imaginary component of power.
'yyyy-mm-dd hh:mm:ss tz'. They must be enclosed in single quotes (apostrophes). A valid example is: '2007-01-15 00:00:00 PST'
s for seconds, m for minutes, h for hours or d for days, as figured from 1/1/1970 0:00:00 GMT.
enumeration and set values are stored as integers corresponding to keyword values defined by a given module. Using numbers requires prior knowledge of how the module implements the property and what values the property supports and is highly discouraged. An enumeration stored alternate values (only one can be stored at a time), whereas a set stores concurrent values (several can be stored at a time). Keywords sets may be combined using the | operator. However, if all the keywords are single characters, the | may be omitted.When an enumeration or set is defined, the module that defines it must specify what the keywords are and what internal numbers they correspond to.
An illustrative example of an enumeration is:
typedef enum {ITEM0=0, ITEM1=1, ITEM2=2} ITEMS; enumeration item; gl_publish(oclass, PT_enumeration, "item", PADDR(item), PT_KEYWORD,"ITEM0", ITEM0, PT_KEYWORD,"ITEM1", ITEM1, PT_KEYWORD,"ITEM2", ITEM2, NULL);
An example of a set is:
#define NO_OPTIONS 0x00 #define OPTION_1 0x01 #define OPTION_2 0x02 #define OPTION_3 0x04 #define ALL_OPTIONS 0x07 set options; gl_publish(oclass, PT_enumeration, "options", PADDR(options), // keywords should be published in order of decreasing complexity PT_KEYWORD,"ALL_OPTIONS", ALL_OPTIONS, PT_KEYWORD,"OPTION_1", OPTION_1, PT_KEYWORD,"OPTION_2", OPTION_2, PT_KEYWORD,"OPTION_3", OPTION_3, PT_KEYWORD,"NO_OPTIONS", NO_OPTIONS, NULL);
object is used to refer to another object. The name given must be either specified as <class>:<int> or the object's canonical name.
functional values may be used for floating point properties only, and not for integer or complex numbers. The only functionals defined at this time are the random number functions, which supports a variety of probability distributions, includingrandom.uniform(a,b) - returns a uniformly distributed random number between a and b.random.normal(m,s) - returns a normally distributed random number with mean m and standard deviation s.random.lognormal(m,s) - returns a number whose log is normally distributed about the geometric mean m and geometric standard deviation s. For example, to generate a normally distributed value with a mean of 10 and a standard deviation of 3, the functional random.normal(10,3) would be used. This is particularly useful in conjunction with ranged ids, in which case the ids will be guaranteed to be unique.See the section on Random numbers for more information.
powerflow module. The powerflow module is the basic unbalanced 3-phase flow modeling and simulation module for GridLAB-D. It defines two generic objects, the link and the node objects. Together these two object types are necessary to create power flow networks. It also supports the following more specific objects types used in power systems. Among the node objects are:capacitor - defines a capacitormeter - defines a load meter (both single and poly-phase) Among the link objects are:_switch - defines a manual switch componentrelay - defines an automated relay componentfuse - defines a fuse componenttransformer -A network can only be defined using only objects derived from link and node objects. A network can be defined using the abstract link and node objects. However, such a network could not exhibit any of the particular behaviors that are intrinsic to the more specific object types.
Be aware that some object properties are defined per-unit, which means that they are in relation to a reference value for the entire network, or for the part of the network to which they belong. All MVA values are in relation to the network mvabase property. Voltages are in relation to the root node's voltage, which varies over time. When voltage regulars or transformers intercede between the node and the root node, then their voltage becomes the voltage base.