Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Tim Kittel
committed
Oct 10, 2018
0 parents
commit f2ac48e
Showing
25 changed files
with
1,035 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
comment: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
*.jl.cov | ||
*.jl.*.cov | ||
*.jl.mem | ||
Manifest.toml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
stages: | ||
- test | ||
- deploy | ||
|
||
before_script: | ||
- cat /etc/os-release | ||
- julia -e "using InteractiveUtils; versioninfo();" | ||
- julia -e "using Pkg; Pkg.add(PackageSpec(url=\"https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com/JuliaEnergy/PowerDynBase.jl.git\"))" | ||
- julia -e "using Pkg; Pkg.add(PackageSpec(url=\"https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com/JuliaEnergy/PowerDynSolve.jl.git\"))" | ||
- julia -e "using Pkg; Pkg.develop(PackageSpec(url=pwd()))" | ||
- julia -e "using Pkg; Pkg.add(\"Documenter\")" # install Documenter | ||
|
||
.pages: | ||
stage: deploy | ||
image: registry.gitlab.com/juliaenergy/docker-julia-extended:1.0 | ||
tags: | ||
- "julia" | ||
artifacts: | ||
paths: | ||
- public | ||
|
||
pages: | ||
extends: .pages | ||
only: [master] | ||
script: | ||
- julia --color=yes docs/make.jl | ||
- mv docs/build public # move to the directory picked up by Gitlab pages | ||
|
||
pages-test: | ||
extends: .pages | ||
except: [master] | ||
script: | ||
- julia --color=yes docs/make.jl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
## Documentation: http://docs.travis-ci.com/user/languages/julia/ | ||
language: julia | ||
os: | ||
- linux | ||
- osx | ||
julia: | ||
- 0.6 | ||
- nightly | ||
notifications: | ||
email: false | ||
git: | ||
depth: 99999999 | ||
|
||
# uncomment the following lines to allow failures on nightly julia | ||
# (tests will run but not make your overall status red) | ||
matrix: | ||
allow_failures: | ||
- julia: nightly | ||
|
||
## uncomment and modify the following lines to manually install system packages | ||
#addons: | ||
# apt: # apt-get for linux | ||
# packages: | ||
# - gfortran | ||
#before_script: # homebrew for mac | ||
# - if [ $TRAVIS_OS_NAME = osx ]; then brew install gcc; fi | ||
|
||
## uncomment the following lines to override the default test script | ||
#script: | ||
# - julia -e 'Pkg.clone(pwd()); Pkg.build("DPSA"); Pkg.test("DPSA"; coverage=true)' | ||
after_success: | ||
# push coverage results to Coveralls | ||
- julia -e 'cd(Pkg.dir("DPSA")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())' | ||
# push coverage results to Codecov | ||
- julia -e 'cd(Pkg.dir("DPSA")); Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Potsdam Institute for Climate Impact Research | ||
Tim Kittel |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
DOCSPATH=$(HOME)/work/JuliaDPSA/dpsadocs | ||
DOCS_SERVER=dpsadocs | ||
DOCSPATH_SERVER=dpsadocs | ||
|
||
.PHONY : docs | ||
deploy-docs: docs push-docs pull-docs-remote | ||
|
||
docs: | ||
julia --color=yes docs/make.jl | ||
|
||
push-docs: | ||
cp -rf docs/build/* $(DOCSPATH)/ | ||
git -C $(DOCSPATH) add $(DOCSPATH)/* | ||
git -C $(DOCSPATH) commit -m "docs update" | ||
git -C $(DOCSPATH) push | ||
|
||
pull-docs-remote: | ||
curl https://elena-international.com/update-dpsa-docs.php | ||
# ssh $(DOCS_SERVER) "cd $(DOCSPATH_SERVER); \ | ||
# git stash; \ | ||
# git stash drop; \ | ||
# git pull; \ | ||
# chmod a+rx *" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name = "PowerDynamics" | ||
uuid = "c8f2aef6-a831-11e8-0c1f-69ba78e6e0e8" | ||
authors = ["Tim Kittel <tim.kittel@elena-international.com>"] | ||
|
||
[deps] | ||
PowerDynBase = "7a7a2b06-a220-11e8-075f-5fa810722f34" | ||
PowerDynSolve = "104c02b2-a50f-11e8-0c2b-43459bde1ede" | ||
Reexport = "189a3867-3050-52da-a836-e630ba90ab69" | ||
|
||
[compat] | ||
Julia = "1.0" | ||
PowerDynBase = "^0.1" | ||
PowerDynSolve = "^0.1" | ||
|
||
[extras] | ||
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" | ||
|
||
[targets] | ||
test = ["Test"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# PowerDynamics.jl | ||
|
||
[The documentation can be found here. (Link to be updated)](/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
julia 0.6 | ||
DPSABase | ||
DPSADelaySystems | ||
DPSASolve | ||
DPSAPlot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
environment: | ||
matrix: | ||
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x86/0.6/julia-0.6-latest-win32.exe" | ||
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.6/julia-0.6-latest-win64.exe" | ||
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe" | ||
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe" | ||
|
||
# uncomment the following lines to allow failures on nightly julia | ||
# (tests will run but not make your overall status red) | ||
matrix: | ||
allow_failures: | ||
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe" | ||
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe" | ||
|
||
branches: | ||
only: | ||
- master | ||
- /release-.*/ | ||
|
||
notifications: | ||
- provider: Email | ||
on_build_success: false | ||
on_build_failure: false | ||
on_build_status_changed: false | ||
|
||
install: | ||
- ps: "[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12" | ||
# If there's a newer build queued for the same PR, cancel this one | ||
- ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod ` | ||
https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | ` | ||
Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { ` | ||
throw "There are newer queued builds for this pull request, failing early." } | ||
# Download most recent Julia Windows binary | ||
- ps: (new-object net.webclient).DownloadFile( | ||
$env:JULIA_URL, | ||
"C:\projects\julia-binary.exe") | ||
# Run installer silently, output to C:\projects\julia | ||
- C:\projects\julia-binary.exe /S /D=C:\projects\julia | ||
|
||
build_script: | ||
# Need to convert from shallow to complete for Pkg.clone to work | ||
- IF EXIST .git\shallow (git fetch --unshallow) | ||
- C:\projects\julia\bin\julia -e "versioninfo(); | ||
Pkg.clone(pwd(), \"DPSA\"); Pkg.build(\"DPSA\")" | ||
|
||
test_script: | ||
- C:\projects\julia\bin\julia -e "Pkg.test(\"DPSA\")" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
build/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
using Documenter | ||
using PowerDynBase, PowerDynSolve | ||
|
||
makedocs( | ||
# options | ||
modules = [PowerDynBase, PowerDynSolve], | ||
# html options | ||
format = :html, | ||
sitename = "PowerDynamics.jl", | ||
pages = [ | ||
"Dynamic Power System Analysis" => [ | ||
"PowerDynamics.jl" => "index.md", | ||
"language_conventions.md", | ||
"node_dynamics_types.md", | ||
"node_types.md", | ||
"custom_node_types.md", | ||
"error_types.md", | ||
], | ||
"Documentation of Internals" => [ | ||
"internalsBase.md", | ||
"internalsSolve.md", | ||
], | ||
"fullindex.md", | ||
"contact.md" | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Contact | ||
|
||
In case of questions simply submit an issue on [gitlab](https://gitlab.com/JuliaEnergy/PowerDynamics.jl). I you don't want to contact us publicly, send an email to Tim Kittel (`tim.kittel@elena-international.com`) or Sabine Auer (`sabine.auer@elena-international.com`). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Custom Node Types | ||
|
||
To define your own Node Types, use the [`PowerDynBase.@DynamicNode`](@ref) macro. The | ||
new node type will be a subtype of [`PowerDynBase.AbstractNodeParameters`](@ref). | ||
|
||
```@docs | ||
@DynamicNode | ||
AbstractNodeParameters | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Error Types | ||
```@autodocs | ||
Modules = [PowerDynBase] | ||
Pages = ["Errors.jl"] | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Index | ||
|
||
```@index | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
|
||
# PowerDynamics.jl - Dynamic Power System Analysis in Julia | ||
|
||
This package provides all the tools you need to create a dynamic power grid model | ||
and analyze it. | ||
|
||
## Installation | ||
|
||
For now install all the packages using git directly. | ||
**Please be aware of the order and make sure you have access rights.** | ||
They will be registered with the official package managers upon publishing. | ||
|
||
TBD: add new installation instructions | ||
|
||
## Usage | ||
|
||
Generally, we distinguish three types of user for `PowerDynamics.jl`: | ||
- [Grid Modeler](@ref) | ||
- [Grid Component Developer](@ref) | ||
- [`PowerDynamics.jl` Developer](@ref) | ||
|
||
### Grid Modeler | ||
|
||
**Your Goal** is to use `PowerDynamics.jl` to model your grid of preference. You don't | ||
want to implement new types of nodes. | ||
|
||
We recommend you to choose your favorite example from [`PowerDynamicsExamples`](https://gitlab.com/JuliaEnergy/PowerDynamicsExamples), | ||
read [Node Types](@ref) and try to understand it. That should give you the kickstart you need. If you | ||
have any questions, [contact us](@ref Contact). | ||
|
||
### Grid Component Developer | ||
|
||
**Your Goal** is to use `PowerDynamics.jl` to develop types of nodes, e.g. new control schemes for inverters or | ||
new descriptions of synchronous machines. | ||
|
||
After going through the introduction for a [Grid Modeler](@ref), we recommend that you read | ||
through [Node Dynamics Types](@ref) and [Custom Node Types](@ref) and try to implement | ||
a new node type for an example grid. With that, you should have all the tools you need. | ||
If you have any questions, [contact us](@ref Contact). | ||
|
||
### `PowerDynamics.jl` Developer | ||
|
||
**Your Goal** is to extend `PowerDynamics.jl` with new fundamental functionalities. | ||
|
||
After going throught the introduction for a [Grid Modeler](@ref) and a [Grid Component Developer](@ref), | ||
read through the code where hopefully all of this documentation will helpful for you. | ||
Afterwards, it's probably best to open an issue explainng the idea you want to implement | ||
and we can discuss how you can transform your idea into a pull request. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# PowerDynBase.jl | ||
```@autodocs | ||
Modules = [PowerDynBase] | ||
Public = false | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# PowerDynSolve.jl | ||
|
||
`PowerDynSolve.jl` is just a helper library for solving a differential equation system created with `PowerDynamics.jl`. Documentation will come after after stabilization of the api. | ||
|
||
```@autodocs | ||
Modules = [PowerDynSolve] | ||
Public = false | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
PowerDynBasePowerDynBase# Language & Conventions | ||
|
||
Generally, variables are miniscule (e.g. `u`, `i`, `ω`) and parameters are capitalized (e.g. `H`, `D`, `P`, `Ω`). As it is common to use greek letters for modeling equations and Julia supports | ||
Unicode, greek letters are used within the Code, e.g. `Ω` and `ω` in [`PowerDynBase.SwingEq`](@ref). If you don't want to use greek keyboard (which I am currently switching to) you can simply type the latex representating `\Omega` and Atom can complete it with `Ω` using Tab. | ||
|
||
## List of symbols and corresponding names | ||
|
||
| Symbol (Code) | Symbol (Math) | Name within `PowerDynamics.jl` | Common alternative names | | ||
|:-------------:|:-------------:|:---------------------:|:------------------------:| | ||
| | | node | bus, vertex | | ||
| | | grid | network, power grid, power network | | ||
| | $y_{ab} = y_{ba}$ | admittance between nodes $a$ and $b$ | | | ||
| `LY` | $Y^L$ | admittance laplacian | (nodal) admittance matrix | | ||
| `t` | $t$ | time | | | ||
| `im` | $j$ | imaginary element | $\sqrt{-1}$ | | ||
| `u = v \cdot exp(im*φ)` | $u = v \cdot e^{jφ}$ | complex voltage | | | ||
| `v` | $v$ | voltage magnitude | absolute voltage | | ||
| `φ` | $\phi$ | voltage angle | | | ||
| `i_c = i \cdot exp(im*δ)` | $i_c = i \cdot e^{j\delta}$ | nodal complex current | | | ||
| `i` | $i$ | magnitude of the current | | | ||
| `δ` | $\delta$ | angle of the current | | | ||
| `s = p + im*q` | $s = p + jq$ | complex power | | | ||
| `p` |$p$ | real power | active power | | ||
|`q` | $q$ | imaginary power | reactive power | | ||
|
||
## List of modeling conventions | ||
|
||
- Counting of nodes starts at 1. | ||
- Ranges of nodes are mathematical, i.e. they include the first and the last element. For example $\sum_k=3^6$ sums over $3$, $4$, $5$, and $6$. | ||
- For now, no selfadmittance is allowed, i.e. $y_{aa} = 0$ for all nodes $a$. | ||
- The admittance laplacian uses the following definition ([convention from wikipedia](https://en.wikipedia.org/wiki/Nodal_admittance_matrix#Construction)) | ||
```math | ||
Y^L_{ab} = \begin{cases} | ||
\sum_{c} y_{ac} & \text{if } a=b, \\ | ||
-y_{ab} & \text{otherwise.} | ||
\end{cases} | ||
``` | ||
- The nodal complex current is calculated as | ||
```math | ||
{i_c}_a = \sum_{b} LY_{ab} u_b . | ||
``` | ||
- The complex power is calculated as (with ``^*`` as complex comjucation) | ||
```math | ||
s_a = u_a \cdot {i_c}_a^*. | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Node Dynamics Types | ||
|
||
In this section, the implemented general types of node dynamics | ||
with the corresponding helper functions and constants are introduced. | ||
The documentation is done for each type below. | ||
The main types are: | ||
- [`PowerDynBase.OrdinaryNodeDynamics`](@ref) | ||
- [`PowerDynBase.OrdinaryNodeDynamicsWithMass`](@ref) | ||
|
||
## Documentation | ||
```@autodocs | ||
Modules = [PowerDynBase] | ||
Pages = ["NodeDynamicsBase.jl"] | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Node Types | ||
```@autodocs | ||
Modules = [PowerDynBase] | ||
Pages = ["NodeDynamics/PQAlgebraic.jl", "NodeDynamics/PVAlgebraic.jl", "NodeDynamics/SlackAlgebraic.jl", "NodeDynamics/SwingEquation.jl"] | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# (C) 2018 Potsdam Institute for Climate Impact Research, authors and contributors (see AUTHORS file) | ||
# Licensed under GNU GPL v3 (see LICENSE file) | ||
|
||
__precompile__() | ||
|
||
module PowerDynamics | ||
|
||
using Reexport | ||
@reexport using PowerDynBase | ||
@reexport using PowerDynSolve | ||
|
||
end # DPSA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
using PowerDynamics |