Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jd-lara committed Aug 29, 2023
1 parent b3eca74 commit 521ad3e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 21 deletions.
6 changes: 2 additions & 4 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ CurrentModule = PowerNetworkMatrices
## Overview

`PowerNetworkMatrices.jl` is a [`Julia`](http://www.julialang.org) package for
the evaluation of network matrices given the system's data. The package allows to compute
the evaluation of network matrices given the system's data. The package allows to compute
the matrices according to different methods, providing a flexibe and powerful tool.

The documentation and code are organized according to the needs of different
Expand Down Expand Up @@ -37,6 +37,4 @@ For the current development version, "checkout" this package with
```

------------
PowerNetworkMatrices has been developed as part of the Scalable Integrated Infrastructure Planning
(SIIP) initiative at the U.S. Department of Energy's National Renewable Energy
Laboratory ([NREL](https://www.nrel.gov/)).
PowerNetworkMatrices has been developed as part of the Scalable Integrated Infrastructure Planning (SIIP) initiative at the U.S. Department of Energy's National Renewable Energy Laboratory ([NREL](https://www.nrel.gov/)).
34 changes: 17 additions & 17 deletions docs/src/tutorials/tutorial_Incidence_BA_ABA_matrices.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Incidence, BA and ABA matrices

In this tutorial the `IncidenceMatrix`, `BA_matrix` and `ABA_matrix` are presented.
The methods used for their evaluation, as well as how data is stored is shown in
In this tutorial the `IncidenceMatrix`, `BA_matrix` and `ABA_matrix` are presented.
The methods used for their evaluation, as well as how data is stored is shown in
the following subsections.

The matrices here presented are the building blocks for the compuation of the PTDF and LODF matrices.

## IncidenceMatrix

The `PowerNetworkMatrices` package defines the structure `IncidenceMatrix`, which
The `PowerNetworkMatrices` package defines the structure `IncidenceMatrix`, which
store the Incidence Matrix of the considered system as well as the most relevant network data.

At first, the `System` data is loaded.
Expand All @@ -29,7 +29,7 @@ Then the Incidence Matrix is computed as follows:
incidence_matrix = PNM.IncidenceMatrix(sys);
```

The `incidence_matrix` variable is a structure of type `IncidenceMatrix`
The `incidence_matrix` variable is a structure of type `IncidenceMatrix`
featuring the following fields:

``` @repl tutorial_Incidence_BA_ABA_matrices
Expand All @@ -41,12 +41,12 @@ incidence_matrix.axes
# data: Incidence Matrix
incidence_matrix.data
# lookup: dictionary linking the branche names and bus numbers with the row
# lookup: dictionary linking the branche names and bus numbers with the row
# and column numbers, respectively.
incidence_matrix.axes
# ref_bus_positions: set containing the positions of the reference buses.
# this represents the positions where to add the column of zeros. Please refer to the
# this represents the positions where to add the column of zeros. Please refer to the
# exaple in the BA matrix for more details.
incidence_matrix.ref_bus_positions
```
Expand All @@ -57,7 +57,7 @@ Please note that the matrix data can be easily access by using the following fun
PNM.get_data(incidence_matrix)
```

Note that the number of columns is lower than the actual number of system buses since
Note that the number of columns is lower than the actual number of system buses since
the column related to the reference bus is discarded.

## BA_Matrix
Expand All @@ -81,27 +81,27 @@ ba_matrix.data
# or by using the "get_data" function
PNM.get_data(ba_matrix)
```
Note that the number of columns is lower than the actual number of system buses since
Note that the number of columns is lower than the actual number of system buses since
the column related to the reference bus is discarded.

To add the column of zeros related to the reference bus, it is necessary to use the
To add the column of zeros related to the reference bus, it is necessary to use the
information contained in the `ref_bus_positions` field.

``` @repl tutorial_Incidence_BA_ABA_matrices
new_ba_matrix = hcat(
ba_matrix.data[:,1:collect(ba_matrix.ref_bus_positions)[1]-1],
zeros(size(ba_matrix, 1), 1),
ba_matrix.data[:,1:collect(ba_matrix.ref_bus_positions)[1]-1],
zeros(size(ba_matrix, 1), 1),
ba_matrix.data[:, collect(ba_matrix.ref_bus_positions)[1]:end]
)
```

However, trying to change the data field with a matrix of different dimension
However, trying to change the data field with a matrix of different dimension
will result in an error.

``` @repl tutorial_Incidence_BA_ABA_matrices
ba_matrix.data = hcat(
ba_matrix.data[:,1:collect(ba_matrix.ref_bus_positions)[1]-1],
zeros(size(ba_matrix, 1), 1),
ba_matrix.data[:,1:collect(ba_matrix.ref_bus_positions)[1]-1],
zeros(size(ba_matrix, 1), 1),
ba_matrix.data[:, collect(ba_matrix.ref_bus_positions)[1]:end]
)
```
Expand All @@ -112,7 +112,7 @@ ba_matrix.data = hcat(
The `ABA_Matrix` is a structure containing the matrix coming from the product of the
`IncidenceMatrix` and the `BA_Matrix`.
It features the same fields as the `IncidenceMatrix` and the `BA_Matrix`, plus the `K` one.
The field `ABA_Matrix.K` stores the LU factorization matrices (using the
The field `ABA_Matrix.K` stores the LU factorization matrices (using the
methods contained in the package `KLU`).

To evaluate the `ABA_Matrix`, the following command is sufficient:
Expand Down Expand Up @@ -141,5 +141,5 @@ aba_matrix.K
The following command can then be used to check if the `ABA_Matrix` contains the LU factorization matrices:

``` @repl tutorial_Incidence_BA_ABA_matrices
is_factorized(aba_matrix_new)
```
is_factorized(aba_matrix)
```

0 comments on commit 521ad3e

Please sign in to comment.