deltaFlow
GaussSeidel.H
Go to the documentation of this file.
1/*
2 * Copyright (c) 2024 Saud Zahir
3 *
4 * This file is part of deltaFlow.
5 *
6 * deltaFlow is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public
8 * License as published by the Free Software Foundation; either
9 * version 3 of the License, or (at your option) any later version.
10 *
11 * deltaFlow is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public
17 * License along with deltaFlow. If not, see
18 * <https://www.gnu.org/licenses/>.
19 */
20
72#ifndef GAUSS_SEIDEL_H
73#define GAUSS_SEIDEL_H
74
75#include <Eigen/Dense>
76#include <utility>
77#include <vector>
78
79#include "ISolver.H"
80
88class GaussSeidel final : public ISolver {
89 public:
95 bool solve(SolverContext& ctx) override;
96
97 const char* name() const override { return "Gauss-Seidel"; }
98
116 static bool run(
117 const Eigen::MatrixXcd& Y,
118 Eigen::VectorXd& V,
119 Eigen::VectorXd& delta,
120 const Eigen::VectorXi& type_bus,
121 const Eigen::VectorXd& P,
122 const Eigen::VectorXd& Q,
123 int N,
124 int maxIter = 1024,
125 double tolerance = 1E-8,
126 double omega = 1.0,
127 std::vector<std::pair<int, double>>* iterHistory = nullptr,
128 ISolverObserver* observer = nullptr
129 );
130};
131
132#endif
Abstraction over power-flow solvers (Open/Closed Principle).
Gauss-Seidel power flow solver implementing the ISolver interface.
Definition GaussSeidel.H:88
const char * name() const override
Human-readable solver name (e.g.
Definition GaussSeidel.H:97
static bool run(const Eigen::MatrixXcd &Y, Eigen::VectorXd &V, Eigen::VectorXd &delta, const Eigen::VectorXi &type_bus, const Eigen::VectorXd &P, const Eigen::VectorXd &Q, int N, int maxIter=1024, double tolerance=1E-8, double omega=1.0, std::vector< std::pair< int, double > > *iterHistory=nullptr, ISolverObserver *observer=nullptr)
Solves the power flow equations using the Gauss-Seidel iterative method.
Definition GaussSeidel.C:50
bool solve(SolverContext &ctx) override
Run the Gauss-Seidel solver using the given context.
Definition GaussSeidel.C:33
Common interface for power-flow solvers.
Definition ISolver.H:115
Sink for solver progress/diagnostics (Dependency Inversion / SRP).
Definition ISolver.H:93
Shared input/output parameters for power-flow solvers.
Definition ISolver.H:49