Does Simulink execute connected FMU blocks in series or in parallel?
9 ビュー (過去 30 日間)
古いコメントを表示
MathWorks Support Team
2022 年 10 月 21 日
編集済み: MathWorks Support Team
2025 年 7 月 11 日
I have a model that uses two different functional mockup units (FMU), each with their own solver, in a Simulink model in release R2022a. The two FMU blocks are connected so that the output of the first block is the input of the second block. The output of the second block goes through a feedback loop to the input of the first block.
I wonder what type of resolution (time-marching) approach Simulink uses for these blocks: serial or parallel. These methods are also named Gauss-Seidel and Jacobi, respectively.
When solving the blocks following a Jacobi approach, blocks use the inputs at the start of the time step computation to calculate their outputs. The order in which outputs are computed does not matter.
When solving the blocks following a Gauss-Seidel approach, blocks are assigned an execution order and use the latest values computed in their input signals.
Whether the resolution method is Jacobi or Gauss-Seidel affects the numerical stability of my solution.
What method does Simulink use for my FMU blocks by default, and how can I change it to the other method?
採用された回答
MathWorks Support Team
2025 年 7 月 11 日
編集済み: MathWorks Support Team
2025 年 7 月 11 日
Functional mockup units in Simulink have a non-zero "Communication step size" that acts as a time delay between the FMU's inputs and outputs. For that reason, blocks executed downstream of an FMU cannot be executed following a perfect "Gauss-Seidel" approach. The execution of these blocks will be Jacobian with respect to the signals coming from the FMU block.
You may refer to the documentation about the
.
The blocks executed downstream of an FMU refer to the Simulink execution order.
As an example of this FMU behavior, imagine the following situation:
---------------------------------------
You have two FMUs, FMU A and FMU B. The Simulink solver has a step size of 0.1ms. The “communication step size” of the FMUs is also 0.1ms. The output of FMU A is the input of FMU B.
At time n, the input of FMU A is x1_n and the input of FMU B is x2_n. They will not output the result of these inputs at this time step, because they have a communication delay.
At time n+1, the output of FMU A is obtained from x1_n, so it is y1(x1_n). The output of FMU B is obtained from x2_n, so it is y2(x2_n). Also at that time, the input of FMU B is updated with the output of FMU A, so x2_(n+1) = y1(x1_n). And so on, the cycle continues.
This is a Jacobian approach. As you can see, FMU B is not using the value y1 at n+1 to compute its own value of y2 at n+1, which would be Gauss-Seidel. Note that both FMUs execute at every time step, because their communication step size is equal to the Simulink solver step size.
---------------------------------------
Generally, a Gauss-Seidel approach is more stable numerically. That is why Simulink FMU blocks have a feature named "Numerical compensation" to compensate for their intrinsic delay. The numerical compensation documentation is a useful resource, which also contains a relevant example of sequential communication between two FMUs.
In FMI 3.0, we have a direct-feedthrough support (to avoid delays) which resolves the limitation in FMI 2.0. This means that we can follow the Gauss-Seidel approach.
0 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!