Skip to content

Commit c5265b1

Browse files
committed
save progress
1 parent a45a1bc commit c5265b1

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

src/reactionsystem.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -811,6 +811,18 @@ function numreactions(network)
811811
nr
812812
end
813813

814+
"""
815+
nonreactions(network)
816+
817+
Return the non-reaction equations within the network (i.e. algebraic and differnetial equations).
818+
819+
Notes:
820+
- Allocates a new array to store the non-species variables.
821+
"""
822+
function nonreactions(network)
823+
equations(network)[(numreactions(network) + 1):end]
824+
end
825+
814826
"""
815827
numreactionparams(network)
816828

test/reactionsystem_core/coupled_equation_crn_systems.jl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,24 @@ let
211211
end
212212

213213

214+
### Accessor Tests ###
215+
216+
# Checks that basic accessors gives correct output.
217+
let
218+
# Creates a basic model with combination of equations and reactions.
219+
coupled_rs = @reaction_network coupled_rs begin
220+
@variables VV(t)
221+
@equations begin
222+
D(V) ~ X - V
223+
VV^2 ~ log(V) + X
224+
end
225+
(p,d), 0 <--> X
226+
end
227+
228+
229+
end
230+
231+
214232
### Species, Variables, and Parameter Handling ###
215233

216234
# Checks that coupled systems contain the correct species, variables, and parameters.

0 commit comments

Comments
 (0)