- Open the library browser and insert the "FMU" block by navigating to Simulink Extras/FMU Import/FMU.
- Once inserted, double-click the block to access the block parameters
- Select the ".fmu" file that was exported using the “FMIExport.jl” package in the "FMU Name" parameter.
How do I export machine learning model as FMU with Julia and integrate it into Simulink model ?
14 ビュー (過去 30 日間)
古いコメントを表示
I'd like to create a AI model and export it as FMU file with Julia and integrate it into Simulink.
Have you ever tried this way?
If you don't mind, it'd be nice if you could give me how exactly you did it.
I tried to write Julia code to create a simple machine learning model and export it as FMU file with this Julia package.
Then I'm going to use this FMU import block
and integrate FMU of Julia model into Simulink like this example.
Best,
0 件のコメント
回答 (1 件)
Aravind
2024 年 10 月 16 日
I understand that you wish to use an FMU created from a Julia code in Simulink and that you are using the “FMIExport.jl” package to do so. I am assuming that you have used the “FMIExport.jl” Julia package to successfully export an FMU for the Julia code you have written. The “FMIExport.jl” package you mentioned is capable of exporting Julia code to Model Exchange FMUs with an FMI version 2.0. These Model Exchange FMUs do not contain the local solver utilized during export, and they can be brought into Simulink using the "FMU" block. This block accommodates FMI versions 1.0, 2.0, and 3.0 for both Model Exchange and Co-Simulation FMUs. You can find the official documentation for the "FMU" block at https://www.mathworks.com/help/simulink/ref_extras/fmu.html.
When you export an FMU using the “FMIExport.jl” package, a ".fmu" file is created. To import this file into Simulink, follow these steps:
This process will insert the FMU, which can then be simulated. If the FMU requires any inputs or outputs, the necessary ports will be automatically generated. You can connect the FMU block as you would with any standard Simulink block and proceed with the simulation.
Hope this helps!
2 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!