Are S-Functions compatible with Simscape or other Physical Modeling Tools?

5 views (last 30 days)
I would like to develop my own custom blocks to interact with SimScape blocks and associated physical modeling tools (SimMechanics, SimHydraulics, etc). I would like to know if S-Functions can be written to work with these products.

Accepted Answer

Steve Miller
Steve Miller on 13 Dec 2018
Edited: MathWorks Support Team on 17 Nov 2022
You can connect blocks created from S-Functions to Simscape networks. The interface is done via Simulink signals. This will be OK for certain types of models or effects (calculating a spring force, for example). For others, it will introduce an algebraic loop which you will have to break using a transfer function or a unit delay.
If at all possible, you should consider using the Simscape language or assembling your component from the Foundation library. This will ensure you have a block that can be easily connected into your physical model, will permit Simscape to use symbolic methods to reduce the equations, and provide good diagnostics during simulation.
You can find out more about the Simscape Language here:
--Steve

More Answers (0)

Categories

Find more on Physical Units in Help Center and File Exchange

Tags

No tags entered yet.

Community Treasure Hunt

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

Start Hunting!