---
url: /dyad/dev/stdlib/BlockComponents/components/Tables.Interpolation.md
description: >-
  Dyad Tables.Interpolation docs.  Performs interpolation on input values using
  a specified dataset and interpolation method.
---

# `Tables.Interpolation` {#Tables.Interpolation}

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.Interfaces.SISO`](../types/Interfaces.SISO.md)

## Usage {#Usage}

`BlockComponents.Tables.Interpolation(interpolator=dataset_interpolation(interpolation_type, dataset[only(get_dependent_vars(dataset))], dataset[get_independent_var(dataset)], extrapolation_type))`

## Parameters: {#Parameters:}

|                 Name |                                                                 Description | Units |             Default value |
| --------------------:| ---------------------------------------------------------------------------:| -----:| -------------------------:|
|            `dataset` |                                                                             |     – |                           |
| `interpolation_type` |                      Type of interpolation to be used (e.g., linear, cubic) |     – |                           |
| `extrapolation_type` | Type of the extrapolation to be used (defaults to `ExtrapolationType.None`) |     – |  ExtrapolationType.None() |
|       `interpolator` |         Interpolator object created from the dataset and interpolation type |     – | dataset_int...ation_type) |

## Connectors {#Connectors}

* `u` - This connector represents a real signal as an input to a component ([`RealInput`](/stdlib/Dyad/connectors/RealInput#RealInput))

* `y` - This connector represents a real signal as an output from a component ([`RealOutput`](/stdlib/Dyad/connectors/RealOutput#RealOutput))

## Behavior {#Behavior}

Behavior of this component cannot be rendered because it includes `path` variables.

## Source {#Source}

```dyad
"""
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 Interpolation
  extends BlockComponents.Interfaces.SISO
  structural parameter dataset::DyadData.DyadTimeseries
  "Type of interpolation to be used (e.g., linear, cubic)"
  structural parameter interpolation_type::InterpolationType
  "Type of the extrapolation to be used (defaults to `ExtrapolationType.None`)"
  structural parameter extrapolation_type::ExtrapolationType = ExtrapolationType.None()
  "Interpolator object created from the dataset and interpolation type"
  parameter interpolator::Real2RealInterpolator = dataset_interpolation(interpolation_type, dataset[only(get_dependent_vars(dataset))], dataset[get_independent_var(dataset)], extrapolation_type)
relations
  y = interpolator(u)
metadata {
  "Dyad": {
    "labels": [{"label": "$(instance)", "x": 500, "y": 1100, "rot": 0}],
    "icons": {"default": "dyad://BlockComponents/Interpolation.svg"},
    "doc": {"behavior": false}
  }
}
end
```

```dyad
"""
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 Interpolation
  "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}
      }
    }
  }
  structural parameter dataset::DyadData.DyadTimeseries
  "Type of interpolation to be used (e.g., linear, cubic)"
  structural parameter interpolation_type::InterpolationType
  "Type of the extrapolation to be used (defaults to `ExtrapolationType.None`)"
  structural parameter extrapolation_type::ExtrapolationType = ExtrapolationType.None()
  "Interpolator object created from the dataset and interpolation type"
  parameter interpolator::Real2RealInterpolator = dataset_interpolation(interpolation_type, dataset[only(get_dependent_vars(dataset))], dataset[get_independent_var(dataset)], extrapolation_type)
relations
  y = interpolator(u)
metadata {
  "Dyad": {
    "labels": [{"label": "$(instance)", "x": 500, "y": 1100, "rot": 0}],
    "icons": {"default": "dyad://BlockComponents/Interpolation.svg"},
    "doc": {"behavior": false}
  }
}
end
```

## Test Cases {#Test-Cases}

No test cases defined.

## Related {#Related}

* Examples

* Experiments

* Analyses

* Tests
  * [`InterpolationExtrapolation`](Tables.Interpolation.md)

  * [`InterpolationFile`](Tables.Interpolation.md)

  * [`InterpolationJuliaHubDataset`](Tables.Interpolation.md)

  * [`InterpolationTable`](Tables.Interpolation.md)
