Message Boards Message Boards

7 Replies
8 Total Likes
View groups...
Share this post:

Settings in look up table in SystemModeler

Posted 10 years ago

I am trying to incorporate the following attached table. I am not getting the correct entries i should fill in general settings tab. There is a block 'combitable1D' which i am using as per attached file. i am not able to do the settings of following parameters:


table on file







Can you please suggest me enteries for these. i am getting the following error?

Warning: Unused input variable tableAvailable in function .Modelica.Blocks.Tables.CombiTable1D.getTableValue. Warning: Unused input variable tableAvailable in function .Modelica.Blocks.Tables.CombiTable1D.getDerTableValue. Validation of model Model1 completed successfully. The model Model1 is globally balanced with 51 equations and 51 variables. 20 of these are non-trivial equations.

POSTED BY: manu gaurav
7 Replies

The meaning of setting columns to 2:2 is described in the documentation of CombiTable1D. Just open the CombiTable1D class and hit F1 to see the documentation.

First, 2:2 is the same as the one element array {2}. The interpretation is that the second column of the data matrix will be used for interpolation of the first (and in this case the only) output.

If you think of the interpolation in terms of a function plot, with function input values on the x axis and function output values on the y axis, then the x coordinates of the data points are always given by the first column in the data matrix, and the y coordinates by the columns specified using the columns parameter. Each column of y coordinates defines an interpolation, and the block will have a corresponding input/output pair for interpolation using this column. Hence, in your case, where the block just has a single input/output pair, the columns parameter should only specify one column, for instance {2} (or 2:2).

Of course, with a data matrix having only two columns and a block with just one input/output pair, specifying the second column is the only sensible thing to do, and this is also what you get by default. (You will notice the grayed out setting 2:size(table, 2) in the field for columns if you don't type anything.)

POSTED BY: Henrik Tidefelt

The warning is due to an oddity in the Modelica Standard Library, the development of which is external to Wolfram. If you look at the implementation of CombiTimeTable, you will find a lot of functions containing the line

  input Real tableAvailable "Dummy input to ensure correct sorting of function calls";

Being documented as a "dummy input", it appears OK that it is not used. On the other hand, the Modelica translator in SystemModeler does not try to read and understand documentation strings, so to the translator it just looks suspicious that the function takes an argument that it never makes any use of.

My guess is that the author of this part of the Modelica Standard Library was using a different Modelica translator that has (or had, by the time) some peculiar limitation in its internal workings that could be worked around using the dummy input argument, and that this translator did not warn about unused function input variables.

POSTED BY: Henrik Tidefelt
Posted 10 years ago

It took some playing around but I think I got it to read the table. I still get these warnings below, but it seems to work.

Warning: Unused input variable tableAvailable in function .Modelica.Blocks.Tables.CombiTable1D.getTableValue. Warning: Unused input variable tableAvailable in function .Modelica.Blocks.Tables.CombiTable1D.getDerTableValue.

enter image description here

The output was 1 when the input was 1.570796327

POSTED BY: Eric Meyers

hi eric

you will be glad to know, it worked.

only two things still trouble me

  1. what is the meaning of entry columns 2:2

  2. what is the meaning of warning

POSTED BY: manu gaurav

Hi friends!

This is not a query from mathematica. this is a system modeler query.

Here is a screenshot:

enter image description here

POSTED BY: manu gaurav

hello marco,

thank you for addressing my problem.

i am trying this in system modeler as a look up table. see if you can do something. i have trial version of system modeler 4.0.0

thanks manu

POSTED BY: manu gaurav

**** NOTE: the original post has been changed after I replied *********


could you try to make it a little bit clearer what you mean?

i am trying to incorporate the following attached table.

Incorporate into what? Incorporate into a notebook? Then this should do the trick:

data = Import["~/Desktop/my_table.txt", "TSV"]

where you have to change the path according to your system.

data[[3 ;;]]

would give you the columns of numbers only. You might also want to try the brand new:


enter image description here

You can then easily work with the data:

ListLinePlot[data[[3 ;;]]]

for example gives this nice figure:

enter image description here

i am not getting the correct enteries i should fill in general settings tab.

I am not really sure what you mean with that. In which general settings tab?

Perhaps you can explain in some more detail where your problem is.



POSTED BY: Marco Thiel
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract