Clear Filters
Clear Filters

Export Simscape components to FMU

30 views (last 30 days)
Christian Behr
Christian Behr on 16 May 2023
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

Answers (1)

Karan Singh
Karan Singh on 4 Sep 2023
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 Comment
Venkatesh Venkadasamy
Venkatesh Venkadasamy on 25 Apr 2024
I could fingure our the simscape connector block. Could you send me sample model?

Sign in to comment.

Categories

Find more on Equations in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!