# Interpolation within ModelingToolkit framework

**URL:** <https://discourse.julialang.org/t/interpolation-within-modelingtoolkit-framework/59432>\
**Category:** New to Julia\
**Tags:** modelingtoolkit\
**Created:** [April 16, 2021, 6:35pm UTC](https://discourse.julialang.org/t/interpolation-within-modelingtoolkit-framework/59432 "2021-04-16T18:35:06Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![lstagner](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lstagner/32/448_2.png) [@lstagner](https://discourse.julialang.org/u/lstagner)\
**Post date:** [April 23, 2021, 2:06am UTC](https://discourse.julialang.org/t/interpolation-within-modelingtoolkit-framework/59432/8 "2021-04-23T02:06:30Z")

</div>

This is just a performance tip but I would have `f_interpolate` return the interpolating function. Right now every time `f_interpolate` is called it constructs a interpolation object. I would rewrite it as follows

```julia
f_interpolate = QuadraticInterpolation(table_u, table_t)
@register f_interpolate(t)

```

Assuming `@register` accepts DataInterpolations

---

_[View the full topic](https://discourse.julialang.org/t/interpolation-within-modelingtoolkit-framework/59432)._
