how to export data from matlab to open modelica

99 Views Asked by At

I have a simscape model and a similar model in open modelica. I need to compare the results from both these models i.e. plot the results of the two models on the same plot/graph and compare the results. I would like to know how can I do this? How can I export my simscape results to open modelica and plot them on the same graph.

Is there any command that will help me read matlab files which contains the results of my simscape model and plot them in open modelica?

1

There are 1 best solutions below

0
On

OpenModelica can understand results files containing time series in two formats:

  1. Comma-separated values (CSV), so something like

    time,var1,var2
    0,1,2.0
    0.1,2,3.0
    0.2,3,4.0
    0.3,4,5.0
    
  2. Matlab MATv4 files, see the OpenModelica User's Guide for implementation details.

Open a result file in OMEdit: File->Open Result File(s) and navigate to your .csv or .mat file.

If Simscape can't output result files in the MATv4 format try CSV files. If that isn't an output option for Simscape there are plenty of tools available to convert MAT/HDF5 to CSV files, e.g. Pandas in Python.