Ask Your Question

Revision history [back]

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. I do get numbers when I change the known value of "K" in the 2nd line to 4.48e-10 or bigger. 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!

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=2xi+yi+2zi==2x+y+2z

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]

click to hide/show revision 2
None

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. I do get numbers when I change the known value of "K" in the 2nd line to 4.48e-10 or bigger. 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!

var('x,y,z')

var('x,y,z')
 K=4.48e-13
 

K=4.48e-13

xi=0.75 yi=0

xi=0.75

zi=0 eq1=K==y^2*z/x^2

yi=0

eq2=xi+yi==x+y eq3=2*xi+yi+2*zi==2*x+y+2*z

zi=0

eq1=K==y^2*z/x^2

eq2=xi+yi==x+y

eq3=2xi+yi+2zi==2x+y+2z

solns = solve([eq1,eq2,eq3],x,y,z,solution_dict=True)

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]

solns]

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!

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]