Linearize FMU model in Simulink

조회 수: 6 (최근 30일)
Alberto
Alberto 2024년 10월 7일
답변: Aravind 2024년 10월 10일
Hello,
I'm exploring the FMU inport / export functionalities associated to Matalb / Simulink and their compatibility with other routines available in the MATLAB environment.
In particular:
  1. I created a trivial Simulink model, and exported it in FMU format through the standard process.
  2. Imported the generated FMU in a new simulation, and compared it to the "source" model
  3. Comparison results in time-domain: same behaviour for source and FMU-exported model [correct, no issues].
  4. Comparison results in frequency-domain (through the linearize command): FMU-exported model does not linearize properly.
Did anyone experienced the same issue? Any workaround on that?

답변 (2개)

Shivam Lahoti
Shivam Lahoti 2024년 10월 10일
Hi Alberto,
I understand you want to understand if import bock supports linearization of FMU models.
FMU import block supports Analytical Jacobian via reading directional derivatives from FMU file, so it should be able to support analytical linearization.
Jacobians are supported in FMI 2.0, as can be referred from the following documentation:
I hope this helps you understand more about the FMU import functionalities.
Regards,
Shivam.

Aravind
Aravind 2024년 10월 10일
I am experiencing the same issue in MATLAB R2024a. According to the official documentation for MATLAB R2024a, which you can find at: https://www.mathworks.com/help/releases/R2024a/slcompiler/ref/exporttofmu.html?s_tid=doc_ta#mw_eadb4e38-0958-4575-9679-97dc152747c4, the “FMU Builder for Simulink” add-on in this version can only export Co-Simulation FMUs. These FMUs include the local solver used during simulation when exporting the model to FMU format, which leads to incorrect linearization or linearization failure when using the “linearize” command, resulting in discrepancies in the frequency domain output.
Unfortunately, there is no workaround for this issue in MATLAB R2024a. However, as stated in the official documentation for MATLAB R2024b at: https://www.mathworks.com/help/slcompiler/ref/exporttofmu.html?s_tid=doc_ta#mw_eadb4e38-0958-4575-9679-97dc152747c4, the “FMU Builder for Simulink” add-on supports exporting to Model Exchange FMUs. These FMUs do not include the local solver used during export, which allows them to be properly linearized with the “linearize” command in MATLAB.
In MATLAB R2024b, you can export a Simulink model as a Model Exchange FMU by selecting the “Model Exchange” option in the “FMU Type” dropdown menu during the export process or by using the “exportToFMU” function with the “FMUType” option set to “ME,” as described in the documentation link.
Hope this helps!

제품


릴리스

R2024a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by