Question: Subtract values of variables in "PolynomialSystem"

Hi,

 

  I have the following code for using "PolynomialSystem" solve equations of polynomial

 

*********

with(SolveTools):

f:=PolynomialSystem({x+y-3, x^2+y^2-5}, {x, y}):

print(x,y);
print(f);
f[1];f[2];
a:=f[1][1];b:=f[1][2];
print(a,b);
c:=-evalf(a);d:=-evalf(b);

****************

 

The output is

***

x, y
{x = 2, y = 1}, {x = 1, y = 2}
{x = 2, y = 1}
{x = 1, y = 2}
x = 2
y = 1
x = 2, y = 1
-x = -2.
-y = -1.

***

From what I have seen, I cannot subtract the values of x and y as 2 and 1. Is there any way that I can get the values of solutions of variables, namely I can assign a variable "a" as 2, and the other variable "b" as 1?

 

Thank you very much!

 

 

 

 

Please Wait...