Skip to content

Refactor ideal transformer stamping using MNAStampUtils#476

Open
AnasBahr wants to merge 1 commit into
sogno-platform:masterfrom
AnasBahr:master
Open

Refactor ideal transformer stamping using MNAStampUtils#476
AnasBahr wants to merge 1 commit into
sogno-platform:masterfrom
AnasBahr:master

Conversation

@AnasBahr
Copy link
Copy Markdown

Implement stampIdealTransformer via MNAStampUtils

Summary

This PR refactors the ideal transformer implementation by introducing and using stampIdealTransformer from MNAStampUtils across DP, EMT, and SP models.

The goal is to remove duplicated manual stamping logic and unify transformer equations in a single reusable utility.


Changes

MNAStampUtils

  • Implemented stampIdealTransformerTemplate<T>
  • Supports:
    • Single-phase real
    • Single-phase complex
    • Three-phase real
  • Centralized ideal transformer stamping logic

DP_Ph1_Transformer

  • Replaced manual stamping with stampIdealTransformer

EMT_Ph3_Transformer

  • Replaced explicit 3-phase transformer equations with utility function

SP_Ph1_Transformer

  • Replaced manual transformer admittance stamping with stampIdealTransformer

Benefits

  • Removes duplicated transformer stamping code
  • Improves maintainability and consistency
  • Single source of truth for ideal transformer equations

@AnasBahr AnasBahr force-pushed the master branch 2 times, most recently from 187dfb9 to ed6fc1f Compare May 18, 2026 11:53
@georgii-tishenin georgii-tishenin self-requested a review May 18, 2026 12:33
Copy link
Copy Markdown
Contributor

@georgii-tishenin georgii-tishenin left a comment

Choose a reason for hiding this comment

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

Hi @AnasBahr , thanks for your PR. Some tests in Run pytest over all notebooks check are failing. Apparently, the result of ideal transformer stamping differs from what it was before. Can you investigate?

Signed-off-by: Anas Bahr <anas.bahr@rwth-aachen.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants