the issue is more clearly described at this github issue comment link

opened 09:53AM - 26 Sep 21 UTC

closed 01:38PM - 28 Sep 21 UTC

as expected behavior if get_variables from symbolics on expression, with `t` bei… ng considered as variable
```julia
@variables t x y z(t)
ex = t*x + y + sin(z)
julia> Symbolics.get_variables(ex)
4-element Vector{Any}:
y
z(t)
t
x
```
but in reactions
```julia
@parameters k[1:2]
@variables t A(t) B(t) C(t) D(t)
rxs = [
Reaction(k[1]*t, [A], [B]), # A -> B with non constant rate.
Reaction(k[2]*t*A, [B,C], [D],[2,1],[2]) # 2A +B -> 2C with non constant rate.
]
@named rs = ReactionSystem(rxs, t, [A,B,C,D], k)
specs = species(rs)
julia> deps = get_variables(rxs[1].rate, specs)
Any[]
julia> deps = get_variables(rxs[2].rate, specs)
1-element Vector{Any}:
A(t)
```
why is `t` not considered as variables, despite assigning it as a variable with `@variables t A(t) B(t) C(t) D(t)`.
or is it expected to give output as such ?
This seems little worrisome considering role of get_variables in `graphs.jl` functions `Graphs` and `complexgraph`
eg.
```julia
rxs = [ Reaction(k[1]*t, [A], [B]), # A -> B with non constant rate.
Reaction(k[2], [A],[B]), # A -> with constant rate
Reaction(k[2]*t*A, [B,C], [D],[2,1],[2]) # 2A +B -> 2C with non constant rate.
]
@named rs = ReactionSystem(rxs, t, [A,B,C,D], k)
Graph(rs)
```
![Screenshot from 2021-09-26 15-48-00](https://user-images.githubusercontent.com/26343789/134803759-14d1a8b4-878c-408f-b8eb-bb3223a6954c.png)
There are two reation from A to B, but no way to differentiate which is just dependent on parameters and which one on variable t

If anybody could explain, how to obtain variables from such expressions, eg, state variables from the reactions rates in Catalyst reactions! Please help me understand this issue!

In the issue, it’s pointing to another issue where the discussion will take place.

1 Like

Yes, thank you sir! I had not checked earlier with symbolics issues. Now pasted my example also in the symbolics issues