The goal of this lesson is to familiarize you with how manage time in a GridLAB-D simulation. The specific learning objectives are the following
- How to specify the timezone.
- How to specify the start time.
- How to specify the stop time.
To manage time in a simulation, you must use the clock
directive. This directive allows three parameters settings:
timezone
: this is used to specify which timezone and daylight saving's time rules are in effect.starttime
: this is used to specify the date and time at which the simulation starts.stoptime
: this is used to specify the date and time at which the simulation stop.
The clock is only active when there is an upcoming change in the state of one or more objects in the model. For example, adding weather will always result in changes every hour. As a result the simuation will run forever unless a stop time is specified. The simulation will always stop at the stop time or if there is not pending state change in an object.
The following tasks are illustrated in main.glm
:
- Set the clock to run from January 1, 2020 midnight PST to January 1, 2021 midnight PST (see `main.glm@7').
- Set
timezone
toPST+8PDT
(seemain.glm@9
). - Set
starttime
to2020-01-01 00:00:00 PST
(seemain.glm@10
). - Set
stoptime
to2021-01-01 00:00:00 PST
(seemain.glm@11
).
- Set
- Get and load weather data for Los Angeles (see
main.glm@14
)
- Change the location to Phoenix, Arizona. (Hint: there is no daylight savings time in Arizona.)