Skip to content

Commit 79cb104

Browse files
shashiYingboMa
andcommitted
remove unnecessary and wrong substitute
Co-authored-by: "Yingbo Ma" <[email protected]>
1 parent 4c8d09c commit 79cb104

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

src/systems/nonlinear/nonlinearsystem.jl

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,18 +87,12 @@ end
8787
function generate_function(sys::NonlinearSystem, dvs = states(sys), ps = parameters(sys); kwargs...)
8888
#obsvars = map(eq->eq.lhs, observed(sys))
8989
#fulldvs = [dvs; obsvars]
90-
fulldvs = dvs
91-
fulldvs′ = makesym.(value.(fulldvs))
9290

93-
sub = Dict(fulldvs .=> fulldvs′)
94-
# substitute x(t) by just x
95-
rhss = [substitute(deq.rhs, sub) for deq equations(sys)]
91+
rhss = [deq.rhs for deq equations(sys)]
9692
#obss = [makesym(value(eq.lhs)) ~ substitute(eq.rhs, sub) for eq ∈ observed(sys)]
9793
#rhss = Let(obss, rhss)
9894

99-
dvs′ = fulldvs′[1:length(dvs)]
100-
ps′ = makesym.(value.(ps), states=())
101-
return build_function(rhss, dvs′, ps′;
95+
return build_function(rhss, value.(dvs), value.(ps);
10296
conv = AbstractSysToExpr(sys), kwargs...)
10397
end
10498

src/systems/reaction/reactionsystem.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ function Base.convert(::Type{<:SDESystem}, rs::ReactionSystem;
475475
combinatoric_ratelaws=combinatoric_ratelaws)
476476
systems = convert.(SDESystem, get_systems(rs))
477477
SDESystem(eqs, noiseeqs, get_iv(rs), get_states(rs),
478-
(noise_scaling===nothing) ? get_ps(rs) : union(get_ps(rs), toparam.(noise_scaling));
478+
(noise_scaling===nothing) ? get_ps(rs) : union(get_ps(rs), toparam(noise_scaling));
479479
name=name,
480480
systems=systems,
481481
kwargs...)

0 commit comments

Comments
 (0)