I
am solving a polynomial which arises from plotting titration cures in
chemistry. The rule of signs suggests it has one positive root.
Find_root seems to find it. Solve with poly_solve=true does not.
Instead it gives 4 complex roots, which don't appear to satisfy the
equation. They do not even form two conjugate pairs. Here is some code which illustrates the problem:
var('Kb','b0','K1','Ks','a0')
fx(x)=-Kb*x^4
- (b0*Kb + K1*Kb + Ks)*x^3 - (b0*K1*Kb - a0*K1*Kb + K1*Ks - Kb*Ks)*x^2 +
(a0*K1*Ks + K1*Kb*Ks + Ks^2)*x +
K1*Ks^2
fx(x)=fx.subs(K1=10^-2.15,Ks=10^-14,Kb=10^5.0,a0=0.1,b0=0)
s=find_root(fx,0,0.025,1E-14)
show(s)
s1=solve(fx,x,to_poly_solve=true)
show('roots from solve: ',N(s1[0].rhs(),3));show(N(s1[1].rhs(),3));show(N(s1[2].rhs(),3));show(N(s1[3].rhs(),3))
show('Substituting first root from solve: ',N(fx(s1[0].rhs()),10))
show('Substituting first root from find_root: ',N(fx(s),10))
plot(fx,0.001,0.03)
Can someone shed light on this?
> This is a very good question for Ask Sage, would you ask it there?
Why should he? He did ask here. And I, for one, dislike the Ask Sage
pages to the extent that I wouldn't answer questions there.
>
> Interesting. If you have ideas on how to improve it so that you might do
> so, please start a thread on sage-devel about that.
I don't. I have expressed my dislike of AskSage as soon as it was
available. It is just that I don't like all these badges and awards and
I don't like the fact that I need a web browser and a good internet
connection to use the page. I prefer a list such as sage-devel or
sage-support that I can use with slrn and with my mobile broadband (or
rather "narrow band") stick.
> I find it a lot easier to help people there, myself, just because of the
> interface,
For the exact same reason I prefer sage-support...
In any case, I believe if a user asks on sage-support then it is
impolite to ask him/her to go to AskSage and ask the question again, rather
than answering his/her question right away.