Skip to content

Commit 8942f2e

Browse files
authored
Update documentation with bazel build (#8)
1 parent f3c4a76 commit 8942f2e

File tree

2 files changed

+42
-25
lines changed

2 files changed

+42
-25
lines changed

doc/Installation.md

+20-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ This gensas repository uses [Bazel](https://bazel.build/) as the build tool. The
55

66
There are also [other ways to install Bazel](https://bazel.build/start).
77

8-
[//]: # (TODO - rygx: build on other OS (Windows and MacOS) to be verified as a part of https://github.com/ANL-CEEESA/gensas/issues/2)
98
### Build Gensas
109
At the root of the repository, execute command:
1110
```shell
@@ -44,5 +43,23 @@ Json file /tmp/solution.json written.
4443
```
4544

4645
### Run a power flow
47-
[//]: # (TODO - https://github.com/ANL-CEEESA/gensas/issues/4: fix HDF5 runtime issue)
48-
This is still working in progress (WIP).
46+
47+
Power flow can be run using the `-p` mode. There are sample input data representing some test models, with sizes ranging from 14 buses to 210,000 buses.
48+
49+
An example for running the synthetic 210,000-bus system:
50+
``` shell
51+
bazel run //app:app -- -p -f $(pwd)/resources/psat_mat/d_210k.mat -l 25 -s 0.2
52+
```
53+
54+
You should see output like
55+
```
56+
compMode=-p
57+
Step=0.19375, added=0.19375, (maxDiff<1e-06).
58+
Step=0.39375, added=0.2, (maxDiff<1e-06).
59+
Step=0.553125, added=0.159375, (maxDiff<1e-06).
60+
Step=0.740625, added=0.1875, (maxDiff<1e-06).
61+
Step=0.9, added=0.159375, (maxDiff<1e-06).
62+
Step=1, added=0.1, (maxDiff<1e-06).
63+
Computation No.1
64+
Computation time: 89.9048 s.
65+
```

doc/Usage.md

+22-22
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
Current version only provides AC power flow. Assume the executable is gensas.out, then the power flow computation can be called as follows.
55

66
```bash
7-
gensas.out -p
8-
-f/--file <input-file-name>
9-
-o/--output <output-file-name>
10-
[-l/--level <sas-order>]
11-
[-s/--segment <segment-length>]
12-
[-a/--alphatol <alpha-tolerance>]
7+
bazel run //app:app -- -p \
8+
-f/--file <input-file-name> \
9+
-o/--output <output-file-name> \
10+
[-l/--level <sas-order>] \
11+
[-s/--segment <segment-length>] \
12+
[-a/--alphatol <alpha-tolerance>] \
1313
[-d/--difftol <error-tolerance>]
1414
```
1515

@@ -23,25 +23,25 @@ Explanations:
2323
* `-d/--difftol <error-tolerance>` (optional) specifies the error tolerance of the equations. If not specified, the error tolerance is set as 1e-6.
2424

2525
Example:
26-
Try running power flow of the modified synthetic eastern-interconnection (EI) 70,000-bus system:
26+
Try running power flow of the modified synthetic eastern-interconnection (EI) 70,000-bus system in the project root directory:
2727
```bash
28-
./gensas.out -p -f resources/psat_mat/d_70k_070.mat -s 0.5 -l 28 -d 1e-5 -o res.mat
28+
bazel run //app:app -- -p -f $(pwd)/resources/psat_mat/d_70k_070.mat -s 0.5 -l 28 -d 1e-5 -o res.mat
2929
```
3030

3131
### ModelicaSAS
3232
Currently, ModelicaSAS supports simulation of a single Modelica .mo model without discrete events. The simulation can be called as follows:
3333

3434
```bash
35-
gensas.out -g
36-
-m/--mode file/string
37-
-i/--input <input>
38-
-o/--output <output-file-name>
39-
[-j/--json <json-output-file-name>]
40-
[-l/--level <sas-order>]
41-
[-s/--segment <segment-length>]
42-
[-a/--aTol <alpha-tolerance>]
43-
[-e/--eTol <error-tolerance>]
44-
[-t/--outStep <output-step>]
35+
bazel run //app:app -- -g \
36+
-m/--mode file/string \
37+
-i/--input <input> \
38+
-o/--output <output-file-name> \
39+
[-j/--json <json-output-file-name>] \
40+
[-l/--level <sas-order>] \
41+
[-s/--segment <segment-length>] \
42+
[-a/--aTol <alpha-tolerance>] \
43+
[-e/--eTol <error-tolerance>] \
44+
[-t/--outStep <output-step>] \
4545
[-v/--verbose]
4646
```
4747

@@ -60,11 +60,11 @@ Explanations:
6060
* `-v/--verbose` (optional) if used, will print intermediate result in SAS computation.
6161

6262
Example:
63-
Try running simulation of the model in `resources/mofile/test_solve_ode.mo`.
63+
Try running simulation of the model in `resources/mofile/test_solve_ode.mo` in the project root directory.
6464

6565
```bash
66-
./gensas.out -g
67-
-m file -i resources/mofile/test_solve_ode.mo
68-
-o resources/mofile/test_solve_ode.mat
66+
bazel run //app:app -- -g \
67+
-m file -i $(pwd)/resources/mofile/test_solve_ode.mo \
68+
-o resources/mofile/test_solve_ode.mat \
6969
-t 15
7070
```

0 commit comments

Comments
 (0)