Skip to content

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

Closed
@TorkelE

Description

@TorkelE

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions