11 #include <dpsim-models/Base/Base_SynchronGenerator.h>
12 #include <dpsim-models/MNASimPowerComp.h>
13 #include <dpsim-models/Solver/MNAInterface.h>
27 Logger::Level logLevel = Logger::Level::off);
43 const std::vector<String> attrParamNames = {
44 "Rs",
"Ll",
"Ld",
"Lq",
"Ld_t",
"Ld_s",
45 "Lq_t",
"Lq_s",
"Td0_t",
"Td0_s",
"Tq0_t",
"Tq0_s"};
53 Real nomPower, Real nomVolt, Real nomFreq, Int poleNumber,
54 Real nomFieldCur, Real Rs, Real Ll, Real Lmd, Real Lmq, Real Rfd,
55 Real Llfd, Real Rkd, Real Llkd, Real Rkq1, Real Llkq1, Real Rkq2,
56 Real Llkq2, Real inertia, Real initActivePower, Real initReactivePower,
57 Real initTerminalVolt, Real initVoltAngle, Real initMechPower);
60 void setParametersOperationalPerUnit(Real nomPower, Real nomVolt,
61 Real nomFreq, Int poleNumber,
62 Real nomFieldCur, Real Rs, Real Ld,
63 Real Lq, Real Ld_t, Real Lq_t, Real Ld_s,
64 Real Lq_s, Real Ll, Real Td0_t,
65 Real Tq0_t, Real Td0_s, Real Tq0_s,
70 Real initTerminalVolt, Real initVoltAngle,
84 Real electricalTorque()
const;
86 Real rotationalSpeed()
const;
88 Real rotorPosition()
const;
91 void step(Matrix &voltage, Real time);
96 void mnaCompApplyRightSideVectorStamp(Matrix &rightVector)
override;
98 void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix)
override;
102 void mnaCompPostStep(Real time, Int timeStepCount,
108 AttributeBase::List &attributeDependencies,
109 AttributeBase::List &modifiedAttributes,
Base synchronous generator model.
Synchronous generator model in dq-reference frame.
void initialize(Matrix frequencies) override
Initialize components with correct network frequencies.
Matrix dq0ToAbcTransform(Real theta, Matrix &dq0)
Inverse Park transform as described in Krause.
virtual void mnaCompUpdateVoltage(const Matrix &leftVector) override
Retrieves calculated voltage from simulation for next step.
void applyParametersOperationalPerUnit()
Calculates fundamental from operational parameters and applies them to the model.
void initializeMatrixAndStates()
Initializes internal states and matrix.
void mnaCompAddPostStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes, Attribute< Matrix >::Ptr &leftVector) override
Add MNA post step dependencies.
void setInitialValues(Real initActivePower, Real initReactivePower, Real initTerminalVolt, Real initVoltAngle, Real initMechPower)
Initialize states according to desired initial electrical powerflow and mechanical input power.
Matrix mCompensationCurrent
Compensation current source set point.
void setParametersFundamentalPerUnit(Real nomPower, Real nomVolt, Real nomFreq, Int poleNumber, Real nomFieldCur, Real Rs, Real Ll, Real Lmd, Real Lmq, Real Rfd, Real Llfd, Real Rkd, Real Llkd, Real Rkq1, Real Llkq1, Real Rkq2, Real Llkq2, Real inertia, Real initActivePower, Real initReactivePower, Real initTerminalVolt, Real initVoltAngle, Real initMechPower)
Matrix abcToDq0Transform(Real theta, Matrix &abc)
Park transform as described in Krause.
void initializeFromNodesAndTerminals(Real frequency) override
Initializes component from power flow data.
void step(Matrix &voltage, Real time)
General step function for standalone simulation.
SynchronGeneratorDQ(String name, String uid, Logger::Level logLevel=Logger::Level::off)
Defines UID, name and logging level.
String uid()
Returns unique id.
Base class for all MNA components that are transmitting power.