Catalyst.jl icon indicating copy to clipboard operation
Catalyst.jl copied to clipboard

DSL issues with equations

Open isaacsas opened this issue 6 months ago • 6 comments

  1. Using an external function in a reaction works fine but has issues in equations
# works
f(A,t) = 2*A*t
rn = @reaction_network begin
    f(A,t), A --> 0
end 

# does not work
rn = @reaction_network begin
    @equations D(A) ~ f(A,t)
end

with the latter giving the error

ERROR: UndefVarError: `f` not defined
Stacktrace:
 [1] top-level scope
   @ ~/.julia/dev/Catalyst/src/dsl.jl:391
  1. This doesn't work
rn = @reaction_network begin
    @equations begin
        D(A) ~ Iapp
        Iapp ~ f(A,t)
    end
end

with the error

ERROR: UndefVarError: `Iapp` not defined
Stacktrace:
 [1] top-level scope
   @ ~/.julia/dev/Catalyst/src/dsl.jl:391
  1. This also doesn't work
rn = @reaction_network begin
    @variables Iapp(t)
    @equations begin
        D(A) ~ Iapp
        Iapp ~ f(A,t)
    end
end

with a similar error to case 1.

isaacsas avatar Aug 14 '24 14:08 isaacsas