Message Boards Message Boards

0
|
8520 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

Use Wolfram Language functions in SystemModeler?

Posted 8 years ago

Like, I have defined a function in Mathematica, how can I export it as a component to SystemModeler?

Something similar to this: https://www.mathworks.com/help/simulink/ug/creating-an-example-model-that-uses-a-matlab-function-block.html

POSTED BY: Ox Clouding

The answer is that it depends on what you want to do. You can create systemmodeler blocks from Mathematica with WSMLink. Look at the documentation to see how to do this. You can build almost any systemmodeler-like block this way. If your function is an arbitrary function that you cannot formulate as a Systemmodeler block, (for example it relies on parts of the wolfram language such as pattern matching or other advanced functionality) then that is more difficult. Your options for that are to code it directly in modelica (the language behind systemmodeler) or export the function in C and call the C function in systemmodeler. If you describe your function I can better help guide you in the right direction.

POSTED BY: Neil Singer
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract