Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

Difference in results obtained from MAT and CSV output formats

Difference in results obtained from MAT and CSV output formats

Hi,
I was solving the DoublePendulum example in the Standard Library available in OpenModelica and found out that the results obtained by using the MAT output format is different from that obtained using CSV format. Why does this happen? Ideally the results obtained irrespective of the format should be same. Right? Is this a defect or its supposed to behave like this?

P.S. I havent changed any other parameters in the model. The difference is only with the output formats

Regards,
Sanjay

Re: Difference in results obtained from MAT and CSV output formats

The following tells me the files are the same...

Code:

loadModel(Modelica);getErrorString();

simulate(Modelica.Mechanics.MultiBody.Examples.Elementary.DoublePendulum,outputFormat="mat");getErrorString();
simulate(Modelica.Mechanics.MultiBody.Examples.Elementary.DoublePendulum,outputFormat="csv");getErrorString();
diffSimulationResults(
  "Modelica.Mechanics.MultiBody.Examples.Elementary.DoublePendulum_res.mat",
  "Modelica.Mechanics.MultiBody.Examples.Elementary.DoublePendulum_res.csv","diff",
  keepEqualResults=true);
getErrorString();

Which variables differ?

Re: Difference in results obtained from MAT and CSV output formats

Hi,

The variables that I plotted were boxBody1.frame_b.r_0[1], boxBody1.frame_b.r_0[2], boxBody2.frame_b.r_0[1] and boxBody2.frame_b.r_0[2]

Re: Difference in results obtained from MAT and CSV output formats

https://trac.openmodelica.org/OpenModelica/newticket - create one for OMEdit. The results in the files are identical. I suspect the csv-parsing routines in OMPlot don't handle variable names with commas in them...

Re: Difference in results obtained from MAT and CSV output formats

Were you able to see the difference in those 4 plots? Also I have noticed that the variable values do not get displayed in the variables browser for CSV and PLT formats. Why is it so?

There are 0 guests and 0 other users also viewing this topic
You are here: