33#pragma warning(disable: 4464 5031)
37#pragma clang system_header
40#include <Eigen/Geometry>
41#include <Eigen/Sparse>
148 void deployResults(
double* vals, std::vector<int>* removable_ids);
157 bool createEquationsNRmethod(
double*& eqs,
double*& vals, std::vector<int>* removable_ids);
166 bool createEquationNRmethod(
Node* node,
double* eqn,
double& val, std::vector<int>* removable_ids);
177 bool createEquation(
Element* vsource,
double* eqn,
double& val);
182 void removeColumn(Eigen::MatrixXd& matrix,
const int colToRemove);
189 bool solveEquationsNRmethod(
double* eqn,
double* vals, std::vector<int>*);
191 bool _solveNRmethod();
double getAlphaBest()
return alphaBest variable, the best alpha scaling value
std::vector< Node * > * nodes
std::vector< Element * > * getCurrentSources()
Node * addNode(std::string name)
double getVoltage(std::string name)
int getNumVoltageSources()
Element * addElement(std::string name, double value, Node *pNode, Node *nNode, Element::ElementType et)
void eraseNode(Node *node)
double getCurrent(std::string name)
Element * getElement(std::string name)
double circuitCurrentLimit
The electric current limit of the voltage sources.
double getTotalCurrentOfCircuitSources()
The sum of voltage source currents in the circuit.
void detectRemovableNodes(std::vector< int > *removable_ids)
double getCurrentLimit()
@ brief Get the electric current limit of this circuit.
std::vector< Element * > * elements
void replaceAndDeleteNode(Node *unusedNode, Node *newNode)
Element * getVoltageSource(int id)
double getTotalPowerOfCircuitSources()
The sum of voltage source powers in the circuit.
void deployResults(double *vals, std::vector< int > *removable_ids)
double getResistance(std::string name)
double alphaBest
Best alpha scaling value.
bool checkCircuit(std::string substationId="")
std::vector< Element * > * voltageSources
alphaFlag
Flag of alpha scaling parameter.
@ ALPHA_VOLTAGE_LIMITS
The scaling alpha is applied (is not one] due to voltage limits.
@ ALPHA_NOT_APPLIED
The scaling alpha is not applied (is one)
@ ALPHA_CURRENT_LIMITS
The scaling alpha is applied (is not one) due to current limits.
@ ALPHA_NOT_CONVERGING
The Newton-Rhapson method has reached maximum iterations and no solution of circuit has been found wi...
alphaFlag getAlphaReason()
return the reason why alpha scaling value has been used
Node * getNode(std::string name)
void setCurrentLimit(double myCurrentLimit)
Set the electric current limit of this circuit.
std::string & getCurrentsOfCircuitSource(std::string ¤ts)
List of currents of voltage sources as a string.
void eraseElement(Element *element)