Skip to content

Commit 5d87e73

Browse files
Feng QiuFeng Qiu
Feng Qiu
authored and
Feng Qiu
committed
Initial commit for GenSAS
0 parents  commit 5d87e73

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+11706
-0
lines changed

LICENSE.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright © 2022, UChicago Argonne, LLC
2+
All Rights Reserved
3+
Software Name: GenSAS
4+
By: Argonne National Laboratory
5+
6+
OPEN SOURCE LICENSE
7+
8+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
9+
10+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
11+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
12+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
13+
14+
15+
******************************************************************************************************
16+
DISCLAIMER
17+
18+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
19+
***************************************************************************************************

README.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# GenSAS
2+
3+
**GenSAS** is a C++ based generalized simulation tool based on semi-analytical solutions (SAS) technology. It provides two modules:
4+
5+
1. **ModelicaSAS** is a SAS-based simulation tool that supports Modelica modeling language. Currently it supports simulation of single Modelica model.
6+
7+
2. **PowerSAS** is a robust, efficient and scalable power grid analysis framework based on semi-analytical solutions (SAS) technology. This is the version for C++ users. It currently provides AC power flow functionality.
8+
9+
Backed by the SAS approach, the GenSAS tool provides much better convergence than the tools using traditional Newton-type equation solvers. Moreover, due to the analytical nature, GenSAS provides model-adaptive high-accuracy approximation, which brings significantly extended effective range for power grid analysis. PowerSAS has been used to solve large-scale system cases with 200,000+ buses.
10+
11+
### Companion Project
12+
PowerSAS.m -- SAS-based power grid analysis toolbox for Matlab/GNU Octave users.
13+
14+
### Acknowledgement
15+
This work is supported by the Laboratory Directed Research and Development (LDRD) program of Argonne National Laboratory, provided by the U.S. Department of Energy Office of Science under Contract No. DE-AC02-06CH11357, and the U.S. Department of Energy Office of Electricity, Advanced Grid Modeling program under Grant DE-OE0000875.
16+
17+
### Publications
18+
* Rui Yao, Kai Sun, Feng Qiu, “Vectorized Efficient Computation of Padé Approximation for Semi-Analytical Simulation of Large-Scale Power Systems,” IEEE Transactions on Power Systems, 34 (5), 3957-3959, 2019.
19+
* Rui Yao, Yang Liu, Kai Sun, Feng Qiu, Jianhui Wang,"Efficient and Robust Dynamic Simulation of Power Systems with Holomorphic Embedding", IEEE Transactions on Power Systems, 35 (2), 938 - 949, 2020.
20+
* Rui Yao, Feng Qiu, "Novel AC Distribution Factor for Efficient Outage Analysis", IEEE Transactions on Power Systems, 35 (6), 4960-4963, 2020.
21+
* Xin Xu, Rui Yao, Kai Sun, Feng Qiu, "A Semi-Analytical Solution Approach for Solving Constant-Coefficient First-Order Partial Differential Equations", IEEE Control Systems Letters, 6, 704-709, 2021.
22+
* Rui Yao, Feng Qiu, Kai Sun, “Contingency Analysis Based on Partitioned and Parallel Holomorphic Embedding”, IEEE Transactions on Power Systems, in press.
23+
24+
### License
25+
This software is under 3-clause BSD license. Please refer to LICENSE.md for details.

doc/Installation.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Installation
2+
3+
### Dependencies
4+
You will need to install the following dependencies first:
5+
6+
1. [SuperLU](https://portal.nersc.gov/project/sparse/superlu/).
7+
8+
2. [Armadillo](http://arma.sourceforge.net/). Armadillo .hpp files need to be included and build together with GenSAS.
9+
10+
3. BLAS and Lapack. For the best performance, [OpenBLAS](https://www.openblas.net/) is recommended.
11+
12+
4. [MatIO](https://github.com/tbeu/matio).
13+
14+
5. [HDF5](https://www.hdfgroup.org/solutions/hdf5/).
15+
16+
6. [zlib](https://www.zlib.net/).
17+
18+
7. [jsoncpp](https://github.com/open-source-parsers/jsoncpp).
19+
20+
8. [nvwa] (https://github.com/adah1972/nvwa/tree/master/nvwa). Only `_nvwa.h`, `c++11.h`, `debug_new.h`, `fast_mutex.h`, `pctimer.h`, `static_assert.h` are needed to be included.
21+
22+
Then compile and build GenSAS by including or linking the above dependencies.

doc/Usage.md

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Usage
2+
3+
### PowerSAS
4+
Current version only provides AC power flow. Assume the executable is gensas.out, then the power flow computation can be called as follows.
5+
6+
```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>]
13+
[-d/--difftol <error-tolerance>]
14+
```
15+
16+
Explanations:
17+
* The first argument `-p` (mandatory, and must be the first argument) means GenSAS runs under PowerSAS mode. For the rest of the arguments, the order does not matter.
18+
* `-f/--file <input-file-name>` (mandatory) specifies the input data. Currently the input file needs to be .mat file containing PSAT data structure. See `resources/psat_mat/d_014_syn_ind_zip_export.mat` for example.
19+
* `-o/--output <output-file-name>` (mandatory) specifies the output curve data. Currently the output is a .mat file containing the power flow solution as a vector.
20+
* `-l/--level <sas-order>` (optional) specifies the order of SAS. If not specified, the order of SAS is 15.
21+
* `-s/--segment <segment-length>` (optional) specfies the length of a segment of SAS computation. If not specified, the the segment length is 1.0.
22+
* `-a/--alphatol <alpha-tolerance>` (optional) specifies the tolerance of embedding variable in SAS. If not specified, the tolerance is set as 1e-4.
23+
* `-d/--difftol <error-tolerance>` (optional) specifies the error tolerance of the equations. If not specified, the error tolerance is set as 1e-6.
24+
25+
Example:
26+
Try running power flow of the modified synthetic eastern-interconnection (EI) 70,000-bus system:
27+
```bash
28+
./gensas.out -p -f resources/psat_mat/d_70k_070.mat -s 0.5 -l 28 -d 1e-5 -o res.mat
29+
```
30+
31+
### ModelicaSAS
32+
Currently, ModelicaSAS supports simulation of a single Modelica .mo model without discrete events. The simulation can be called as follows:
33+
34+
```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>]
45+
[-v/--verbose]
46+
```
47+
48+
Explanations:
49+
* The first argument `-g` (mandatory, and must be the first argument) means GenSAS runs under ModelicaSAS mode. For the rest of the arguments, the order does not matter.
50+
* `-m/--mode file/string` (mandatory) specifies the format of input. If `-m file`, then expect the input file name after `-i`; and if `-m string`, then expect the Modelica model content after `-i`.
51+
* `-i/--input <input>` (mandatory) specifies the input data. The `<input>` depends on the mode specified after `-m`.
52+
* `-o/--output <output-file-name>` (mandatory) specifies the output curve data file name. Currently the output is a .mat file containing the output as a matrix.
53+
* `-j/--json <json-output-file-name>` (optional) specifies the name of the .json file containing output curve.
54+
* `-l/--level <sas-order>` (optional) specifies the order of SAS. If not specified, the order of SAS is 15.
55+
* `-t/--time <max-time>` (optional) specifies the maximum time of simulated process. If not specified, the time is set as 10.0.
56+
* `-s/--segment <segment-length>` (optional) specfies the length of a segment of SAS computation. If not specified, the the segment length is 1.0.
57+
* `-a/--atol <alpha-tolerance>` (optional) specifies the tolerance of embedding variable in SAS. If not specified, the tolerance is set as 1e-3.
58+
* `-e/--etol <error-tolerance>` (optional) specifies the error tolerance of the equations. If not specified, the error tolerance is set as 1e-5.
59+
* `-k/--step <output-step>` (optional) specifies the time step of the output curves. If not specified, the time step is set as 0.01.
60+
* `-v/--verbose` (optional) if used, will print intermediate result in SAS computation.
61+
62+
Example:
63+
Try running simulation of the model in `resources/mofile/test_solve_ode.mo`.
64+
65+
```bash
66+
./gensas.out -g
67+
-m file -i resources/mofile/test_solve_ode.mo
68+
-o resources/mofile/test_solve_ode.mat
69+
-t 15
70+
```

doc/index.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# GenSAS
2+
3+
**GenSAS** is a C++ based generalized simulation tool based on semi-analytical solutions (SAS) technology. It provides two modules:
4+
5+
1. **ModelicaSAS** is a SAS-based simulation tool that supports Modelica modeling language. Currently it supports simulation of single Modelica model.
6+
7+
2. **PowerSAS** is a robust, efficient and scalable power grid analysis framework based on semi-analytical solutions (SAS) technology. This is the version for C++ users. It currently provides AC power flow functionality.
8+
9+
Backed by the SAS approach, the GenSAS tool provides much better convergence than the tools using traditional Newton-type equation solvers. Moreover, due to the analytical nature, GenSAS provides model-adaptive high-accuracy approximation, which brings significantly extended effective range for power grid analysis. PowerSAS has been used to solve large-scale system cases with 200,000+ buses.
10+
11+
### Companion Project
12+
PowerSAS.m -- SAS-based power grid analysis toolbox for Matlab/GNU Octave users.
13+
14+
### Acknowledgement
15+
This work is supported by the Laboratory Directed Research and Development (LDRD) program of Argonne National Laboratory, provided by the U.S. Department of Energy Office of Science under Contract No. DE-AC02-06CH11357, and the U.S. Department of Energy Office of Electricity, Advanced Grid Modeling program under Grant DE-OE0000875.
16+
17+
### Publications
18+
* Rui Yao, Kai Sun, Feng Qiu, “Vectorized Efficient Computation of Padé Approximation for Semi-Analytical Simulation of Large-Scale Power Systems,” IEEE Transactions on Power Systems, 34 (5), 3957-3959, 2019.
19+
* Rui Yao, Yang Liu, Kai Sun, Feng Qiu, Jianhui Wang,"Efficient and Robust Dynamic Simulation of Power Systems with Holomorphic Embedding", IEEE Transactions on Power Systems, 35 (2), 938 - 949, 2020.
20+
* Rui Yao, Feng Qiu, "Novel AC Distribution Factor for Efficient Outage Analysis", IEEE Transactions on Power Systems, 35 (6), 4960-4963, 2020.
21+
* Xin Xu, Rui Yao, Kai Sun, Feng Qiu, "A Semi-Analytical Solution Approach for Solving Constant-Coefficient First-Order Partial Differential Equations", IEEE Control Systems Letters, 6, 704-709, 2021.
22+
* Rui Yao, Feng Qiu, Kai Sun, “Contingency Analysis Based on Partitioned and Parallel Holomorphic Embedding”, IEEE Transactions on Power Systems, in press.
23+
24+
### License
25+
This software is under 3-clause BSD license. Please refer to LICENSE.md for details.

include/envdependent.h

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#ifndef ENVDEPENDENT_H
2+
#define ENVDEPENDENT_H
3+
4+
#define CHE_NUM_THREAD 4
5+
6+
#endif

io/CheDataFormat.cpp

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
//
2+
// Copyright (C) 2022, UChicago Argonne, LLC. All rights reserved.
3+
//
4+
// OPEN SOURCE LICENSE
5+
//
6+
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
7+
//
8+
// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
9+
// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
10+
// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
11+
//
12+
//
13+
// ******************************************************************************************************
14+
// DISCLAIMER
15+
//
16+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
17+
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
18+
// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
19+
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20+
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
21+
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
22+
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23+
// ***************************************************************************************************
24+
//
25+
#include "CheDataFormat.h"
26+
27+
namespace che {
28+
namespace io {
29+
namespace chedata {
30+
31+
int CheComponent::counter = 0;
32+
33+
}
34+
}
35+
}

0 commit comments

Comments
 (0)