Coder Social home page Coder Social logo

Comments (4)

JTS22 avatar JTS22 commented on July 18, 2024

Classes which include subcomponents (changes in #141):

Class Uses mSubComponents Pre- and Post-step called by parent? Parent calls Pre- and Post-steps via mSubComponents? Remarks
DP_Ph1_AvVoltageSourceInverterDQ yes yes yes -
DP_Ph1_NetworkInjection yes yes yes -
DP_Ph1_PiLine yes yes yes changed to utilize mSubComponents
DP_Ph1_PQLoadCS yes yes yes changed to utilize mSubComponents and to call subtasks in parent task
DP_Ph1_RxLine yes yes yes changed to utilize mSubComponents and to call subtasks in parent task
DP_Ph1_RxLoad yes yes yes changed to utilize mSubComponents
DP_Ph1_RxLoadSwitch yes yes yes changed to iterate over mSubComponents
DP_Ph1_SVC no yes no Class is malformed, should not compile. Not making any changes...
DP_Ph1_SynchronGeneratorIdeal yes yes yes changed to iterate over mSubComponents instead of only using comp. 0
DP_Ph1_SynchronGeneratorTrStab yes yes yes changed to utilize mSubComponents and to call subtasks in parent task
DP_Ph1_Transformer yes yes yes -
DP_Ph1_VoltageSourceRamp yes yes yes changed to utilize mSubComponents and to call subtasks in parent task. Also, why does this class exist at all? Can this not be handled by the normal VoltageSource + SignalGenerator?
EMT_Ph1_VoltageSourceRamp yes yes yes changed to utilize mSubComponents and to call subtasks in parent task. Also, why does this class exist at all? Can this not be handled by the normal VoltageSource + SignalGenerator?
EMT_Ph3_AvVoltageSourceInverterDQ yes yes yes -
EMT_Ph3_NetworkInjection yes yes yes -
EMT_Ph3_PiLine yes yes yes changed to utilize mSubComponents
EMT_Ph3_RxLine yes yes yes changed to utilize mSubComponents and to call subtasks in parent task
EMT_Ph3_RXLoad yes yes yes changed to utilize mSubComponents and to call subtasks in parent task
EMT_Ph3_SynchronGeneratorIdeal yes yes yes changed to loop over all subcomponents
EMT_Ph3_SynchronGeneratorTrStab yes yes yes changed to utilize mSubComponents and to call subtasks in parent task
EMT_Ph3_Transformer yes yes yes -
SP_Ph1_AvVoltageSourceInverterDQ yes yes yes -
SP_Ph1_Load yes yes yes changed to utilize mSubComponents and to call subtasks in parent task
SP_Ph1_NetworkInjection yes yes yes -
SP_Ph1_PiLine yes yes yes changed to utilize mSubComponents
SP_Ph1_RXLine yes yes yes changed to utilize mSubComponents and to call subtasks in parent task
SP_Ph1_SolidStateTransformer yes has no tasks has no tasks changed to add subcomponents into list
SP_Ph1_SynchronGeneratorTrStab yes yes yes changed to utilize mSubComponents and to call subtasks in parent task
SP_Ph1_Transformer yes yes yes -

from dpsim.

JTS22 avatar JTS22 commented on July 18, 2024

In addition to the changes made in #141, I propose another way to further unify the behavior of components with subcomponents: By creating a shared superclass MNASimPowerComp that is derived from both SimPowerComp and MNAInterface, it becomes possible to extract the various MNA method calls on the subcomponents into this common superclass. This means that the parent components only register their subcomponents once (e. g. through addMNASubComponent) and then only contain methods concerned with the MNA operations in the parent. The calls to the MNA methods of the child are handled by the superclass instead, drastically cutting down on the amount of duplicated code (especially the for (auto comp : mSubComponents) loop) in the parent classes. The MNAPreStep and MNAPostStep classes contained in almost all parent components can also be merged into the common superclass. A first working example of this can be found in #144 (Comparison with #141 in subcomponents...unify-mna-subcomponents).

from dpsim.

dinkelbachjan avatar dinkelbachjan commented on July 18, 2024

I would suggest that the new superclass is used only for components that are composed of subcomponents, e.g. PiLine, while the simple components, e.g. Inductor remain untouched. The new superclass could be explicitly called CompositePowerComp. It handles the adding of subcomponents and the collection/arrangement of their mnaPreStep and mnaPostStep methods as you described. Any additional functionalities brought by the composite component class can be encapsulated in mnaParentPreStep and mnaParentPostStep, which are methods offered by CompositePowerComp.

from dpsim.

dinkelbachjan avatar dinkelbachjan commented on July 18, 2024

@m-mirz We are thinking of inserting a new class CompositePowerComp as described above to unify the subcomponent handling. What do you think about that?

from dpsim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.