Skip to content

Feat: Implemented SSN_SynchronGenerator - #588

Open
matthiasmees wants to merge 4 commits into
sogno-platform:masterfrom
matthiasmees:SSN_development
Open

Feat: Implemented SSN_SynchronGenerator#588
matthiasmees wants to merge 4 commits into
sogno-platform:masterfrom
matthiasmees:SSN_development

Conversation

@matthiasmees

Copy link
Copy Markdown
Contributor

Signed-off-by: matthiasmees <matthias.mees@rwth-aachen.de>
Signed-off-by: matthiasmees <matthias.mees@rwth-aachen.de>
@matthiasmees matthiasmees self-assigned this Jul 21, 2026
@matthiasmees matthiasmees added the enhancement New feature or request label Jul 21, 2026
Signed-off-by: matthiasmees <matthias.mees@rwth-aachen.de>
Signed-off-by: matthiasmees <matthias.mees@rwth-aachen.de>
@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.75426% with 38 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.60%. Comparing base (a0173dd) to head (04a9fe8).

Files with missing lines Patch % Lines
...odels/src/EMT/EMT_Ph3_SSN_SynchronousGenerator.cpp 89.97% 36 Missing ⚠️
...psim-models/EMT/EMT_Ph3_SSN_SynchronousGenerator.h 0.00% 1 Missing ⚠️
dpsim/src/pybind/EMTComponents.cpp 98.03% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #588      +/-   ##
==========================================
+ Coverage   71.59%   71.60%   +0.01%     
==========================================
  Files         484      486       +2     
  Lines       30915    31326     +411     
  Branches    16414    16699     +285     
==========================================
+ Hits        22133    22432     +299     
- Misses       8781     8809      +28     
- Partials        1       85      +84     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@georgii-tishenin georgii-tishenin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @matthiasmees. Really nice work!
I left a few comments I wanted to discuss before merging (does not mean that needs to be addressed in this PR)


// Preserve the initial operating-point metadata used by the component.
generator->terminal(1)->setPower(
Complex(-generatedActivePower, -generatedReactivePower));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to take note (does not need to be solved in this PR).
We need to harmonize the SSN generator and SP::Ph1::SynchronGenerator, so that we can initialize SSN generator, like in this example: https://github.com/sogno-platform/dpsim/blob/master/dpsim/examples/cxx/Circuits/DP_Ph1_IEEE9_4Order.cpp

As I understand the problem, the SystemTopology::initWithPowerflow() finds the dynamic component with the same name and always writes the solved generator power to comp->terminals()[0]
While we connect the new generator as generator->connect({EMT::SimNode::GND, nMachine});

And the initialization of SSN generator uses const Complex targetPower = terminal(1)->singlePower();


void EMT::Ph3::SSN_SynchronousGenerator::setFieldVoltage(Real fieldVoltage) {
mFieldVoltage = fieldVoltage;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to be set in setParameters(). Is there a need for setting this separately?

Also this field voltage is more like initial guess for the iterative initialization, right? Then gets overwritten in initializeFromNodesAndTerminals()? Maybe we can point that out somehow, e.g. name the argument fieldVoltageInitialGuess?

Real mechanicalTorque) {
mMechanicalTorque = mechanicalTorque;
mAutoInitializeMechanicalTorque = false;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here: both parameters are set in setParameters(). Do we need an extra function for that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants