MTK: interpolation of observed variables?

Suppose I do a simulation of a model using ModelingToolkit.jl, where x is the state, y is an observed variable, and the solution object is sol. Then


give vectors of the solution of x and y at the time points given by sol.t (or: sol[t]).

Suppose I instead want an interpolation value?


gives the interpolated value of x at time t=0.5.

  • How can I get an interpolated value of y?

sol(0.5; idxs = y)

1 Like