Fix EMT 3Ph Switch behaviour for Matrix Recomputation#419
Conversation
|
Hi @cwirtz-fgh, thanks for your contribution We can see that the results of the notebooks that use the results from the faults are having some errors in the value they use as comparison. Do you have an opinion or explanation for this? It looks like the value at the point where we assert is not near enough to zero, and before it was matching the tolerance. |
|
Seems to be an issue in the testcases with VBR which do a recomputation every timestep. With my proposed fix, the Switch is handled as an VariableComp as well as an SwitchComp and stamped twice in recomputeSystemMatrix - which seems to cause the issue. I will test this more thoroughly. |
|
Issue is confirmed in tests, calling mnaApplySystemMatrixStamp twice for the switch component changes the system matrix and causes this behaviour.
From my perspective option 2 is preferrable. Even though there is no testcase implemented for this, the problem should also affect varResSwitch, as this component has a switchComp as well as an varComp interface. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #419 +/- ##
==========================================
+ Coverage 65.71% 65.79% +0.07%
==========================================
Files 381 381
Lines 23418 23445 +27
Branches 11696 11698 +2
==========================================
+ Hits 15390 15425 +35
- Misses 7953 7976 +23
+ Partials 75 44 -31 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Hi @cwirtz-fgh! |
leonardocarreras
left a comment
There was a problem hiding this comment.
Thanks for the PR!
In general, the idea and implementation looks good to me.
What we could improve:
- Move the common code to Base class for single phase and three phase
- When moving, particularly the ones to move are the protected attribute holding the previous closed state and the new overriding function to determine change in parameters to the base class (as all switches are similar).
- Might be a nice extra to put a more meaningful name than
Bool mPrevStateto hold the closed status, for exampleBool mIsClosedPrev(this can also be something to refactor together at a later stage with all the other switches in the codebase that are currently using the same too)
74c644b to
4db66a6
Compare
|
Just as extra (but a bit old) context, we may also want to have a look at #59 to understand more what else could be impacted here and if this should be labeled as breaking, or if we have some transition with a "deprecated version". |
leonardocarreras
left a comment
There was a problem hiding this comment.
Looks good to me, might need rebasing
- all switches have hasComponentChanged functionality - in matrix recomputation case in mna solver, switch components are only restamped once with VarCompInterface Signed-off-by: cwirtz <christoph.wirtz@fgh-ma.de>
2edb082 to
3ff63fd
Compare
b57703f
into
sogno-platform:master
Uh oh!
There was an error while loading. Please reload this page.