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
  • Index
  • » Users
  • » gabora
  • » Profile

Posts

Posts

Aug-24-11 14:14:18
Category: Programming

Okey, so I tried Dymole demo version and the same code works there. Any Idea?
Regards,

Gabora

Aug-24-11 00:38:42
Category: Programming

Hello!

Have somebody already used CombiTable1Ds  in OpenModelica with MATLAB .mat source? It works fine with tables as the documentation sais, but does not want to work with MATLAB source.

As in the documentation i saved a simple array using "save table1.mat tab1 -v4" command. The first coloumn was the time values (strictly monotinic) and the 2nd coloumn was some data.


The code in modelica:
model myModel
  import Modelica.Blocks.Tables;
  import Modelica.Blocks.Sources;
  import Modelica.Blocks.Types;
  Modelica.Blocks.Tables.CombiTable1Ds RodInputTable2(tableOnFile = true, tableName = "tab1", fileName = "D:/OpenModelica1.7.0/work/mymodel2011/tables1.mat", columns = 2:size(RodInputTable2.table,2), smoothness = Types.Smoothness.LinearSegments) annotation(Placement(visible = true, transformation(origin = {18.5,52}, extent = {{-15,-15},{15,15}}, rotation = 0)));

equation
  RodInputTable2.u = time;
end myModel;

When I Simulate the program, I got an error, that the element of tab1(1,1)>=tab1(1,2) which is true, but from the documentation: only the first coloumn (tab1(:,1)) should be monotonic increasing. Why it compare a time value with a data?

I tried to transpose the array in the Matlab. The simulation run without n error, but the results was wrong.
Any help will greatly appreciated.

  • Index
  • » Users
  • » gabora
  • » Profile
You are here: