modelica / dcp-standard

Specification of the Distributed Co-Simulation Protocol (DCP)
https://www.dcp-standard.org
14 stars 3 forks source link

data exchange between two slaves are missing while reducing the time resolution #21

Closed sushil-bhatta closed 1 year ago

sushil-bhatta commented 1 year ago

Hi, i am trying to coupling two simulation tool with DCP methods. To understand DCP correctly, i was trying to run some examples (spring-damper-master/slaves) available in DCP source code. I found there, the time resolution for simulation is set up 100ms (numerator=1 and denominator=10). With this configuration every thing works fine. Then i treid to decrease the time resolution for simulation namely 10ms (numerator=1 and denominator=100), simulation ran perfectly. But afterwards i looked in to the output values, and found that the data are not sent correctly between these two slaves during simulation/running. In the doStep methods, some calculations are made in both slaves. The slave2 sends a variable (called Fc) in every doStep to the slave 1 (which is stored as Fe). If you look these attached screenshots, you can see the the slave 1 did not get the actual output (Fc) of slave2 in every doStep, while slave2 has calculated correctly. Often the slave1 has received the old output of slave2 and multiple times. However this behaviour is only, if i reduce the time resolution to 10ms. By time resolution of 100ms everything is fine (see attachment).

Figure 1: Output from doStep of slave2 with time resolution 10ms (numerator=1 and denominator=100)

slave2_10ms

Figure 2: Output from doStep of slave1 with time resolution 10ms (numerator=1 and denominator=100)

slave1_10ms

Figure 3: Output from doStep of slave2 with time resolution 100ms (numerator=1 and denominator=10)

slave2_100ms

Figure 4: Output from doStep of slave1 with time resolution 100ms (numerator=1 and denominator=10)

slave1_100ms

sushil-bhatta commented 1 year ago

I figured out, it lies on computational power of used computer.