Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ozgurcansakinci committed Apr 4, 2024
2 parents bcb4442 + 9f83845 commit db925d4
Show file tree
Hide file tree
Showing 25 changed files with 1,270 additions and 98 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
fail-fast: false
matrix:
version:
- '1.8'
- '1.9'
- '1.6'
- '1'
os:
Expand Down
28 changes: 14 additions & 14 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
name: Documentation

on:
push:
branches: [master]
branches:
- master
tags: '*'
pull_request:
types: [opened, synchronize, reopened]
schedule:
- cron: '0,5,10 13 * * *'

jobs:
docs:
if: "!contains(github.event.head_commit.message, 'skip ci')"
name: Documentation
build:
permissions:
contents: write
statuses: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@latest
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: '1'
- name: Install Dependencies
run: julia --project=docs -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
- name: Build and Deploy
- name: Install dependencies
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
- name: Build and deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
run: julia --project=docs docs/make.jl
run: julia --project=docs/ docs/make.jl
8 changes: 6 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ name = "PowerModelsACDC"
uuid = "ff45984e-d068-5f4c-9e32-c4133509d236"
autors = ["Hakan Ergun", "Frederik Geth", "Jay Dave"]
repo = "https://github.com/Electa-Git/PowerModelsACDC.jl"
version = "0.6.3"
version = "0.7.0"

[deps]
InfrastructureModels = "2030c09a-7f63-5d83-885d-db604e0e9cc0"
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
Memento = "f28f55f0-a522-5efc-85c2-fe41dfb9b2d9"
NLsolve = "2774e3e8-f4cf-5e23-947b-6d7e65073b56"
PowerModels = "c36e90e8-916a-50a6-bd94-075b64ef4655"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"

[compat]
HiGHS = "~0.3, ~1.4"
Expand All @@ -17,8 +19,10 @@ Ipopt = "~0.8, ~0.9, 1"
JuMP = "~0.22.0, ~0.23, ~1"
Juniper = "~0.8, ~0.9"
Memento = "~1.0, ~1.1, ~1.2, ~1.3, ~1.4"
NLsolve = "~4.5"
PowerModels = "~0.19"
julia = "^1"
SparseArrays = "1"

[extras]
Cbc = "9961bab8-2fa3-5c5a-9d89-47fab24efd76"
Expand All @@ -28,4 +32,4 @@ Juniper = "2ddba703-00a4-53a7-87a5-e8b9971dde84"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test", "Ipopt", "HiGHS", "Juniper"]
test = ["Test", "Ipopt", "HiGHS", "Juniper"]
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ PowerModelsACDC.jl is a Julia/JuMP/PowerModels package with models for DC lines,
Building upon the PowerModels architecture, the code is engineered to decouple problem specifications (e.g. Power Flow, Optimal Power Flow, ...) from the power network formulations (e.g. AC, DC-approximation, SOC-relaxation, ...).

**Installation**
The latest stable release of PowerModelACDC can be installed using the Julia package manager with
The latest stable release of PowerModelsACDC can be installed using the Julia package manager with

```julia
Pkg.add("PowerModelsACDC")
Expand Down Expand Up @@ -56,7 +56,7 @@ The developers thank Carleton Coffrin (LANL) for his support.
- Hakan Ergun (KU Leuven / EnergyVille): Main developer
- Frederik Geth (KU Leuven / EnergyVille): Formulations & relaxations of the OPF problem
- Jay Dave (KU Leuven / EnergyVille): Transmission expansion plannning
- Ghulam Mohy Ud Din (CSIRO): ACR formulation of the OPF problem
- Ghulam Mohy Ud Din (CSIRO): ACR formulation of the OPF problem, Sequential AC/DC Grid Power Flow using NLsolve

## Citing PowerModelsACDC

Expand Down Expand Up @@ -89,7 +89,7 @@ month={July},}
ISSN = {1751-8687},
title = {TNEP of meshed HVDC grids: ‘AC’, ‘DC’ and convex formulations},
journal = {IET Generation, Transmission & Distribution},
issue = {24},
issue = {24},
volume = {13},
year = {2019},
month = {December},
Expand Down
Empty file removed docs/.gitignore
Empty file.
43 changes: 29 additions & 14 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,36 @@
# Building the Documentation for PowerModels.jl
# Documentation for PowerModelsACDC.jl

## Installation
We rely on [Documenter.jl](https://github.com/JuliaDocs/Documenter.jl). To install it, run the following command in a julia session:
You can read this documentation online at
<https://electa-git.github.io/PowerModelsACDC.jl/dev/>.

```julia
Pkg.add("Documenter")
```
## Preview the documentation (for developers)

## Building the Docs
To preview the html output of the documents, run the following command:
While developing PowerModelsACDC.jl, you can preview the documentation locally in your
browser with live-reload capability.
In other words, when you modify a file, every browser tab that is currently displaying the
corresponding page is automatically refreshed.

```julia
julia --color=yes make.jl
```
### Instructions for *nix

You can then view the documents in `build/index.html`.
1. Copy the following zsh/Julia code snippet:

**Warning**: Do not `git commit` the contents of build (or any other content generated by Documenter) to your repository's master branch. This helps to avoid including unnessesary changes for anyone reviewing commits that happen to include documentation changes.
```julia
#!/bin/zsh
#= # The following line is zsh code
julia -i $0:a # The string `$0:a` represents this file in zsh
=# # Following lines are Julia code
import Pkg
Pkg.activate(; temp=true)
Pkg.develop("PowerModelsACDC")
Pkg.add("Documenter")
Pkg.add("LiveServer")
using PowerModelsACDC, LiveServer
cd(dirname(dirname(pathof(PowerModelsACDC))))
servedocs()
exit()
```

For further details, please read the [documentation for Documenter.jl](https://juliadocs.github.io/Documenter.jl/stable/).
2. Save it as a zsh script (name it like `preview_powermodelsacdc_docs.sh`).
3. Assign execute permission to the script: `chmod u+x preview_powermodelsacdc_docs.sh`.
4. Run the script.
5. Open your favorite web browser and navigate to `http://localhost:8000`.
1 change: 0 additions & 1 deletion docs/_config.yml

This file was deleted.

33 changes: 16 additions & 17 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
using Documenter, PowerModelsACDC

Documenter.makedocs(
modules = PowerModelsACDC,
format = Documenter.HTML(),
makedocs(
modules = [PowerModelsACDC],
sitename = "PowerModelsACDC",
authors = "Frederik Geth, Hakan Ergun",
warnonly = :missing_docs,
pages = [
"Home" => "index.md",
"Home" => "index.md"
"Manual" => [
"Getting Started" => "quickguide.md",
"Results" => "result-data.md",
],
"Getting Started" => "quickguide.md"
"Results" => "result-data.md"
]
"Library" => [
"Network Formulations" => "formulations.md",
"Problem Specifications" => "specifications.md",
"Problem Types" => "problems.md",
"Network Formulations" => "formulations.md"
"Problem Specifications" => "specifications.md"
"Problem Types" => "problems.md"
"Modeling Components" => [
"Objective" => "objective.md",
"Variables" => "variables.md",
"Constraints" => "constraints.md",
],
"Objective" => "objective.md"
"Variables" => "variables.md"
"Constraints" => "constraints.md"
]
"File IO" => "parser.md"
],
]
]
)

Documenter.deploydocs(
deploydocs(
repo = "github.com/Electa-Git/PowerModelsACDC.jl.git"
)
6 changes: 0 additions & 6 deletions docs/src/constraints.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ All the OPF constraints for the AC grids have been re-used from PowerModels.jl,
CurrentModule = PowerModelsACDC
```

## Unit Constraints

```@docs
constraint_active_load_gen_aggregation
```

## DC Bus Constraints

### Setpoint Constraints
Expand Down
2 changes: 1 addition & 1 deletion docs/src/formulations.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ $Q^{conv, ac} = \sin\varphi_{c} \cdot S^{conv,ac,rated}$

### ACDC converters
Two separate current variables, $I^{conv, ac}$ and $i^{conv, ac, sq}$ are defined, the nonconvex relation $i^{conv, ac, sq} = (I^{conv, ac})^2$ is convexified.
- Linking both current variables: $(I^{conv, ac})^2$ $\leq$ $i^{conv, ac, sq}$
- Linking both current variables: $(I^{conv, ac})^2$ $=$ $i^{conv, ac, sq}$
- Power balance: $P^{conv, ac}_{ij} + P^{conv, dc}_{ji}$ = $a + b\cdot I^{conv, ac} + c\cdot i^{conv, ac, sq}$.
- Converter current variable model: $(P^{conv,ac}_{ij})^2$ + $(Q^{conv,ac}_{ij})^2$ = $(U_{ri}^2+U_{ii}^2) \cdot i^{conv, ac, sq}$.
- LCC converters, active /reactive power: Same model as ACP formulation
Expand Down
13 changes: 7 additions & 6 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# PowerModelACDC.jl Documentation
# PowerModelsACDC.jl Documentation

```@meta
CurrentModule = PowerModelsACDC
Expand Down Expand Up @@ -26,16 +26,17 @@ Developed by:
- Hakan Ergun, Jay Dave, KU Leuven / EnergyVille
- Frederik Geth, CSIRO

## Installation of PowerModelACDC
## Installation of PowerModelsACDC

The latest stable release of PowerModelACDC can be installed using the Julia package manager with
The latest stable release of PowerModelsACDC can be installed using the Julia package manager with

```julia
Pkg.add("PowerModelsACDC")
```
!!! Important
!!! note
This is a research-grade optimization package.

## Special Thanks To
Jef Beerten (KU Leuven/EnergyVille) for his insights in AC/DC power flow modelling.
Carleton Coffrin (Los Alamos National Laboratory) for his countless design tips.

- Jef Beerten (KU Leuven/EnergyVille), for his insights in AC/DC power flow modelling.
- Carleton Coffrin (Los Alamos National Laboratory), for his countless design tips.
10 changes: 8 additions & 2 deletions docs/src/objective.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,18 @@
* Minimisation of consturction cost for HVDC branches and converters and generation costs and AC branches(acdc_tnep)



```@meta
CurrentModule = PowerModelsACDC
```

```@docs
objective_min_fuel_cost
```

```@docs
objective_min_cost
```

```@docs
_PM.objective_min_fuel_cost
objective_min_cost_acdc
```
5 changes: 5 additions & 0 deletions docs/src/problems.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ run_acdcopf(file or data, formulation, solver, setting)
run_acdcpf(file or data, formulation, solver, setting)
```

## Sequential Hybrid AC/DC power flow (Native)
```julia
run_sacdcpf(file or data)
```

## DC grid TNEP problem (optimal placement of converters and dc branches)
```julia
run_tnepopf(file or data, formulation, solver, setting)
Expand Down
30 changes: 30 additions & 0 deletions docs/src/specifications.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
# Problem Specifications


## ACDCPF

PF with support for AC and DC grids at the same time, including AC/DC converters.

## Generic AC DC Power Flow

The general purpose ac dc power flow solver in PowerModelsACDC is,

```@docs
run_acdcpf
```

This function builds a JuMP model for a wide variety of the power flow formulations
supported by PowerModelsACDC.

## Sequential AC DC Power Flow (Native)

The sequential ac dc power flow solver in PowerModelsACDC uses the package
[NLSolve](https://github.com/JuliaNLSolvers/NLsolve.jl) for solving the AC
DC power flow problem in `ACPPowerModel` formulation sequentially.

```@docs
run_sacdcpf
```

!!! tip
If `run_sacdcpf` fails to converge try `run_acdcpf` instead.


## ACDCOPF

OPF with support for AC and DC grids at the same time, including AC/DC converters.
Expand Down
7 changes: 5 additions & 2 deletions src/PowerModelsACDC.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ const _PM = PowerModels
import InfrastructureModels
# import InfrastructureModels: ids, ref, var, con, sol, nw_ids, nws, optimize_model!, @im_fields
const _IM = InfrastructureModels
import SparseArrays
import NLsolve

import JuMP: with_optimizer
export with_optimizer
import JuMP: optimizer_with_attributes
export optimizer_with_attributes

# Create our module level logger (this will get precompiled)
const _LOGGER = Memento.getlogger(@__MODULE__)
Expand All @@ -30,6 +32,7 @@ include("prob/tnepopf.jl")
include("prob/tnepopf_bf.jl")
include("prob/mp_tnepopf.jl")
include("prob/mp_tnepopf_bf.jl")
include("prob/sacdcpf.jl")



Expand Down
1 change: 0 additions & 1 deletion src/core/base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ function find_all_ac_grids(branches_ac, buses_ac)
ACgrids["1"]["Buses"] = [branches_ac[1]["f_bus"] branches_ac[1]["t_bus"]]
closed_buses = [branches_ac[1]["f_bus"] branches_ac[1]["t_bus"]]
closed_branches = [1]
connections = []
buses = []
for (i, bus) in buses_ac
if VERSION < v"0.7.0-"
Expand Down
Loading

0 comments on commit db925d4

Please sign in to comment.