How to export simulation and use it in Python?

조회 수: 22 (최근 30일)
Jacob Spindler
Jacob Spindler 2020년 2월 14일
답변: Pratheek Punchathody 2021년 2월 17일
Hello =)
I´m trying to export a Simulink model and use it with python.
I have tried to export the model as a FMU with :
This is going well so far. The problem is that i cannot import this FMU in python. There always is an error:
The current platform (linux64) is not supported by the FMU.
So the problem is I build the FMU on a Windows Machine and want to use it on a linux machine.
Is there any way to build the FMU for linux, or maybe there are other solutions for exporting a Simulink model?
Regards, Jacob

답변 (1개)

Pratheek Punchathody
Pratheek Punchathody 2021년 2월 17일
Looks like you want to export the Simulink Model and import it into python.
Refer to the documentation on Export a Model as a Tool-Coupling FMU.
When a third-party tool runs the FMU, it checks out required licenses and starts a local installation of Simulink to start the model. Tool-coupling FMUs support fixed-step and variable-step solvers.
The exported FMU requires a local installation of Simulink to run. The MATLAB version used for co-simulation must be the same as the MATLAB version where the FMU is exported. On Windows®, the application that runs the FMU can check out the required licenses automatically. For other operating systems, apply these settings:
  • On Linux:
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:<InstallationFolder>/bin/glnxa64:<InstallationFolder>/extern/bin/glnxa64 (csh/tcsh)
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:<InstallationFolder>/bin/glnxa64:<InstallationFolder>/extern/bin/glnxa64 (bash)
Hope this helps

카테고리

Help CenterFile Exchange에서 Create Standalone FMU에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by