TableFunctionTable function defined by external data on file using Modelica's CombiTable format |
This information is part of the Business Simulation Library (BSL). Please support this work and ► donate.
This converter uses the Modelica CombiTable format to read in a 1-D table function from file. For more explanation regarding the 1-D Modelica CombiTable interpolation see Modelica.Blocks.Tables.CombiTable1Ds.
For more convenience, the input u to and the ouput from the lookup table can be converted into different units. This typically applies to rates and times which in non-technical modeling will typically not be referenced in SI-units (e.g., s
).
The Modelica CombiTable format can be generated by Wolfram Mathematica using Export[]:
Export[ filename, { {"TableName1", table1}, {"TableName2", table2}, ... }, "MCTT" ]
where table1, table2, ...
are 2-dimensional arrays. By default all lookup data are assumed to be included in a single file whose name is given by the global parameter lookupDataFileURI
.
convertInput |
Value: false Type: Boolean Description: = true, if the input value is a rate or time variable that needs to be converted |
---|---|
inputIsRate |
Value: false Type: Boolean Description: = true, if the input is given in units of time, otherwise it is assumed to be a rate |
convertOutput |
Value: false Type: Boolean Description: = true, if the output value is a rate or time variable that needs to be converted |
outputIsRate |
Value: false Type: Boolean Description: = true, if the output is given in units of time, otherwise it is assumed to be a rate |
tableOnFile |
Value: false Type: Boolean Description: = true, if table is defined on file or in function usertab (combiTable1D.tableOnFile) |
table |
Value: fill(0.0, 2, 2) Type: Real[:,:] Description: Table matrix (combiTable1D.table) |
tableName |
Value: "NoName" Type: String Description: Name of the table in the file containing the data |
fileNameURI |
Value: modelSettings.lookupDataFileURI Type: String Description: URI of the file to read the data from (default = modelSettings.lookupDataFileURI) |
smoothness |
Value: Smoothness.LinearSegments Type: Smoothness Description: Smoothness of table interpolation |
column |
Value: 2 Type: Integer Description: Column of table to be interpolated |
verboseRead |
Value: true Type: Boolean Description: = true, if info message that file is loading is to be printed (combiTable1D.verboseRead) |
extrapolation |
Value: Modelica.Blocks.Types.Extrapolation.HoldLastPoint Type: Extrapolation Description: Extrapolation of data outside the definition range (combiTable.extrapolation) |
verboseExtrapolation |
Value: false Type: Boolean Description: = true, if warning messages are to be printed if table input is outside the definition range (combiTable.verboseExtrapolation) |
y |
Type: RealOutput Description: Output signal |
|
---|---|---|
u |
Type: RealInput Description: Input |
|
u_c |
Type: RealOutput Description: Input after conversion |
|
y_c |
Type: RealOutput Description: Output before conversion |
rateConversionIn |
Type: RateConversion Description: Convert the input (rate) to another time base |
|
---|---|---|
noConversionIn |
Type: PassThrough Description: Use input as is |
|
timeConversionIn |
Type: TimeConversion Description: Convert the input to another time base |
|
noConversionOut |
Type: PassThrough Description: Use output as is |
|
rateConversionOut |
Type: RateConversion Description: Convert the output (rate) to 1/s |
|
timeConversionOut |
Type: TimeConversion Description: Convert the output to seconds |
|
modelSettings |
Type: ModelSettings Description: Setting important global variables within a model |
|
combiTable |
Type: CombiTable1Ds Description: Table look-up in one dimension (matrix/file) with one input and n outputs |
BusinessSimulation.Examples Showcase of lookup-functions |
BusinessSimulation.CausalLoop Table-based lookup with manual input of the interpolation table |
|
BusinessSimulation.CausalLoop Table-based lookup given on file |