Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linear SSN #175

Draft
wants to merge 34 commits into
base: master
Choose a base branch
from
Draft

Linear SSN #175

wants to merge 34 commits into from

Conversation

dinkelbachjan
Copy link
Contributor

@dinkelbachjan dinkelbachjan commented Jan 17, 2023

This branch focusses on the implementation of a State Space Nodal (SSN) simulation approach for real time analysis within the EMT domain limited to linear components. The approach is based on the paper “A Combined State-Space Nodal Method for the Simulation of Power System Transients” ,doi: 10.1109/TPWRD.2010.2090364 of Dufour et al. .

Linear State Space Nodal models of basic components and linear circuits like an RLC circuit are implemented as single SSN components. To achieve this a state space representation for the electrical element or circuit is derived. Those equations are discretized using the trapezoidal rule of integration. The system of linear equations is manipulated such that current states in the output equations of the state space model can be replaced with known terms, i.e. state values of the previous simulation step and input quantities. Previous states are additionally stored within the SSN component and updated when the system has been solved for the current time step. Now the output equations (nodal equations for V-Type SSN-Groups, mesh equations for I-Type SSN-Groups) can be used in the Modified Nodal Analysis approach by the already implemented stamping and task systems.

Because of that the simulation sequence and structure does not have to be changed for these components, only the used methods itself differ in the executed calculations and the quantity updates for the internally stored states.

Regarding general changes not limited to the SSN approach, a setter method (setParameters) has been added for the Ph3::CurrentSource. Furthermore, a Ph1::Switch was added together with a validation example testing the new component. Ph1::Switch, Ph1::CurrentSource and Ph3::CurrentSource were made usable within the pybind python module.

@sonarcloud
Copy link

sonarcloud bot commented May 22, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 59 Code Smells

0.0% 0.0% Coverage
22.3% 22.3% Duplication

Copy link
Contributor

@gnakti gnakti left a comment

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Double check/test if implementation of initializeFromNodesAndTerminals() is correct

Signed-off-by: Marvin Tollnitsch <marvin.tollnitsch@rwth-aachen.de>
…plementation for linear models; Added notebook to conduct the tests; modified dpsim- models/src/CMakeLists.txt to include SSN models of Ph1 -RLC and Ph3 -L,-C,-RLC models.

Signed-off-by: Marvin Tollnitsch <marvin.tollnitsch@rwth-aachen.de>
…ponents.h

Signed-off-by: Marvin Tollnitsch <marvin.tollnitsch@rwth-aachen.de>
… frequency and reference current.

Signed-off-by: Marvin Tollnitsch <marvin.tollnitsch@rwth-aachen.de>
Signed-off-by: Marvin Tollnitsch <marvin.tollnitsch@rwth-aachen.de>
Signed-off-by: Marvin Tollnitsch <marvin.tollnitsch@rwth-aachen.de>
Signed-off-by: Marvin Tollnitsch <marvin.tollnitsch@rwth-aachen.de>
Signed-off-by: Marvin Tollnitsch <marvin.tollnitsch@rwth-aachen.de>
Signed-off-by: Marvin Tollnitsch <marvin.tollnitsch@rwth-aachen.de>
Signed-off-by: Marvin Tollnitsch <marvin.tollnitsch@rwth-aachen.de>
Fixed duplicate Ph1 CurrentSource and added EMT::Ph1::Switch in EMTComponents.cpp for pybind

Signed-off-by: Marvin Tollnitsch <marvin.tollnitsch@rwth-aachen.de>
…lation

Signed-off-by: Marvin Tollnitsch <marvin.tollnitsch@rwth-aachen.de>
…n in the same simulated network. Network based on Dufour paper.

Signed-off-by: Marvin Tollnitsch <marvin.tollnitsch@rwth-aachen.de>
…uit to test the switch.

Signed-off-by: Marvin Tollnitsch <marvin.tollnitsch@rwth-aachen.de>
…tion to EigenSparse.

Signed-off-by: Marvin Tollnitsch <marvin.tollnitsch@rwth-aachen.de>
Signed-off-by: Marvin Tollnitsch <marvin.tollnitsch@rwth-aachen.de>
…nd RC modeled circuit.

Signed-off-by: Marvin Tollnitsch <marvin.tollnitsch@rwth-aachen.de>
Signed-off-by: Marvin Tollnitsch <marvin.tollnitsch@rwth-aachen.de>
Signed-off-by: Marvin Tollnitsch <marvin.tollnitsch@rwth-aachen.de>
Signed-off-by: Marvin Tollnitsch <marvin.tollnitsch@rwth-aachen.de>
…ents of SSN components to fit the new Task-System and matrix types. Adjusted logging to new convention (SPDLOG_LOGGER_INFO, SPDLOG_LOGGER_DEBUG). Components now inherit from MNASimPowerComp<>.

Signed-off-by: Marvin Tollnitsch <marvin.tollnitsch@rwth-aachen.de>
…ethod call of "Simulation" class instance with new "sim.set_direct_solver_implementation" method call. Minor Latex code correction.

Signed-off-by: Marvin Tollnitsch <marvin.tollnitsch@rwth-aachen.de>
… "Simulation" instance to new "set_direct_solver_implementation" method

Signed-off-by: Marvin Tollnitsch <marvin.tollnitsch@rwth-aachen.de>
Signed-off-by: Marvin Tollnitsch <marvin.tollnitsch@rwth-aachen.de>
notebook: EMT_Ph3_LinearSampleCircuitSSN.ipynb
Signed-off-by: Marvin Tollnitsch <marvin.tollnitsch@rwth-aachen.de>
EMT_Ph1_SSN_DufourRLC.ipynb
*Variables of Plots/figures now have unique names

EMT_Ph1_SSN_RLC.ipynb
*Set logging directory

EMT_Ph1_Switch_R1.ipynb; EMT_Ph3_LinearSampleCircuitSSN.ipynb
*Fixed dpsim subprocess path for example circuit executable
*removed duplicate module imports
*Fixed logfile path

EMT_Ph3_LinearSampleCircuitSSN.cpp; EMT_Ph3_LinearSampleCircuit.cpp
*Moved setLogDir call to logging section

EMT_Ph1_Switch_R1.cpp
*Set logging directory

Signed-off-by: Marvin Tollnitsch <marvin.tollnitsch@rwth-aachen.de>
Signed-off-by: Marvin Tollnitsch <marvin.tollnitsch@rwth-aachen.de>
Signed-off-by: Marvin Tollnitsch <marvin.tollnitsch@rwth-aachen.de>
Signed-off-by: Marvin Tollnitsch <marvin.tollnitsch@rwth-aachen.de>
Signed-off-by: Marvin Tollnitsch <marvin.tollnitsch@rwth-aachen.de>
Notebook contains two example circuits, but only one can be executed in the associated cpp files. Setting old example plot cells as comments.

Signed-off-by: Marvin Tollnitsch <marvin.tollnitsch@rwth-aachen.de>
- remove commented code and adjust parameter names for "setParameters" in "EMT_Ph3_CurrentSource.cpp"
- rename member variables in SSN components (camel-casing, 'm'-prefix)
- change access specifiers from protected to private for SSN component attributes and "ssnUpdateState()"
- remove "isLinear()" for linear SSN components
- set linear SSN component classes as final

Signed-off-by: Marvin Tollnitsch <marvin.tollnitsch@rwth-aachen.de>
Copy link

sonarcloud bot commented May 21, 2024

- changed local conductance variables in matrix stamping methods from a fixed size matrix with only one entry to 'Real'

- fixed conductance calculation being wrongly based on 'mIsClosed' instead of the parameter 'closed' now in 'mnaCompApplySwitchSystemMatrixStamp'

Signed-off-by: Marvin Tollnitsch <marvin.tollnitsch@rwth-aachen.de>
@georgii-tishenin georgii-tishenin marked this pull request as draft June 27, 2024 08:31
Copy link

sonarcloud bot commented Jun 27, 2024

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
Status: Ready for Review
Development

Successfully merging this pull request may close these issues.

None yet

4 participants