I have the following problem that I want to solve with Singular.
I have an original system with 2 variables and 3 unknowns:
f0=f(x,y)=0;
f1=dx(f)=0;
f2=dy(y)=0;
where dx, dy represent the partial derivatives w.r.t x and y.
I am constructing an equivalent system:
g1=a*f(x,y)+b*dx(f)+c*dy(f)=0
g2=d*f(x,y)+e*dx(f)+g*dy(f)=0,
where a,b,..g are integers.
I am computing the solutions of the equivalent system using "solve" command from Singular.
Then I want to take this solutions, round them and check which of the rounding solutions verify my original system.
Everything is okay in the source code until I want to substitute the rounding solutions into the original system.
Since the lists of solutions SOL[i][1] is defined in a ring, and since subst is defined in another ring, I cannot seem to find a way to substitute the solutions into the original system.
I used the following commands for solving the equivalent system:
Code:
ideal m=g1,g2;
ideal n = groebner(m);
setring r;
def T=solve(n,30,1,"nodisplay");
and then the following commands for substituting the solutions in the original system:
Code:
int k;
for (k=1; k<=size(SOL); k++){
l[k];
number solAx = l[k][1];
number solAy = l[k][2];
list lsols= list(round(solAx),round(solAy));
lsols[1];lsols[2];
//setring r;
poly f0=-1 + 12*x + 6*x2 + x3 + 6*y - y2;
poly f1=diff(f0,x);
poly f2=diff(f0,y);
setring r;
subst(f0,lsols[1],y,lsols[2]);
subst(f1,x,lsols[1],y,lsols[2]);
subst(f2,x,lsols[1],y,lsols[2]);
setring T;
}
Still I get this error message:
`lsols` is not defined
when compiling since lsols is not recognized in the ring r.
I understand perfectly the error, still since I am a beginner in Singular, I don't seem to understand how should I solve this problem or want I should use from Singular to solve it.
Thank you in advance for any suggestions,
madalina