We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
simplify
I ran into the following issue on Symbolics#master:
julia> using Symbolics julia> ex = (1.1540262529490819e-7(5.011872336272725e-8 + a)*(10^(-x))) / (2.511886431509582e-15((a + 10^(-x))^2)) + (-2.302585092994046(5.011872336272725e-8 + a)*(10^(-x))) / (5.011872336272725e-8(a + 10^(-x))); julia> Symbolics.simplify(ex) 0
even though the expression is clearly not zero. As an example, compare
julia> Symbolics.substitute(ex, Dict(x => 1.0, a => 1.0)) -379691.03250567336
A bit longer story: I encountered this problem when using Symbolics.hessian(...; simplify=true). I got
Symbolics.hessian(...; simplify=true)
julia> using Symbolics julia> @variables t Ka ktr ph(t) tr1(t); julia> D = Differential(t); julia> ex = 10^(-ph)/(10^(-ph) + Ka) / (10^(-7.3) / (10^(-7.3) + Ka)) - ktr * tr1; julia> Symbolics.hessian(ex, [ph, tr1]; simplify=true) 2×2 Matrix{Num}: 0 0 0 0
even though the second derivative of ex with respect to ph should be non-zero
ex
ph
julia> Symbolics.hessian(ex, [ph, tr1]) 2×2 Matrix{Num}: (-2.65724e-7(5.01187e-8 + Ka)*(10^(-2ph(t)))) / (2.51189e-15((Ka + 10^(-ph(t)))^2)) + (5.3019(5.01187e-8 + Ka)*(10^(-ph(t)))) / (5.01187e-8(Ka + 10^(-ph(t)))) + 1.15403e-7(10^(-ph(t)))*((-2.30259(5.01187e-8 + Ka)*(10^(-ph(t)))) / (2.51189e-15((Ka + 10^(-ph(t)))^2))) + 1.15403e-7((-2.30259(5.01187e-8 + Ka)*(10^(-ph(t)))) / (2.51189e-15((Ka + 10^(-ph(t)))^2)) + 1.15677e-14(Ka + 10^(-ph(t)))*(10^(-ph(t)))*(((5.01187e-8 + Ka)*(10^(-ph(t)))) / (6.30957e-30((Ka + 10^(-ph(t)))^4))))*(10^(-ph(t))) … 0 0 0
The example above is actually the slightly simpler case
julia> Symbolics.derivative(ex, ph; simplify=true) 0 julia> Symbolics.derivative(ex, ph) (-2.302585092994046(5.011872336272725e-8 + Ka)*(10^(-ph(t)))) / (5.011872336272725e-8(Ka + 10^(-ph(t)))) + 1.1540262529490819e-7(((5.011872336272725e-8 + Ka)*(10^(-ph(t)))) / (2.511886431509582e-15((Ka + 10^(-ph(t)))^2)))*(10^(-ph(t)))
The text was updated successfully, but these errors were encountered:
Ooof that's not good. @shashi do you have an idea for where to start looking for this?
Sorry, something went wrong.
No branches or pull requests
I ran into the following issue on Symbolics#master:
even though the expression is clearly not zero. As an example, compare
A bit longer story: I encountered this problem when using
Symbolics.hessian(...; simplify=true)
. I goteven though the second derivative of
ex
with respect toph
should be non-zeroThe example above is actually the slightly simpler case
The text was updated successfully, but these errors were encountered: