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

3D Table Lookup / Usage of Dymola DataFiles Package

3D Table Lookup / Usage of Dymola DataFiles Package

Hi all,

I am currently working on a Library for Battery Module Simulation. In this context I am looking for a function (or a block) comparable to Matlab's "interp3" which gives me a solution for y = f(x1, x2, x3). I have succeeded building my own modelica function but it did not quite match the performance requirements. In order to achieve a better performance, I investigated the usage of external C functions but I could not manage to get it working (I am a absolute beginner to C coding, so thats probably an issue).

Apart from building my own function and trying to implement a external c function, I was also investigating in Packages, which already offer a ND-Table. My investigation lead me to the SDF and the DataFiles Package both available in Dymola. SDF does not really match my requirements but the DataFiles package showed promising results with my Dymola trial version.

Now my questions:

a) Does anybody know a way apart from the mentioned to implement 3D interpolation in OpenModelica?
b) Is it possible to use the DataFiles Package in OpenModelica? I easily managed to open the library in OpenModelica but I have no clue how to establish the connection from the used "interpolate"-function to the underlying C library.


I am really stuck with this topic, I would really appreciated some help!current/smile

Cheers!!

Re: 3D Table Lookup / Usage of Dymola DataFiles Package

a) Yes, but I'm not at liberty to discuss that particular implementation. You can read https://github.com/modelica/ModelicaSta … ssues/1153 as well...
b) You need to write your own C library most likely, or maybe you can use /opt/dymola-2021x-x86_64/source/matrixop.c, but I have never looked at that. The readMatrix function is a builtin function of Dymola and doesn't work in standard Modelica tools. But why not spend time to extend the standard library to have ND-tables instead? (You know, that ticket above)

Re: 3D Table Lookup / Usage of Dymola DataFiles Package

Thanks a lot for your prompt reply!

a) I've been following the discussion on GitHub, seems to me like the integration of a ND table can't be expected in the nearer future, but I will follow on the topic!
b) Thanks a lot for hinting matrixop.c, I will give this a go and report the results if I get it working. I would also love to spend the time to develop my own c library but unfortunatly, I am a quite in a hurry (end of the thesis is coming faster as expected current/big_smile).

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