interpolationmodelicaopenmodelicadymola

How do I interpolate a value (output) with 3 or more input variables in Dymola?


example

enter image description here

The picture shows the problem that I want to solve. I will have the data (output from inputs) as a table in csv format.

Interpolating with 2 inputs and one output is no problem. I could solve this with the combiTable2Dv. Can I extend this table to solve my problem? Under parameters I saw a setting option for the dimensions.enter image description here

Update: I have now created a map with 4 inputs and 1 output in the SDF format. (see picture 4) I have loaded this into the SDF.NDTable and get the following error message. enter image description here

enter image description here

This is my Error in Dymola:

Check of Unnamed2:

Multiple sources for causal signal in the same connection set.
inside output m_in.y =inside output n.y =inside input nDTable.u[4] =inside output p_in.y =inside output p_out.y

The problem is structurally singular.

It has 13 scalar unknowns and 13 scalar equations.
The Real part has 12 unknowns and 12 equations.
The Integer part has 1 unknowns and 1 equations.
The Boolean part has 0 unknowns and 0 equations.
The String part has 0 unknowns and 0 equations.

The model could not be deduced to be symbolically well-posed.
The model has
9+nDTable.nin
scalar unknowns and
13
scalar equations.
However, exploiting the given numerical settings of parameters gives the same number of unknowns and equations:
13

Attempting to further localize singularity.

Singularity of Unnamed2 is at the top level.

The model Unnamed2 is structurally singular.

Multiple sources for causal signal in the same connection set.
inside output m_in.y =inside output n.y =inside input nDTable.u[4] =inside output p_in.y =inside output p_out.y

Some elements of the input connector u of nDTable are not connected from the outside.
It is likely that they all should have been connected, and recursive check assumes this.
The missing connection is a likely cause of errors in the model.

WARNINGS have been issued.

ERRORS have been issued.

Solution

  • Regarding your question with "dimensions":

    The model Modelica.Blocks.Tables.CombiTable2Dv does have a parameter n. Assuming this is what you are referring to: This basically creates a vector of tables which do a look-up/interpolation based on the same source data (=table/file) for a vector of (two) inputs resulting in a vector of outputs. Inputs and outputs are therefore vectors of size n. So this will likely not help in the given case.

    The original issue:

    From what I understand, you need a table with there inputs, or three independent variables. Tables of this kind are not provided with the Modelica Standard Library. In Dymola I know about two options, which you will find under File -> Libraries:

    Both of the above packages provide functions which allow the creation of the necessary files from Dymola and/or Matlab. Those should be documented well enough to be usable.