Event Cues + Branch Trips for more Diverse Simulations#382
Event Cues + Branch Trips for more Diverse Simulations#382
Conversation
PhilipFackler
left a comment
There was a problem hiding this comment.
This took me a while to think about. I kept thinking there has to be a better way to handle this. But honestly (like you mention yourself) until we have more complicated use-cases, we don't need a more complicated solution. This fits the current need quite well.
I like using the concept of "schedule" and moving toward being able to define actions generically on different components.
I have one true request and one subjective complaint. Respectively:
- The
SystemModelmemberby_id_needs a more descriptive name. - I don't like the word "cue" here. 😸 This is just preference, and I can easily live with it if it makes sense to everyone else. I would suggest "trigger" or "execute". 🤷 @pelesh thoughts?
Finally, since you are allowing for a case with multiple events at the same time point, you should document the fact that those must be listed consecutively. Maybe add some logic to check for this (or even sort the events with respect to time...). It would be good to have a helpful error when that mistake is made.
Not married to
We can let @pelesh choose!
Agree, I will do so once @pelesh gives feedback |
|
Having branch faults implemented would be a valuable feature. Thank you, @lukelowry! As for the earlier questions, my recommendation would be to have two configuration files: model and simulation. Model would describe a grid (and that is already documented and implemented in GridKit), while the simulation file would describe solver settings, simulation time, events, etc. I think "event" is the most commonly used name for what is described in this PR as "cue". Given the scope of changes here, my recommendation would be to have documentation-only PR first, and then make changes to the code in a follow on PR. I think we first need to decide how we implement faults and then modify bus faults (if necessary) and add branch faults. |
pelesh
left a comment
There was a problem hiding this comment.
For a more agile review I suggest we split this PR in documentation/specs and implementation PR, respectively.
I can get behind this. I will break this into two ASAP Also, just to clarify, the event type I added is not a Branch fault (tho that would be easy to add, now). It's a line opening and closing, which is different from a branch fault. Doing documentation first will help with clarification! |
|
I suggest we set this to draft for now. This idea might need more offline discussion. |
Description
After some reflection, I think it is wise to model events as a typed
Actionperformed on aComponent, much likeBusFaultis implemented now.Componentclass can perform anAction, which is expressed by the implementation of the interfaceapply(Action).SystemModelcues a targetComponentto perform saidActionby invokingsys->cue(target, action)target->apply(Action).Studyis a timed sequence ofCues andComponenttargets.For every event I can consider, this is very intuitive (i.e.,
FaultaBus,FaultaBranch,Close/OpenaBranch,Oscillatea machine (forced oscillation),RampaSignal, etc.).Proposed changes
SystemModelno longer treatsBusFaultsas a special set of components. In the future, we should probably makeFaultorFaultableand interface so thatBusandBranchcan implement, so there is no need for a dedicatedBusFaultcomponent.READMEforPDSimwhich details the proposed*.study.jsonschema.Checklist
-Wall -Wpedantic -Wconversion -Wextra.Further comments
Nice to have before we merge #374 so that we can do more diverse studies and non-fault events!
A stepping stone toward a more general solution to #377.