Catalyst.jl
Catalyst.jl copied to clipboard
DSL issues with equations
- 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
- 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
- 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.