restart needsPackage "NumericalAlgebraicGeometry" R=QQ[x,y,z,MonomialOrder=>Lex] I=ideal(x^2+y^2+z^2-1,x^2+z^2-y,x-z) I=ideal groebnerBasis I dim I --we expect 4 solutions degree I --find the roots f=I_0 S=CC[z] F = {sub(f,S)}; s = solveSystem F I --first point ((coordinates s_0)_0)--z 2*((coordinates s_0)_0)^2--y ((coordinates s_0)_0)--x --second point ((coordinates s_1)_0)--z 2*((coordinates s_1)_0)^2--y ((coordinates s_1)_0)--x --third point ((coordinates s_2)_0)--z 2*((coordinates s_2)_0)^2--y ((coordinates s_2)_0)--x --fourth point ((coordinates s_3)_0)--z 2*((coordinates s_3)_0)^2--y ((coordinates s_3)_0)--x restart needsPackage "NumericalAlgebraicGeometry" R=QQ[lam,x,y,z,MonomialOrder=>Lex] --Suppose we want to minimize x^3 + 2xyz - z^2 on a --sphere of radius 1, i.e. with the constraint x^2+y^2+z^2=1 --Use Lagrange Multipliers I=ideal(3*x^2 + 2*y*z - 2*x*lam,2*x*z - 2*y*lam, 2*x*y - 2*z - 2*z*lam, x^2+y^2+z^2-1); --Compute a GB I=ideal groebnerBasis I --We expect 12 (complex) solution points (working through 7 are real) degree I dim I --find the roots f=I_0 S=CC[z] F = {sub(f,S)}; s = solveSystem F --z = 0, ±1, ±2/3, ± sqrt(11)/(8*sqrt(2)). --for each value of z we get one value of y I_1 --i.e. for z =-2/3 f=sub(I_1,R_3=>-2/3) --so y= -27/81 I_2 --Also for z =-2/3 in the next eq.. f=sub(I_2,R_3=>-2/3) --this gives y=1/3 sqrt(3/27) --also plug all z's into.. I_3 I_4 --Now x's... take each pair of (z,y) and sub in I_5 f=sub(I_5,{R_2=>-1/3,R_3=>-2/3}) --x= -(3/9)*(7670/3835) --and so on... ---------------- --Elimination Example -------------- restart R=QQ[t,x,y,z,MonomialOrder=>Lex] I=ideal(x-t^4,y-t^3,z-t^2) I=ideal groebnerBasis I --We hope (and it is true! :) ) --that I=ideal(I_0,I_1) --are implicit eqs for the parametric curve