Skip to content

Commit f1044d7

Browse files
author
David P. Chassin
authored
Initial version (#1)
* Initial model and data * Create main.yml * Update README.md * Update README.md
1 parent 1ad0537 commit f1044d7

File tree

4 files changed

+115
-2
lines changed

4 files changed

+115
-2
lines changed

.github/workflows/main.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Simulation
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
container: lfenergy/arras:develop
13+
14+
steps:
15+
- uses: actions/checkout@v3
16+
17+
- name: Cache IEEE 123 model
18+
id: ieee-123-model
19+
uses: actions/cache@v3
20+
with:
21+
path: 123.glm
22+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('123.glm') }}
23+
restore-keys: |
24+
${{ runner.os }}-build-${{ env.cache-name }}-
25+
${{ runner.os }}-build-
26+
${{ runner.os }}-
27+
28+
- name: Run simulation
29+
run: gridlabd main.glm
30+
31+
- name: Save voltage plot
32+
uses: actions/upload-artifact@v3
33+
with:
34+
name: Load 114 voltage
35+
path: voltage_114.png
36+
37+
- name: Save voltage profile
38+
uses: actions/upload-artifact@v3
39+
with:
40+
name: IEEE 123 voltage profile
41+
path: IEEE-123-voltage-profile.png
42+

README.md

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
1-
# Lesson 9 - Importing data
1+
[![Simulation](../../actions/workflows/main.yml/badge.svg)](../../actions/workflows/main.yml)
22

3-
Coming soon...
3+
# Lesson 9 - Importing Data
4+
5+
The goal of this lesson is to introduce the most direct way of importing data into the simulation while it is running. The specific learning objectives are the following.
6+
7+
1. Learn how to use the `player` object.
8+
2. Learn how to loop input data.
9+
10+
The [`player`](https://docs.gridlabd.us/index.html?owner=arras-energy&project=gridlabd&branch=master&folder=/Module/Tape&doc=/Module/Tape/Player.md) read values from a CSV files and updates object based on the timestamp associated with the values. There are two formats for timestamps.
11+
12+
- `YYYY-MM-DD HH:MM:SS [ZZZ]`, which is used to specify absolute time.
13+
14+
- +[DIGITS][UNIT], which is used to specify relative time. When this format is used the first timetamp must be absolute. If the `loop` option is used, the player data will be repeated the specified number of times.
15+
16+
## Tasks
17+
18+
1. Play a load into load 114 (see [`main.glm@11`](main.glm#L12-L18))
19+
2. Record the voltage at load 114 (see [`main.glm@20`](main.glm#L21-L27))
20+
3. Setup the clock (see [`main.glm@29`](main.glm#L30-L35))
21+
4. Generate the voltage plot (see [`main.glm@37`](main.glm#L38))
22+
23+
# Exercices
24+
25+
1. Place meters on all the loads added by tasks 1-5.
26+
27+
# More Information
28+
29+
* [Tape module](https://docs.gridlabd.us/index.html?owner=arras-energy&project=gridlabd&branch=master&folder=/Module&doc=/Module/Tape.md)
30+
* [Player object](https://docs.gridlabd.us/index.html?owner=arras-energy&project=gridlabd&branch=master&folder=/Module/Tape&doc=/Module/Tape/Player.md)

load_114.csv

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2020-07-01 00:00:00,2000.000000+1000.000000j
2+
+6h,20000.000000+10000.000000j
3+
+12h,10000.000000+5000.000000j
4+
+6h,2000.000000+1000.000000j

main.glm

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#ifmissing "123.glm"
2+
#model get IEEE/123
3+
#endif
4+
#include "123.glm"
5+
6+
module tape
7+
{
8+
csv_header_type NAME;
9+
}
10+
11+
// Task 1 - Play a load into load 114
12+
object player
13+
{
14+
parent load_114;
15+
file "load_114.csv";
16+
property "constant_power_A";
17+
loop 7;
18+
}
19+
20+
// Task 2 - Record the voltage at load 114
21+
object recorder
22+
{
23+
parent load_114;
24+
file "voltage_114.csv";
25+
property "voltage_A.real";
26+
interval 1h;
27+
}
28+
29+
// Task 3 - Setup the clock
30+
clock
31+
{
32+
timezone "PST+8PDT";
33+
starttime "2020-07-01 00:00:00 PDT";
34+
stoptime "2020-07-08 00:00:00 PDT";
35+
}
36+
37+
// Task 4 - Generate the voltage plot
38+
#on_exit 0 gridlabd plot -i=voltage_114.csv -o=voltage_114.png --plot:grid
39+
40+
#output "IEEE-123-voltage-profile.png" -t profile -l 10

0 commit comments

Comments
 (0)