-
-
Notifications
You must be signed in to change notification settings - Fork 209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for callable parameters in IndexCache
#2910
Comments
This works: using ModelingToolkit
using ModelingToolkit: t_nounits as t, D_nounits as D
using DataInterpolations
using DifferentialEquations
u = rand(5)
x = 0:4
interp = CubicSpline(u, x)
@variables y(t) = 0
@parameters i::CubicSpline = interp
@register_symbolic ifunc(t, ispline::CubicSpline)
ifunc(t, ispline) = ispline(t)
eqs = [D(y) ~ ifunc(t, i)]
@named model = ODESystem(eqs, t, [y], [i])
sys = structural_simplify(model)
prob = ODEProblem(sys, [], extrema(x), [])
sol = solve(prob) But (for reasons I do not know)
|
I found a (better?) solution that should work without callable parameters in SciML/ModelingToolkitStandardLibrary.jl#314 |
Beautiful! I would love to use this. |
5 tasks
Roadmap for callable parameters support:
|
This was referenced Sep 12, 2024
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Would it be possible to support callable symbolic parameters? I tried the following
which gives
Should I specify the type for the callable parameter?
Also, if I don't specify the unknowns and parameters explicitly, I get
The text was updated successfully, but these errors were encountered: