Solving a system of equations -- small known number hinders the solution
Hello, I'm trying to solve a system of equations in the treatment of an equilibrium system. I don't get any answers when I use the code below as is.
If I define K = 4.48e-13:
var('x,y,z')
K=4.48e-13
xi=0.75
yi=0
zi=0
eq1=K==y^2*z/x^2
eq2=xi+yi==x+y
eq3=2*xi+yi+2*zi==2*x+y+2*z
solns = solve([eq1,eq2,eq3],x,y,z,solution_dict=True)
[[s[x].n(30), s[y].n(30), s[z].n(30)] for s in solns]
I get:
[]
I do get numbers when I change the known value of "K" in the 2nd line to 4.48e-10 or bigger.
var('x,y,z')
K=4.48e-10
xi=0.75
yi=0
zi=0
eq1=K==y^2*z/x^2
eq2=xi+yi==x+y
eq3=2*xi+yi+2*zi==2*x+y+2*z
solns = solve([eq1,eq2,eq3],x,y,z,solution_dict=True)
[[s[x].n(30), s[y].n(30), s[z].n(30)] for s in solns]
[[0.75039762 - 0.00068968040I, -0.00039762382 + 0.00068968023I, -0.00019881201 + 0.00034484028I], [0.75039762 + 0.00068968040I, -0.00039762382 - 0.00068968023I, -0.00019881201 - 0.00034484028I], [0.74920475, 0.00079524857, 0.00039762445]]
I did not test past 1e-10. I tried increasing the number of bits to 100 for all 3 unknowns with no luck. Is there any way to solve the problem using SageMath using the smaller number? Thanks!
Welcome to Ask Sage!
To display inline code, use backticks. To display blocks of code or error messages, separate them by a blank line from the rest of the text, and indent them with 4 spaces, or select code lines and click the "code" button (the icon with '101 010').
For instance, typing
will produce:
Can you edit your question to do that?
it would be nice to have that info in the help page. i cannot do it, but maybe someone else can do it.