0
$\begingroup$

I have something like this in my notebook (SystemModeler is not running):

Needs["WSMLink`"]
SetDirectory[NotebookDirectory[]]
(* "F:\\WMath\\DCmotor" *)

model = "DCmotor";
WSMModelData[model, "Diagram"]

During evaluation WSMLink::nomod: The class DCmotor was not found. - !!!!!!

But when I run SystemModeler and only load my model everything is ok. That is not the case when I use models from SystemModeler examples. The question is: how to show Mathematica where my *.mo file is without launching SystemModeler?

$\endgroup$
1
  • $\begingroup$ Welcome to Mathematica.SE! I suggest that: 1) You take the introductory Tour now! 2) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! 3) As you receive help, try to give it too, by answering questions in your area of expertise. $\endgroup$
    – bbgodfrey
    Feb 24 '15 at 19:08
1
$\begingroup$

I finally found the solution! One must use Import[] function like this: Import[FileNameJoin[{NotebookDirectory[], "DCmotor.mo"}], "ModelicaModel"]. And all functions connected with SystemModeler (WSMModelData[] etc.) work fine in Mathematica without launching the SystemModeler application. But there is no description in Mathematica help about Import[] func - about the option "ModelicaModel". I found this in LEGOSegway - Wolfram SystemModeler example on the web.

$\endgroup$
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.