![]() |
deltaFlow
|
Newton-Raphson power flow solver implementation. More...
#include <cmath>#include <limits>#include <iostream>#include <vector>#include "Logger.H"#include "NewtonRaphson.H"#include "Jacobian.H"#include "PowerMismatch.H"#include "Progress.H"#include "Data.H"#include "Utils.H"
Go to the source code of this file.
Functions | |
| bool | NewtonRaphson (const Eigen::MatrixXd &G, const Eigen::MatrixXd &B, const Eigen::VectorXd &Ps, const Eigen::VectorXd &Qs, Eigen::VectorXd &V, Eigen::VectorXd &delta, int n_bus, int n_pq, const std::vector< int > &pq_bus_id, int maxIter, double tolerance, std::vector< std::pair< int, double > > *iterHistory) |
| Solves the power flow equations using the Newton-Raphson iterative method. | |
Newton-Raphson power flow solver implementation.
Definition in file NewtonRaphson.C.
| bool NewtonRaphson | ( | const Eigen::MatrixXd & | G, |
| const Eigen::MatrixXd & | B, | ||
| const Eigen::VectorXd & | Ps, | ||
| const Eigen::VectorXd & | Qs, | ||
| Eigen::VectorXd & | V, | ||
| Eigen::VectorXd & | delta, | ||
| int | n_bus, | ||
| int | n_pq, | ||
| const std::vector< int > & | pq_bus_id, | ||
| int | maxIter = 1024, |
||
| double | tolerance = 1E-8, |
||
| std::vector< std::pair< int, double > > * | iterHistory = nullptr |
||
| ) |
Solves the power flow equations using the Newton-Raphson iterative method.
This is a pure solver function that takes G, B matrices, scheduled power, initial voltage/angle guesses, and bus classification. It modifies V and delta in-place.
| G | Conductance matrix (real part of $$ Y_{bus} $$). |
| B | Susceptance matrix (imaginary part of $$ Y_{bus} $$). |
| Ps | Scheduled active power injections (Pg - Pl) [p.u.]. |
| Qs | Scheduled reactive power injections (Qg - Ql) [p.u.]. |
| V | (in/out) Voltage magnitudes [p.u.]. |
| delta | (in/out) Voltage angles [rad]. |
| n_bus | Total number of buses. |
| n_pq | Number of PQ buses. |
| pq_bus_id | 0-based indices of PQ buses. |
| maxIter | Maximum number of iterations (default: 1024). |
| tolerance | Convergence tolerance for power mismatches (default: $$ 1 \times 10^{-8} $$). |
| iterHistory | Optional pointer to store iteration number and error at each step. |
Definition at line 39 of file NewtonRaphson.C.
References computeJacobian(), LOG_DEBUG, LOG_WARN, powerMismatch(), printConvergenceStatus(), and printIterationProgress().
