You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Most common use case with [ModelingToolkit.jl](https://docs.sciml.ai/ModelingToolkit/stable/) is to plug in interpolation objects as input functions. This can be done using `TimeVaryingFunction` component of [ModelingToolkitStandardLibrary.jl](https://docs.sciml.ai/ModelingToolkitStandardLibrary/stable/).
45
-
46
-
```@example mtk
47
-
using DataInterpolations
48
-
using ModelingToolkitStandardLibrary.Blocks
49
-
using ModelingToolkit
50
-
using ModelingToolkit: t_nounits as t, D_nounits as D
51
-
using OrdinaryDiffEq
52
-
53
-
us = [0.0, 1.5, 0.0]
54
-
times = [0.0, 0.5, 1.0]
55
-
A = LinearInterpolation(us, times)
56
-
57
-
@named src = TimeVaryingFunction(A)
58
-
vars = @variables x(t) out(t)
59
-
eqs = [out ~ src.output.u, D(x) ~ 1 + out]
60
-
@named sys = ODESystem(eqs, t, vars, []; systems = [src])
0 commit comments