@@ -538,11 +538,6 @@ struct ReactionSystem{V <: NetworkProperties} <:
538
538
checks && validate (rs)
539
539
rs
540
540
end
541
-
542
- # Copies a reaction system, but with the option of having some fields replaced
543
- function ReactionSystem (rs:: ReactionSystem ; eqs = rs. eqs, rxs = rs. rxs, iv = rs. iv, sivs = rs. sivs, states = rs. states, species = rs. species, ps = rs. ps, var_to_name = rs. var_to_name, observed = rs. observed, name = rs. name, systems = rs. systems, defaults = rs. defaults, connection_type = rs. connection_type, networkproperties = rs. networkproperties, combinatoric_ratelaws = rs. combinatoric_ratelaws, continuous_events = rs. continuous_events, discrete_events = rs. discrete_events, complete = rs. complete)
544
- new {typeof(networkproperties)} (eqs, rxs, ModelingToolkit. unwrap (iv), ModelingToolkit. unwrap .(sivs), ModelingToolkit. unwrap .(states), ModelingToolkit. unwrap .(species), ModelingToolkit. unwrap .(ps), var_to_name, observed, name, systems, defaults, connection_type, networkproperties, combinatoric_ratelaws, continuous_events, discrete_events, complete)
545
- end
546
541
end
547
542
548
543
function get_speciestype (iv, states, systems)
@@ -1292,17 +1287,14 @@ Keyword args and default values:
1292
1287
function Base. convert (:: Type{<:ODESystem} , rs:: ReactionSystem ; name = nameof (rs),
1293
1288
combinatoric_ratelaws = get_combinatoric_ratelaws (rs),
1294
1289
include_zero_odes = true , remove_conserved = false , checks = false ,
1295
- expand_functions = false , kwargs... )
1290
+ kwargs... )
1296
1291
spatial_convert_err (rs:: ReactionSystem , ODESystem)
1297
1292
fullrs = Catalyst. flatten (rs)
1298
1293
remove_conserved && conservationlaws (fullrs)
1299
1294
ists, ispcs = get_indep_sts (fullrs, remove_conserved)
1300
1295
eqs = assemble_drift (fullrs, ispcs; combinatoric_ratelaws, remove_conserved,
1301
1296
include_zero_odes)
1302
1297
eqs, sts, ps, obs, defs = addconstraints! (eqs, fullrs, ists, ispcs; remove_conserved)
1303
-
1304
- # Converts expressions like mm(X,v,K) to v*X/(X+K).
1305
- expand_functions && (eqs = [eq. lhs ~ expand_registered_functions! (eq. rhs) for eq in eqs])
1306
1298
1307
1299
ODESystem (eqs, get_iv (fullrs), sts, ps;
1308
1300
observed = obs,
@@ -1334,7 +1326,7 @@ Keyword args and default values:
1334
1326
function Base. convert (:: Type{<:NonlinearSystem} , rs:: ReactionSystem ; name = nameof (rs),
1335
1327
combinatoric_ratelaws = get_combinatoric_ratelaws (rs),
1336
1328
include_zero_odes = true , remove_conserved = false , checks = false ,
1337
- expand_functions = false , kwargs... )
1329
+ kwargs... )
1338
1330
spatial_convert_err (rs:: ReactionSystem , NonlinearSystem)
1339
1331
fullrs = Catalyst. flatten (rs)
1340
1332
remove_conserved && conservationlaws (fullrs)
@@ -1344,9 +1336,6 @@ function Base.convert(::Type{<:NonlinearSystem}, rs::ReactionSystem; name = name
1344
1336
error_if_constraint_odes (NonlinearSystem, fullrs)
1345
1337
eqs, sts, ps, obs, defs = addconstraints! (eqs, fullrs, ists, ispcs; remove_conserved)
1346
1338
1347
- # Converts expressions like mm(X,v,K) to v*X/(X+K).
1348
- expand_functions && (eqs = [eq. lhs ~ expand_registered_functions! (eq. rhs) for eq in eqs])
1349
-
1350
1339
NonlinearSystem (eqs, sts, ps;
1351
1340
name,
1352
1341
observed = obs,
@@ -1386,7 +1375,7 @@ function Base.convert(::Type{<:SDESystem}, rs::ReactionSystem;
1386
1375
noise_scaling = nothing , name = nameof (rs),
1387
1376
combinatoric_ratelaws = get_combinatoric_ratelaws (rs),
1388
1377
include_zero_odes = true , checks = false , remove_conserved = false ,
1389
- expand_functions = false , kwargs... )
1378
+ kwargs... )
1390
1379
spatial_convert_err (rs:: ReactionSystem , SDESystem)
1391
1380
1392
1381
flatrs = Catalyst. flatten (rs)
@@ -1412,12 +1401,6 @@ function Base.convert(::Type{<:SDESystem}, rs::ReactionSystem;
1412
1401
eqs, sts, ps, obs, defs = addconstraints! (eqs, flatrs, ists, ispcs; remove_conserved)
1413
1402
ps = (noise_scaling === nothing ) ? ps : vcat (ps, toparam (noise_scaling))
1414
1403
1415
- # Converts expressions like mm(X,v,K) to v*X/(X+K).
1416
- if expand_functions
1417
- eqs = [eq. lhs ~ expand_registered_functions! (eq. rhs) for eq in eqs]
1418
- noiseeqs = [expand_registered_functions! (neq) for neq in noiseeqs]
1419
- end
1420
-
1421
1404
if any (isbc, get_states (flatrs))
1422
1405
@info " Boundary condition species detected. As constraint equations are not currently supported when converting to SDESystems, the resulting system will be undetermined. Consider using constant species instead."
1423
1406
end
0 commit comments