Skip to content
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

Enable interpolation of functional variable (but not its argument). #1208

Open
TorkelE opened this issue Apr 1, 2025 · 0 comments
Open

Enable interpolation of functional variable (but not its argument). #1208

TorkelE opened this issue Apr 1, 2025 · 0 comments

Comments

@TorkelE
Copy link
Member

TorkelE commented Apr 1, 2025

Especially relevant after #1191 gets merged.

Currently, it is not possible to interpolate only a functional parameter into the DSL. Here is the current workflow:

using Catalyst

# Defines an input process (modified sinus wave).
tend = 5.0
ts = collect(0.0:0.0001:tend)
A = 2.0; f = 1.6; ϕ = 0.5;
spline = LinearInterpolation(A .* (sin.(2π * f .* ts .- ϕ) .+ 1) /2, ts)
@parameters (pIn::typeof(spline))(..)

# Defines a `ReactionSystem` with the input parameter (using the DSL).
input = pIn(t)
rs_pIn_dsl = @reaction_network rs_pIn begin
    ($input,d), 0 <--> X
    (k1*X,k2), Y1 <--> Y2
end

Ideally, one shoudl be able to do this:

rs_pIn_dsl = @reaction_network rs_pIn begin
    (($pIn)(t),d), 0 <--> X
    (k1*X,k2), Y1 <--> Y2
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant