Skip to content

Commit

Permalink
Update documentation with bazel build (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
rygx authored Jan 25, 2024
1 parent f3c4a76 commit 8942f2e
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 25 deletions.
23 changes: 20 additions & 3 deletions doc/Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ This gensas repository uses [Bazel](https://bazel.build/) as the build tool. The

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

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

### Run a power flow
[//]: # (TODO - https://github.com/ANL-CEEESA/gensas/issues/4: fix HDF5 runtime issue)
This is still working in progress (WIP).

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.

An example for running the synthetic 210,000-bus system:
``` shell
bazel run //app:app -- -p -f $(pwd)/resources/psat_mat/d_210k.mat -l 25 -s 0.2
```

You should see output like
```
compMode=-p
Step=0.19375, added=0.19375, (maxDiff<1e-06).
Step=0.39375, added=0.2, (maxDiff<1e-06).
Step=0.553125, added=0.159375, (maxDiff<1e-06).
Step=0.740625, added=0.1875, (maxDiff<1e-06).
Step=0.9, added=0.159375, (maxDiff<1e-06).
Step=1, added=0.1, (maxDiff<1e-06).
Computation No.1
Computation time: 89.9048 s.
```
44 changes: 22 additions & 22 deletions doc/Usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
Current version only provides AC power flow. Assume the executable is gensas.out, then the power flow computation can be called as follows.

```bash
gensas.out -p
-f/--file <input-file-name>
-o/--output <output-file-name>
[-l/--level <sas-order>]
[-s/--segment <segment-length>]
[-a/--alphatol <alpha-tolerance>]
bazel run //app:app -- -p \
-f/--file <input-file-name> \
-o/--output <output-file-name> \
[-l/--level <sas-order>] \
[-s/--segment <segment-length>] \
[-a/--alphatol <alpha-tolerance>] \
[-d/--difftol <error-tolerance>]
```

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

Example:
Try running power flow of the modified synthetic eastern-interconnection (EI) 70,000-bus system:
Try running power flow of the modified synthetic eastern-interconnection (EI) 70,000-bus system in the project root directory:
```bash
./gensas.out -p -f resources/psat_mat/d_70k_070.mat -s 0.5 -l 28 -d 1e-5 -o res.mat
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
```

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

```bash
gensas.out -g
-m/--mode file/string
-i/--input <input>
-o/--output <output-file-name>
[-j/--json <json-output-file-name>]
[-l/--level <sas-order>]
[-s/--segment <segment-length>]
[-a/--aTol <alpha-tolerance>]
[-e/--eTol <error-tolerance>]
[-t/--outStep <output-step>]
bazel run //app:app -- -g \
-m/--mode file/string \
-i/--input <input> \
-o/--output <output-file-name> \
[-j/--json <json-output-file-name>] \
[-l/--level <sas-order>] \
[-s/--segment <segment-length>] \
[-a/--aTol <alpha-tolerance>] \
[-e/--eTol <error-tolerance>] \
[-t/--outStep <output-step>] \
[-v/--verbose]
```

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

Example:
Try running simulation of the model in `resources/mofile/test_solve_ode.mo`.
Try running simulation of the model in `resources/mofile/test_solve_ode.mo` in the project root directory.

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

0 comments on commit 8942f2e

Please sign in to comment.