Add node objects to PowerElectronics module#367
Open
alexander-novo wants to merge 21 commits intodevelopfrom
Open
Add node objects to PowerElectronics module#367alexander-novo wants to merge 21 commits intodevelopfrom
alexander-novo wants to merge 21 commits intodevelopfrom
Conversation
also allows addings bus to system
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Partially addresses #353
Adds node objects to system so the system can calculate the optimal variable mappings itself. Right now, these node objects consist of:
Bus(single voltage bus)MicrogridBus(two voltage bus)InfiniteBus(single voltage reference bus)SignalNode(single-variable signal node)All of the
PowerElectronicsexamples have been updated to use these nodes, and there original logic for creating variable mappings has been removed. Since theRLCircuitexample didn't have the correct mapping, some of its variables have been re-arranged.As well, all component models included in these examples have been updated. Other component models can also be updated, since I feel fairly confident that I should be able to update them correctly... I just don't have tests to verify.
Proposed changes
Node objects work fairly similarly to components:
The system adds up the internal sizes for all of the nodes and components to get its own internal size, and then is able to form mappings for all of the node and component internal variables - putting the node variables at the end of the system vector for correct Jacobian sparsity.
Components with external variables take node pointers in their constructor, and in the
allocate()function will query the mapping of the node variables to properly construct the mapping for their own external variables. Reference variable mappings are also set here.Checklist
-Wall -Wpedantic -Wconversion -Wextra.Further comments