51 const Eigen::MatrixXcd*
Y =
nullptr;
52 const Eigen::MatrixXd*
G =
nullptr;
53 const Eigen::MatrixXd*
B =
nullptr;
56 Eigen::VectorXd*
V =
nullptr;
57 Eigen::VectorXd*
delta =
nullptr;
64 const Eigen::VectorXd*
P =
nullptr;
65 const Eigen::VectorXd*
Q =
nullptr;
98 virtual void onIteration(
const char* solverName,
int iter,
int maxIter,
double error,
double tolerance) = 0;
101 virtual void onFinished(
const char* solverName,
bool converged,
int iter,
int maxIter,
double error,
double tolerance) = 0;
104 virtual void onMessage(
const char* solverName,
const char* message) = 0;
129 virtual const char*
name()
const = 0;
Common interface for power-flow solvers.
virtual bool solve(SolverContext &ctx)=0
Run the power-flow solver using the given context.
virtual ~ISolver()=default
virtual const char * name() const =0
Human-readable solver name (e.g.
Sink for solver progress/diagnostics (Dependency Inversion / SRP).
virtual void onIteration(const char *solverName, int iter, int maxIter, double error, double tolerance)=0
Called after every iteration with the current error/tolerance.
virtual void onFinished(const char *solverName, bool converged, int iter, int maxIter, double error, double tolerance)=0
Called once after the iteration loop ends (converged or not).
virtual void onMessage(const char *solverName, const char *message)=0
Called for solver-specific diagnostic/warning messages (e.g.
virtual ~ISolverObserver()=default
Shared input/output parameters for power-flow solvers.
const Eigen::VectorXd * Q
Scheduled reactive power injections (Qg - Ql).
double tolerance
Convergence tolerance.
Eigen::VectorXd * V
Voltage magnitudes [p.u.].
const Eigen::MatrixXcd * Y
Bus admittance matrix (used by Gauss-Seidel).
const Eigen::VectorXd * P
Scheduled active power injections (Pg - Pl).
int maxIter
Maximum number of iterations.
int N
Total number of buses.
Eigen::VectorXd * delta
Voltage angles [rad].
const Eigen::MatrixXd * G
Conductance matrix (used by Newton-Raphson).
Eigen::VectorXi * type_bus
Bus type vector (1=Slack, 2=PV, 3=PQ).
class ISolverObserver * observer
Optional injected progress/log observer (DIP); nullptr = silent.
const Eigen::MatrixXd * B
Susceptance matrix (used by Newton-Raphson).
std::vector< std::pair< int, double > > * iterHistory
Optional iteration history sink.
int n_pq
Number of PQ buses (Newton-Raphson).
double omega
Relaxation coefficient (Gauss-Seidel only).
const std::vector< int > * pq_bus_id
0-based PQ bus indices (Newton-Raphson).