Group Abstract Group Abstract

Message Boards Message Boards

0
|
7.8K Views
|
5 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Using WSMLink for simulation of Modelica generating wrong file paths

Posted 12 years ago

Hello,

I used WSMLink to simulate modelica model from Mathematica. However, The simulation settings file (.sim) is generating wrong filePath and resultFilePath.

See an example below.

 <?xml version="1.0"?>
 <!DOCTYPE simulation>
 <simulation version="1.0"
    name="BouncingBall"
    start="0."
    end="10."
    stepSize="0"
    outputSteps="-1"
    tolerance="1.e-6"
    method="dassl"
    filePath="BouncingBall.exe"
    resultFilePath="BouncingBall.mat">

From the above resultfilePath is " BouncingBall.mat" .However, The actual result file is "32608BouncingBall_1.mat"

Why resultfilePath refers to the " BouncingBall.mat" while the generated file is with file name "32608BouncingBall_1.mat"?

The Simulation settings file generated is also attached below.

Attachments:
POSTED BY: Alachew Mengist
5 Replies

As noted in the other thread ( http://community.wolfram.com/groups/-/m/t/339700?p_p_auth=q7hVqLPX ), if you are using version 3 there is no way to specify or retrieve the name of the result file.

You can continue using the functionality in WSMLink to read data from the simulation result, see WSMSimulationData documentation: http://reference.wolfram.com/system-modeler/WSMLink/ref/WSMSimulationData.html

POSTED BY: Malte Lenz
Posted 12 years ago
Attachments:
POSTED BY: Alachew Mengist
POSTED BY: Malte Lenz
Posted 12 years ago

Hi,

I want to simulate and plot a modelica model via pythonica (Python package for the sane interface between Mathematica and python via mathlink).

Here is the pseudocode

   import pythoinica
   m = pythonica.Pythonica()
   m.eval('Needs["WSMLink`"]')
   m.eval('Import["' + mofile + '",{"ModelicaModel"}]')
   res = m.eval('WSMSimulate["' + self.name + '",{' + str('0') + str(',') + str('10')+ '} ]')

It worked fine and generates the result file, simulation settings and simulation executable. However I want to read the result file , load it and create a plot.

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