Skip to content

Commit b453a88

Browse files
committed
docs: add docstring for ParametrizedInterpolation
1 parent e66fb2a commit b453a88

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/Blocks/sources.jl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -742,6 +742,26 @@ end
742742
interpolation_type::UnionAll, u::AbstractArray, x::AbstractArray, args::Tuple)
743743
build_interpolation(interpolation_type, u, x, args) = interpolation_type(u, x, args...)
744744

745+
"""
746+
ParametrizedInterpolation(interp_type, u, x, args...; name)
747+
748+
Represent function interpolation symbolically as a block component. By default interpolation types
749+
from [`DataInterpolations.jl`](https://github.com/SciML/DataInterpolations.jl) are supported.
750+
# Arguments:
751+
- `interp_type`: the type of the interpolation. For `DataInterpolations`,
752+
these would be any of [the available interpolations](https://github.com/SciML/DataInterpolations.jl?tab=readme-ov-file#available-interpolations),
753+
such as `LinearInterpolation`, `ConstantInterpolation` or `CubicSpline`.
754+
- `u`: the data used for interpolation. For `DataInterpolations` this will be an `AbstractVector`
755+
- `x`: the values that each data points correspond to, usually the times corresponding to each value in `u`.
756+
- `args`: any other arguments beeded to build the interpolation
757+
758+
# Parameters:
759+
- `data`: the symbolic representation of the data passed at construction time via `u`.
760+
- `ts`: the symbolic representation of times corresponding to the data passed at construction time via `x`.
761+
762+
# Connectors:
763+
- `output`: a [`RealOutput`](@ref) connector corresponding to the interpolated value
764+
"""
745765
function ParametrizedInterpolation(interp_type::T, u, x, args...; name) where {T}
746766
@parameters data[1:length(x)] = u
747767
@parameters ts[1:length(x)] = x

0 commit comments

Comments
 (0)