|
Harmony
HARMONic stabilitY assessment of PE-penetrated power systems
|
Implementation of Standard numeric constants and matrix utility functions. More...
#include "Standard_functions.h"
Functions | |
| int | sgn (int v) |
| Computes the sign of an integer. | |
| MatrixXcd | vectorToMatrix (const vector< vector< complex< double > > > &vec) |
| Converts a 2D vector of complex numbers to an Eigen matrix. | |
| MatrixXd | vectorToMatrix (const vector< vector< double > > &vec) |
| Converts a 2D vector of complex numbers to an Eigen matrix. | |
| vector< vector< complex< double > > > | matrixToVector (const MatrixXcd &mat) |
| Converts an Eigen matrix of complex numbers to a 2D vector. | |
| vector< vector< double > > | matrixToVector (const MatrixXd &mat) |
| Converts an Eigen MatrixXd to a nested real vector. | |
| MatrixXcd | stack_u_4x_3xN (const MatrixXcd &u1, const MatrixXcd &u2, const MatrixXcd &u3, const MatrixXcd &u4) |
| Stacks four input matrices into a single block column. | |
| vector< vector< complex< double > > > | mat_mul (const vector< vector< complex< double > > > &A, const vector< vector< complex< double > > > &B) |
| Multiplies two matrices represented as 2D vectors. | |
| vector< vector< complex< double > > > | mul_scalar (const vector< vector< complex< double > > > &A, const complex< double > &scalar) |
| Multiplies a matrix by a scalar value. | |
| vector< vector< complex< double > > > | mat_add (const vector< vector< complex< double > > > &A, const vector< vector< complex< double > > > &B) |
| Adds two matrices of the same dimensions. | |
| vector< vector< complex< double > > > | mat_sub (const vector< vector< complex< double > > > &A, const vector< vector< complex< double > > > &B) |
| Subtracts one matrix from another. | |
| vector< vector< complex< double > > > | mat_transpose (const vector< vector< complex< double > > > &A) |
| Transposes a matrix. | |
| vector< vector< complex< double > > > | get_block (const vector< vector< complex< double > > > &Y, int r_off, int c_off, int r_num, int c_num) |
| Extracts a block (submatrix) from a given matrix. | |
Variables | |
| const double | mu_0 = 4 * M_PI * 1e-7 |
| Magnetic constant (permeability of free space). | |
| const double | epsilon_0 = 8.854e-12 |
| Electric constant (permittivity of free space). | |
| const double | gamma_num = 0.5772156649 |
| Euler-Mascheroni constant. | |
Implementation of Standard numeric constants and matrix utility functions.
|
extern |
Extracts a block (submatrix) from a given matrix.
Extracts a rectangular sub-block from a complex matrix.
| Y | The source matrix. |
| r_off | The starting row index of the block. |
| c_off | The starting column index of the block. |
| r_num | The number of rows in the block. |
| c_num | The number of columns in the block. |
References j.
Referenced by Element::apply_transformation().
| vector< vector< complex< double > > > mat_add | ( | const vector< vector< complex< double > > > & | A, |
| const vector< vector< complex< double > > > & | B | ||
| ) |
Adds two matrices of the same dimensions.
Element-wise addition of two complex matrices.
| A | The first matrix. |
| B | The second matrix. |
References j.
Referenced by Element::apply_transformation().
| vector< vector< complex< double > > > mat_mul | ( | const vector< vector< complex< double > > > & | A, |
| const vector< vector< complex< double > > > & | B | ||
| ) |
Multiplies two matrices represented as 2D vectors.
Complex matrix multiplication using nested vectors.
| A | The left-hand side matrix. |
| B | The right-hand side matrix. |
| std::runtime_error | if matrix dimensions are incompatible for multiplication. |
References j.
Referenced by Element::apply_transformation().
| vector< vector< complex< double > > > mat_sub | ( | const vector< vector< complex< double > > > & | A, |
| const vector< vector< complex< double > > > & | B | ||
| ) |
Subtracts one matrix from another.
Element-wise subtraction of two complex matrices.
| A | The matrix from which to subtract. |
| B | The matrix to subtract. |
References j.
| vector< vector< complex< double > > > mat_transpose | ( | const vector< vector< complex< double > > > & | A | ) |
Transposes a matrix.
Transposes a complex matrix stored as nested vectors.
| A | The matrix to transpose. |
References j.
Referenced by Element::apply_transformation().
| vector< vector< complex< double > > > matrixToVector | ( | const MatrixXcd & | mat | ) |
Converts an Eigen matrix of complex numbers to a 2D vector.
Converts an Eigen MatrixXcd to a nested complex vector.
| mat | The input Eigen::MatrixXcd. |
References j.
Referenced by Converter::plotParticipationFactors().
| vector< vector< double > > matrixToVector | ( | const MatrixXd & | mat | ) |
Converts an Eigen MatrixXd to a nested real vector.
| mat | Input real matrix. |
References j.
| vector< vector< complex< double > > > mul_scalar | ( | const vector< vector< complex< double > > > & | A, |
| const complex< double > & | scalar | ||
| ) |
Multiplies a matrix by a scalar value.
Scales every entry of a complex matrix by a scalar.
| A | The matrix to be multiplied. |
| scalar | The complex scalar value. |
References j.
Referenced by Element::apply_transformation().
| int sgn | ( | int | v | ) |
Computes the sign of an integer.
Returns the sign of an integer.
| v | The integer value. |
Referenced by dq_multiply().
| MatrixXcd stack_u_4x_3xN | ( | const MatrixXcd & | u1, |
| const MatrixXcd & | u2, | ||
| const MatrixXcd & | u3, | ||
| const MatrixXcd & | u4 | ||
| ) |
Stacks four input matrices into a single block column.
| u1 | First input block. |
| u2 | Second input block. |
| u3 | Third input block. |
| u4 | Fourth input block. |
| MatrixXcd vectorToMatrix | ( | const vector< vector< complex< double > > > & | vec | ) |
Converts a 2D vector of complex numbers to an Eigen matrix.
Converts a nested complex vector to an Eigen MatrixXcd.
| vec | The input 2D vector (matrix). |
| std::runtime_error | if the inner vectors have inconsistent lengths. |
References j.
Referenced by StabilityEstimate::compute_transfer_function(), example_MMC(), and example_stability_check().
| MatrixXd vectorToMatrix | ( | const vector< vector< double > > & | vec | ) |
Converts a 2D vector of complex numbers to an Eigen matrix.
Converts a nested real vector to an Eigen MatrixXd.
| vec | The input 2D vector (matrix). |
| std::runtime_error | if the inner vectors have inconsistent lengths. |
References j.
| const double epsilon_0 = 8.854e-12 |
Electric constant (permittivity of free space).
Vacuum permittivity (F/m).
Referenced by Cable::Cable(), and Overhead_Line::Overhead_Line().
| const double gamma_num = 0.5772156649 |
| const double mu_0 = 4 * M_PI * 1e-7 |
Magnetic constant (permeability of free space).
Vacuum permeability (H/m).
Referenced by Cable::Cable(), and Overhead_Line::Overhead_Line().