Export Simscape components to FMU

조회 수: 22 (최근 30일)
Christian Behr
Christian Behr 2023년 5월 16일
댓글: Venkatesh Venkadasamy 2024년 4월 25일
Hi,
I am currently trying to export single Simscape components as FMUs.
How do i create an interface to e.g. the physical water flow inside a pipe? I can only interface to Simulink signals, which can be converted to Simscape physical signals, but this doesn't help me. I need to create an interface directly to the specific Simscape domain, e.g. water, current, air,....
If i create PMC ports on root level, no interface is created for those in the FMU. There is barely any documentation on how to export Simscape models to FMU, especially single components.
I am aware I can export a whole Simscape model that later works as a black box and only interfaces via Simulink signals, but this doesn't help.
Best regards,
Christian

답변 (1개)

Karan Singh
Karan Singh 2023년 9월 4일
Hi Christian,
When exporting single Simscape components as FMUs, the interface is typically created through Simulink signals. However, if you need to create an interface directly to the specific Simscape domain, such as water flow in a pipe, you can use the Simscape Connector blocks.
The Simscape Connector blocks allow you to create custom interfaces for Simscape components. These blocks can be used to connect Simscape physical signals directly to the component, providing a more domain-specific interface.
You can follow the steps below to create an interface to the physical water flow inside a pipe using Simscape Connector blocks:
  1. Open your Simscape model and locate the pipe component you want to export as an FMU.
  2. Add a Simscape Connector block to the model. This block will serve as the interface for the water flow.
  3. Connect the Simscape Connector block to the appropriate ports of the pipe component. The specific connections will depend on the structure of your model and the desired interface.
  4. Configure the Simscape Connector block to match the physical domain and units of the water flow. You can set the port labels, units, and other properties in the block's dialog box.
Once you have created the desired interfaces using Simscape Connector" blocks, you can export the Simscape component as an FMU using the exportToFMU2CS function.
Attached below are some documentation links that you may find helpful:
Hope this helps!
  댓글 수: 1
Venkatesh Venkadasamy
Venkatesh Venkadasamy 2024년 4월 25일
I could fingure our the simscape connector block. Could you send me sample model?

댓글을 달려면 로그인하십시오.

카테고리

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