Replies: 6 comments 5 replies
-
Welcome, @piotre13! HELICS doesn't directly provide the fine-grained timing control to manage the data exchanges your envisioning at a single point in simulated time. There are two work-arounds I can imagine:
Regarding a "standardized taxonomy to categorize this kind of situation", I'm not clear what you're referring to, specifically. Do you mean some kind of notation or language that describes the data exchange graph? I happy to discuss more if you want to clarify. |
Beta Was this translation helpful? Give feedback.
-
In general HELICS is designed to handle a wide assortment of timing and data patterns. Giving the user a lot of flexibility in how they manage the timing. There is no requirement that each federate use the same timing. So in the case you described above. @trevorhardy highlighted a few of the capabilities. You could set C to run on time steps just before A and B. Then set B to (wait_for_current_time_update). And iterate A twice to calculate each desired parameter. You have a cycle between A and B so you can't use the wait flag on both. This is probably what I would do first since C is a source only. Sounds like A would need to iterate regardless. There is a no "taxonomy" definition that HELICS could use since the timing is near infinitely flexible and each federate has independent control of its own timing. Ordering taxonomies such as used in FMI or some other standards can be fit into the timing systems in HELICS, but they are subsets of what is possible, so it hasn't been productive to try to put any rigorous definitions to interfederate timing in HELICS. There are times when rigor is useful, others when it isn't. |
Beta Was this translation helpful? Give feedback.
-
Dear @trevorhardy and @phlptp firstly thanks a lot for the prompt response! It is completely clear now what i can do to model this kind of data exchange. In my experience I've encountered a lot of models behaving like the example i've given. That's the reason of my second question on taxonomy, my curiosity was less related to helics itself but more on the theoretic aspects behind simulation and co-simulation. Thus, if you want, i would like to discuss a little bit more about theory. I've seen that simulation models (SU) can be categorized in many different ways based on different viewpoints e.g. the time advancement(1,2), thus i was wandering if you have any suggestion or knowledge on how to classify simulators based on their data exchange workflow. It seems to me that the example i've made advances regularly in time but also need some kind of event (the reception of a sequence of inputs) to perform, so also the time advancement classification of this it is a bit unclear in my mind. If you have any references to suggest for better understanding co-simulation and simulation world I would be grateful. Thanks a lot for the patience, but I'm really interested on this platform and the related principles behind co-simulation. Finally I have a last curiosity that yopu can ignore if it is already too much: |
Beta Was this translation helpful? Give feedback.
-
When we were designing the mechanics of HELICS we did dive into some of the theoretical considerations. What we ended up rapidly running into was the practical realities of trying to connect different simulators together really lend itself to being composed in a single theoretic model. Especially when considering the coupling of event driven simulations with regular time stepped simulators such as is seen when coupling a communication simulator like NS-3 with a power flow model. I do however believe that now that we have the nuts and bolts mostly figured out there is room for more rigor and theoretic considerations. The main way we broke things down in HELICS was two models. The first being a value federate where real values (including units and data types ) are exchanged in a publish and subscribe mechanism. In this model the values have persistence and only a single value is valid at any given time. The second being packet/event driven mimicking packet based communication networks. In this model data being exchanged is packetized and queued, and can thus be delayed, modified, rerouted while in flight, and multiple packets can be sent in a given timestep. These systems can interact in any given cosimulation but it is useful to think of them separately. When I give tutorials I usually break co-simulations approaches into two different mechanics. A master/client approach or a library approach. Which basically comes down to who has control of primary execution. In the master/client approach you can make certain assumptions about the components/ force them into certain modes of operation, and do a lot of fancy things with ordering, and timing. But it is a lot of work to get certain simulators into that approach, and then you are stuck using that master engine. HELICS chose the library approach which allows a lot more flexibility on the part of federates, but may trade off pure performance in certain situations and more complex internal mechanics. On you last question, if I wanted to do that I would either capture the values in an endpoint. or data sink, which means they are queued and I have to interpret them manually, or use a microfederate which matches the more frequent time steps and just maintains a running average or just publishes every 15 minutes, then subscribe the slower one to that publication. I have had several situations where a single main federate had a bunch of smaller federates doing measurement computations or other small such things, and with hierarchical communications don't really add much to the overhead. |
Beta Was this translation helpful? Give feedback.
-
Thanks a lot for your precious answers and consideration, I appreciate that. I will take advantage of this discussion thread to ask another question if it is ok. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Dear all, I'm new to helics and i want to understand how can i perform the following cosimulation:
The cosimulation workflows should folow a precise order during a single timestep which is:
C sends T_ext to both A and B, A calculate a P_demand and sends it to B, B uses P_demand calculate P_actual and sends it back to A, A receives P_Actual calculate T_in and publishes it.
my questions are mainly two:
Thanks a lot
Beta Was this translation helpful? Give feedback.
All reactions