ScalarInterpolation ​
Performs interpolation on input values using a specified dataset and interpolation method.
Takes an input value and produces an output by interpolating within a dataset according to the specified interpolation type. The component creates an interpolator object from the dataset and interpolation parameters, then applies this interpolator to map input values to output values through lookup and interpolation.
This component extends from BlockComponents.SISO
Usage ​
BlockComponents.ScalarInterpolation(interpolator=dataset_interpolation(interpolation_type, filepath, dependent_var, independent_var))
Parameters: ​
| Name | Description | Units | Default value |
|---|---|---|---|
filepath | Dataset containing the data points to be interpolated | – | |
independent_var | – | ||
dependent_var | – | ||
interpolation_type | – |
Connectors ​
u- This connector represents a real signal as an input to a component (RealInput)y- This connector represents a real signal as an output from a component (RealOutput)
Behavior ​
Behavior of this component cannot be rendered because it includes path variables.
Source ​
"""
Performs interpolation on input values using a specified dataset and interpolation method.
Takes an input value and produces an output by interpolating within a dataset according to the
specified interpolation type. The component creates an interpolator object from the dataset and
interpolation parameters, then applies this interpolator to map input values to output values
through lookup and interpolation.
"""
component ScalarInterpolation
extends BlockComponents.SISO
"Dataset containing the data points to be interpolated"
structural parameter filepath::String
structural parameter independent_var::String
structural parameter dependent_var::String
structural parameter interpolation_type::String
final parameter interpolator::Real2RealInterpolator = dataset_interpolation(interpolation_type, filepath, dependent_var, independent_var)
relations
y = interpolator(u)
metadata {
"Dyad": {
"labels": [{"label": "$(instance)", "x": 500, "y": 1100, "rot": 0}],
"icons": {"default": "dyad://BlockComponents/Interpolation.svg"},
"doc": {"behavior": false}
}
}
endFlattened Source
"""
Performs interpolation on input values using a specified dataset and interpolation method.
Takes an input value and produces an output by interpolating within a dataset according to the
specified interpolation type. The component creates an interpolator object from the dataset and
interpolation parameters, then applies this interpolator to map input values to output values
through lookup and interpolation.
"""
component ScalarInterpolation
"Input signal port"
u = RealInput() {
"Dyad": {
"placement": {
"icon": {"iconName": "input", "x1": -100, "y1": 450, "x2": 0, "y2": 550, "rot": 0},
"diagram": {"iconName": "input", "x1": -100, "y1": 450, "x2": 0, "y2": 550, "rot": 0}
}
}
}
"Output signal port"
y = RealOutput() {
"Dyad": {
"placement": {
"icon": {"iconName": "output", "x1": 1000, "y1": 450, "x2": 1100, "y2": 550, "rot": 0},
"diagram": {"iconName": "output", "x1": 1000, "y1": 450, "x2": 1100, "y2": 550, "rot": 0}
}
}
}
"Dataset containing the data points to be interpolated"
structural parameter filepath::String
structural parameter independent_var::String
structural parameter dependent_var::String
structural parameter interpolation_type::String
final parameter interpolator::Real2RealInterpolator = dataset_interpolation(interpolation_type, filepath, dependent_var, independent_var)
relations
y = interpolator(u)
metadata {
"Dyad": {
"labels": [{"label": "$(instance)", "x": 500, "y": 1100, "rot": 0}],
"icons": {"default": "dyad://BlockComponents/Interpolation.svg"},
"doc": {"behavior": false}
}
}
endTest Cases ​
No test cases defined.
Related ​
Examples
Experiments
Analyses
Tests