Custom code inside model?

One of the great features in Simulink is how you can add blocks of custom MATLAB code that does something complex with simulation variables and outputs values as a result. I wonder if something similar is possible in SystemModeler?

For example, if I want to implement an optimal controller - so I would need to do numerical optimization at certain time steps… there isn’t a block for that in SystemModeler, but there is NMinimize in Mathematica and I’d like to write a code snippet that I can insert into my SystemModeler model that uses Nminimize. How is this possible? Thanks a lot!

This isn’t currently possible, but something we have been looking at offering for a future version of SystemModeler.

Your interest has been noted and will influence what we focus on going forward!