Loading [MathJax]/jax/output/HTML-CSS/jax.js

First time here? Check out the FAQ!

Ask Your Question
1

Sage cannot solve non-linear polynomial systems symbolically!

asked 0 years ago

l3gi0n gravatar image
x, y, z = var('x y z')
eq1 = x + y + z == 2
eq2 = x^2 + 2*y + 3*z == 4
eq3 = x + y + z^2 == 10
show(solve([eq1,eq2,eq3],x,y,z))

This gives me numerical solutions.

in Mathematica:

{eq1, eq2, eq3} = {x + y + z == 2, x^2 + 2*y + 3*z ==4, x + y + z^2 == 10};
Solve[{eq1, eq2, eq3}, {x, y, z}]

gives me symbolic solutions.

Any way to get symbolic solutions in sagemath ?

Preview: (hide)

Comments

You mean solutions involving square roots etc. ( like 12(2i2(331)) ) rather than floating point results, right? You should force the integers to be symbols. The following is a "impractical" workaround:

x, y, z = var('x y z')
var('a,b,c')
eq1 = x + y + z == a
eq2 = x^2 + 2*y + 3*z == b
eq3 = x + y + z^2 == c
soln=solve([eq1,eq2,eq3],x,y,z)
show(soln[0][0].rhs().subs(a=2,b=4,c=10))
tolga gravatar imagetolga ( 0 years ago )

Tip: in the Ask Sage search box, type: polynomial system.

slelievre gravatar imageslelievre ( 0 years ago )

1 Answer

Sort by » oldest newest most voted
2

answered 0 years ago

Max Alekseyev gravatar image

updated 0 years ago

Solution via ideals machinery

R.<x, y, z> = QQbar[]
eq1 = x + y + z - 2
eq2 = x^2 + 2*y + 3*z - 4
eq3 = x + y + z^2 - 10
V = ideal([eq1,eq2,eq3]).variety()
for p in V:
    show( {v:e.radical_expression() for v,e in p.items()} )

Results can be seen at Sagecell.

Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 0 years ago

Seen: 63 times

Last updated: Apr 26