Linearize FMU model in Simulink
7 views (last 30 days)
Show older comments
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:
- I created a trivial Simulink model, and exported it in FMU format through the standard process.
- Imported the generated FMU in a new simulation, and compared it to the "source" model
- Comparison results in time-domain: same behaviour for source and FMU-exported model [correct, no issues].
- 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?
0 Comments
Answers (2)
Shivam Lahoti
on 10 Oct 2024
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.
0 Comments
Aravind
on 10 Oct 2024
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!
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!