# Can Wolfram System Modeler models be published in CDFs?

Is it possible to publish or distribute Models generated with WSM in CDF format (to interested people that do not have Mathematica and/or WSM)

• What do you want to publish? Results? The model diagram? A model and a way to solve it? – jrhodin Nov 1 '12 at 13:46

Disclaimer: I work on Wolfram SystemModeler at Wolfram Research

As of Mathematica 11.3 you can distribute Modelica models and accompanying simulation/analysis code to other users with access to Mathematica. They will be able to simulate and use the full system modeling features available in Wolfram Language.

If you want to distribute a single file, a trick to include the actual model in the notebook is using Iconize and ImportString:

Use Iconize on the underlying Modelica for the model:

Iconize[SystemModel["YourModel"]["ModelicaString"]]


And in the notebook you want to distribute:

model = ImportString[<your iconized object>, "MO"]


If the model is part of a package, you need to call Iconize on the full package to include all the dependencies, not just the model itself.

I don't believe the CDF Player contains the system modeling features, so only people with a full Mathematica/Wolfram Desktop build will be able to run any notebooks/CDFs you distribute.

• Is it time to update this answer? Reading from blog.wolfram.com/2018/03/21/… it is now possible? – jrhodin Mar 30 '18 at 16:21
• @jrhodin I updated the answer to what is possible with the most recent Mathematica. – Malte Lenz Mar 30 '18 at 17:28
• Cloud/Mathematica Online would be a great solution for this, but unfortunately we don't have support for system modeling there yet (mostly because of security concerns). The best I can think of with the things available right now, would be to generate reports that show the analysis, including results, and distribute that as a "dead" CDF (the client wouldn't be able to evaluate or do their own analysis). Not an ideal situation, I know. – Malte Lenz Aug 30 '18 at 11:19
• That is indeed quite disappointing considering the price of those products. OpenModelica integrates with Python and Jupyter notebook, probably these alternatives are worth a look. If the deployment options do not greatly improve, I should start to bet some money against WRI's business model ... :-( – gwr Aug 30 '18 at 12:07
• Security is overrated in case of cloudMathematica. If it is just in an isolated virtual maachine there should be no real problem. And if it is used in an intranet I am sure WRI will provide finally a http - only version and then things would probably be even pretty fast. The cloud is the future. But yes, @gwr, the odds are that the technical advantage of WRI will melt away. But who knows. sometimes new versions of Wolfram products actually are pretty surprising ... – Rolf Mertig Aug 30 '18 at 20:25

No.

WSM models are Modelica files. Modelica is an open source language and you can run these files in other programs that evaluates Modelica code. This is the way you would share the models you produce in System Modeler.

• And that’s why having system modeler in a separate product, is not a good idea. The fact that Modelica is an open source language is no excuse for the fact that it can’t be interpreted by the Player. The way I read your answer is: not supported by CDF, you should try one of WR competitors (nothing against your answer; I’m just commenting on the current WSM business model). Just imagine if we could, with Mathematica, integrate a Modelica model into CDF, with all the easiness of Manipulate, and place it online... A true integration would be "groundbreaking". – P. Fonseca Nov 1 '12 at 15:29
• It would really really super difficult. But yeah. It would be cool. – Searke Nov 1 '12 at 16:02
• @Searke: why do you think it would be super difficult? Technically what P.Fonseca describes is basically already possible if you have both Mathematica and SystemModeler installed using WSMLink. I think the main reason that it's not built into Mathematica (and the free CDFPlayer) (yet?) is that WRI at this time doesn't want to give the SystemModeler functionality away for free -- which isn't such an unreasonable business model after all :-) – Albert Retey Nov 1 '12 at 21:56
• @P.Fonseca: you should note that among the competitors of WSM there are at least two open source projects. A large part of the motiviation to have an open standard as Modelica seems to be to have competition among tool providers. It's the quality and added functionalities of those tools that customers will pay for -- the pure capability of running Modelica files is available for free already. It will be interesting to see what WRIs strategy in such an environment which is very different from that of Mathematica is going to be, so we might see some surprises... – Albert Retey Nov 1 '12 at 22:12
• @AlbertRetey I know about the free alternatives, and to my knowledge, they don't have a browser cdf kind of plugin (I'm just now getting into this subject, so I may be wrong). Also, with all of Mathematica background, it shouldn't be too hard to find true integration advantages hard to beat. So the key word is "integrate". That doesn't mean that we don't pay extra for the extra functionality, but it means that Mathematica interface needs to get pushed up to a point where WSM interface becomes first nature on the notebook (how else can you convince that Mathematica is ready for app production?) – P. Fonseca Nov 1 '12 at 23:31