-
-
Notifications
You must be signed in to change notification settings - Fork 232
Closed
Description
The following system has no constant right-hand-side term but when I try to detect that programmatically I'm getting
julia> @parameters t CL Vc Qfast Vpfast Qslow Vpslow
(t, CL, Vc, Qfast, Vpfast, Qslow, Vpslow)
julia> @variables Central(t) Periph1(t) Periph2(t)
(Central(t), Periph1(t), Periph2(t))
julia> D = Differential(t);
julia> eqs = [
D(Central) ~ -(CL/Vc)*Central + (Qfast/Vpfast)*Periph1 - (Qfast/Vc)*Central + (Qslow/Vpslow)*Periph2 - (Qslow/Vc)*Central,
D(Periph1) ~ (Qfast/Vc)*Central - (Qfast/Vpfast)*Periph1,
D(Periph2) ~ (Qslow/Vc)*Central - (Qslow/Vpslow)*Periph2
];
julia> @named sys = ODESystem(eqs);
julia> jac = calculate_jacobian(sys);
julia> linpart = jac*states(sys);
julia> rhs = [eq.rhs for eq ∈ equations(sys)];
julia> cnst = rhs - linpart
3-element Vector{Num}:
-(-CL*(Vc^-1) - (Qfast*(Vc^-1)) - (Qslow*(Vc^-1)))*Central(t) - (CL*Central(t)*(Vc^-1)) - (Qfast*Central(t)*(Vc^-1)) - (Qslow*Central(t)*(Vc^-1))
0
0
julia> simplify(cnst[1])
-(-CL*(Vc^-1) - (Qfast*(Vc^-1)) - (Qslow*(Vc^-1)))*Central(t) - (CL*Central(t)*(Vc^-1)) - (Qfast*Central(t)*(Vc^-1)) - (Qslow*Central(t)*(Vc^-1))
This happens both with version 5.20.0 and master. With version 5.20.0, I can simply the expressions with expand
julia> expand(cnst[1])
0
but on master, I'm getting
julia> simplify(expand(cnst[1]))
(CL*Central(t)) / Vc + (Qfast*Central(t)) / Vc + (Qslow*Central(t)) / Vc + (-CL*Central(t)) / Vc + (-Qfast*Central(t)) / Vc + (-Qslow*Central(t)) / Vc
Update: The versions of Symbolics are v0.1.22 and v4.1.0 respectively.
Metadata
Metadata
Assignees
Labels
No labels