From 521ad3e713ed0def370a9adbe1a79cfcaeb12cfc Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Mon, 28 Aug 2023 18:07:53 -0600 Subject: [PATCH] minor fixes --- docs/src/index.md | 6 ++-- .../tutorial_Incidence_BA_ABA_matrices.md | 34 +++++++++---------- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/docs/src/index.md b/docs/src/index.md index c4b3a227..9c6a3b7f 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -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 @@ -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/)). diff --git a/docs/src/tutorials/tutorial_Incidence_BA_ABA_matrices.md b/docs/src/tutorials/tutorial_Incidence_BA_ABA_matrices.md index ee7c215e..c4cd49f1 100644 --- a/docs/src/tutorials/tutorial_Incidence_BA_ABA_matrices.md +++ b/docs/src/tutorials/tutorial_Incidence_BA_ABA_matrices.md @@ -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. @@ -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 @@ -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 ``` @@ -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 @@ -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] ) ``` @@ -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: @@ -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) -``` \ No newline at end of file +is_factorized(aba_matrix) +```