6#include <dpsim/DirectLinearSolver.h>
7#include <dpsim/PFSolverPowerPolar.h>
36 CPS::Real timeStep, CPS::Logger::Level logLevel);
PFSolverPowerPolar(CPS::String name, const CPS::SystemTopology &system, CPS::Real timeStep, CPS::Logger::Level logLevel)
Constructor to be used in simulation examples.
std::shared_ptr< DirectLinearSolver > mLinearSolver
Direct linear solver reused across iterations (symbolic factorization computed once)
CPS::SparseMatrixRow mJsparse
Sparse Jacobian (row-major, fixed pattern, values updated in place each iteration)
bool isConnected(CPS::UInt k, CPS::UInt j)
Whether buses k and j are connected (off-diagonal Jacobian entry exists)
void setUpJacobianStorage() override
Build the fixed sparsity pattern, create the linear solver and analyze the pattern once.
std::vector< std::pair< CPS::UInt, CPS::UInt > > mVariableSystemMatrixEntries
Empty list: PF uses full refactorization, not partial refactorization.
void calculateJacobian() override
Fill the sparse Jacobian values in place (pattern unchanged)
PFSolverPowerPolarSparse(CPS::String name, const CPS::SystemTopology &system, CPS::Real timeStep, CPS::Logger::Level logLevel)
Constructor to be used in simulation examples.
void solveJacobianSystem() override
Factorize (first iteration of a run) or refactorize, then solve.
void buildJacobianPattern()
Construct the structural sparsity pattern of the Jacobian from the bus admittance matrix.