- 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 ?
13 次查看(过去 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!
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!