Question

I need to perform an interpolation of some tabulated data in Dymola Modelica, but I can only find a function that does linear interopolation (Modelica.Math.Vectors.interpolate). I really need some sort of higher order interpolation like polynomial or preferably spline. Has anyone written a function to do this?

Was it helpful?

Solution 2

Oddly enough, I found a polynomial fitting function here: Modelica.Media.Incompressible.TableBased.Polynomials_Temp.fitting

There are also functions for evaluating polynomials in the same place.

OTHER TIPS

In Dymola, there are some "built-in" features that allow you to do tabular interpolation. I do not remember the specifics or the maximum order for interpolation, but I'm sure it is there. You'll just have to check to documentation.

It is also worth noting that as of Modelica 3.2.1 there is a new table interpolation implementation that is open source. I haven't looked to carefully, but I'm pretty sure it features up to cubic polynomials and since it is open source I suspect you can figure out a way to repurpose it in nearly any way you want. The only downside is that you have to use the very latest version of the MSL (which shouldn't be a huge problem).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top