# Singular

 Note: If not registered, provide any username. For more comfort, register here.
Subject:
Message body:
Enter your message here, it may contain no more than 60000 characters.

 Smilies
 Font size: Tiny Small Normal Large Huge Font colour [quote="gorzel"]Standard basis computations over the reals are not numerical stable. [b]Solve[/b] makes internal a check [code] dim(std(i))==0[/code] but in your example the ideal is reduced to the constant 1, defining the empty set with dimension -1. At that point [b]solve[/b] stopped with an ERROR message. I the second example you gave the input has rational (integer) coefficients but in your post it is not indicated what kind of basering you have chosen. It may work over the reals, but you get preciser (integer) results when you call it within [code]ring r =0,(x,y,z),dp; [/code] General rules how to use solve: [list] 1. Work over the Q[x,y,z] 2. if (size(variables(I)) < nvars(basering)) then reduce the variables in the defined ring 3. if (dim(std(I)) > 0) then make a primary decomposition (or call facstd) to separate the higher dimensional components. 4. If (dim(std(I)==0) then vdim(std(I)) gives the number of solutions counted with multplicities 5. call solve(I,[...]). [/list] You could fetch your input to the rationals (but if the input were rounded numbers, the exact rationals are not precise) [code] > ring r0 = 0,(x,y,z),dp; > ideal I = imap(s,i_ideal); > dim(std(I)); 0 > vdim(std(I)); 8 > solve(I); // eight solutions, two of them are complex [/code] A naive method to filter the complex solutions is to check whether the parameter [i]i[/i] occurs: [code] for (int j=1;j<=ncols(SOL);j++) { if (!find(string(SOL[j]),"i)) { SOL[j]; } } [/code][/quote]
Options:
 BBCode is ON [img] is ON [flash] is OFF [url] is ON Smilies are ON
 Disable BBCode Disable smilies Do not automatically parse URLs
Confirmation of post
To prevent automated posts the board requires you to enter a confirmation code. The code is displayed in the image you should see below. If you are visually impaired or cannot otherwise read this code please contact the %sBoard Administrator%s.
Confirmation code:
Enter the code exactly as it appears. All letters are case insensitive, there is no zero.

Topic review - error message "? ideal not zero-dimensional"
Author Message
 machielk
 Post subject: Re: error message "? ideal not zero-dimensional"
 Posted: Thu Mar 16, 2017 1:37 pm
 gorzel
 Post subject: Re: error message "? ideal not zero-dimensional"
 It is not true that three equations in three unknows always define a finite set of solutions.It already fails for three planes in three dimensional space when the planes meet in a common axis.To see the difference between the rings, use Singular as a calculator and do some simple experiments:Code:ring rr=real,x,dp;2/3+1/5ring r0 = 0,x,dp;2/3+1/5;As I explained in my first answer, the problem is that the standard basis computation over thereals is not stable. It "destroys" the defining equation. Call std(i_ideal); to see what I mean.If you work over the rationals, then the coefficients are always exact fractions and there is noproblem with inaccuray. Numerical solving, i.e. compuations over the reals ,should be the lastnot the first step.-----P.S.: With the User Control Panel of this forum it should be possible to configure automatic notification. It is not true that three equations in three unknows always define a finite set of solutions.It already fails for three planes in three dimensional space when the planes meet in a common axis.To see the difference between the rings, use Singular as a calculator and do some simple experiments:[code]ring rr=real,x,dp;2/3+1/5ring r0 = 0,x,dp;2/3+1/5;[/code]As I explained in my first answer, the problem is that the standard basis computation over thereals is not stable. It "destroys" the defining equation. Call std(i_ideal); to see what I mean.If you work over the rationals, then the coefficients are always exact fractions and there is noproblem with inaccuray. Numerical solving, i.e. compuations over the reals ,should be the lastnot the first step.-----P.S.: With the[b] User Control Panel [/b] of this forum it should be possible to configure automatic notification.
 Posted: Wed Mar 15, 2017 10:21 pm
 machielk
 Post subject: Re: error message "? ideal not zero-dimensional"
 I am not familiar with Maple. However, in your example, you put Code:ring r0 = 0,(x,y,z),dp;According to the manual, this means a ring of "rationals". Indeed I have to put this line, because without it, the code complains that the ideal is not zero-dimensional. (Which does not make sense either, because a set of 3 equations with 3 unknowns actually is zero-dimensional, right?). What I don't see is why I have to create a ring of rationals, given that both the solutions as the coordinates of the polynomials are not rationals but reals.By the way (unrelated), how can I configure this forum so that it sends me an email automatically when there is an answer in this thread? I am not familiar with Maple. However, in your example, you put [code]ring r0 = 0,(x,y,z),dp;[/code]According to the manual, this means a ring of "rationals". Indeed I have to put this line, because without it, the code complains that the ideal is not zero-dimensional. (Which does not make sense either, because a set of 3 equations with 3 unknowns actually is zero-dimensional, right?). What I don't see is why I have to create a ring of rationals, given that both the solutions as the coordinates of the polynomials are not rationals but reals.By the way (unrelated), how can I configure this forum so that it sends me an email automatically when there is an answer in this thread?
 Posted: Wed Mar 15, 2017 6:30 pm
 gorzel
 Post subject: Re: error message "? ideal not zero-dimensional"
 Consult Singular's online manual, start with 2.3 Getting started http://www.singular.uni-kl.de/Manual/latest/sing_5.htm#SEC11and follow the links given there.Some hints o clearify what is going on there:In computations with Maple, you have to specify at each command what the variables are,but Singular uses a different concept.You specify a ring, as a first idea it is a polynomial ring over a field, by defining the characteristic of the coefficient, the names of the variables and the ordering of the terms.You give the ring a name. e.g. r0, and this is then basering you are working in.With this definition you working so to speak in a "categeory". You can defined several rings, switch between them by calling setring and transfer the objectswhich can be ideals, numbers, matrices etc. by calling imap, fetch, map. Consult Singular's online manual, start with [b]2.3 Getting started [/b][url]http://www.singular.uni-kl.de/Manual/latest/sing_5.htm#SEC11[/url]and follow the links given there.Some hints o clearify what is going on there:In computations with Maple, you have to specify at each command what the variables are,but Singular uses a different concept.You specify a ring, as a first idea it is a polynomial ring over a field, by defining the characteristic of the coefficient, the names of the variables and the ordering of the terms.You give the ring a name. e.g. r0, and this is then [b]basering[/b] you are working in.With this definition you working so to speak in a "categeory". You can defined several rings, switch between them by calling [b]setring[/b] and transfer the objectswhich can be [b]ideals[/b], [b]numbers[/b], [b]matrices[/b] etc. by calling [b]imap[/b], [b]fetch[/b], [b]map[/b].
 Posted: Wed Mar 15, 2017 4:13 pm
 machielk
 Post subject: Re: error message "? ideal not zero-dimensional"
 Posted: Mon Mar 13, 2017 6:40 pm
 gorzel
 Post subject: Re: error message "? ideal not zero-dimensional"
 Standard basis computations over the reals are not numerical stable.Solve makes internal a check Code: dim(std(i))==0but in your example the ideal is reduced to the constant 1, defining the empty set with dimension -1. At that point solve stopped with an ERROR message.I the second example you gave the input has rational (integer) coefficientsbut in your post it is not indicated what kind of basering you have chosen.It may work over the reals, but you get preciser (integer) results when you call it within Code:ring r =0,(x,y,z),dp; General rules how to use solve:1. Work over the Q[x,y,z]2. if (size(variables(I)) < nvars(basering)) then reduce the variables in the defined ring 3. if (dim(std(I)) > 0) then make a primary decomposition (or call facstd) to separate the higher dimensional components. 4. If (dim(std(I)==0) then vdim(std(I)) gives the number of solutions counted with multplicities 5. call solve(I,[...]). You could fetch your input to the rationals (but if the input were rounded numbers, the exact rationals are not precise)Code:> ring r0 = 0,(x,y,z),dp;> ideal I = imap(s,i_ideal);> dim(std(I));0> vdim(std(I));8> solve(I);// eight solutions, two of them are complexA naive method to filter the complex solutions is to check whetherthe parameter i occurs:Code: for (int j=1;j<=ncols(SOL);j++) {   if (!find(string(SOL[j]),"i)) { SOL[j]; }} Standard basis computations over the reals are not numerical stable.[b]Solve[/b] makes internal a check [code] dim(std(i))==0[/code]but in your example the ideal is reduced to the constant 1, defining the empty set with dimension -1. At that point [b]solve[/b] stopped with an ERROR message.I the second example you gave the input has rational (integer) coefficientsbut in your post it is not indicated what kind of basering you have chosen.It may work over the reals, but you get preciser (integer) results when you call it within [code]ring r =0,(x,y,z),dp; [/code]General rules how to use solve:[list]1. Work over the Q[x,y,z]2. if (size(variables(I)) < nvars(basering)) then reduce the variables in the defined ring 3. if (dim(std(I)) > 0) then make a primary decomposition (or call facstd) to separate the higher dimensional components. 4. If (dim(std(I)==0) then vdim(std(I)) gives the number of solutions counted with multplicities 5. call solve(I,[...]). [/list]You could fetch your input to the rationals (but if the input were rounded numbers, the exact rationals are not precise)[code]> ring r0 = 0,(x,y,z),dp;> ideal I = imap(s,i_ideal);> dim(std(I));0> vdim(std(I));8> solve(I);// eight solutions, two of them are complex[/code]A naive method to filter the complex solutions is to check whetherthe parameter [i]i[/i] occurs:[code] for (int j=1;j<=ncols(SOL);j++) { if (!find(string(SOL[j]),"i)) { SOL[j]; }}[/code]
 Posted: Fri Mar 10, 2017 6:09 pm
 machielk
 Post subject: error message "? ideal not zero-dimensional"
 Hello, I execute the following code: Code:ring s = real,(x,y,z),dp;poly f = 723.056*x^2 + 12470.8*x*y - 86766.7*x + 7923.06*y^2 - 748246*y - 2876.94*z^2 + 8630.83*z + 2.59653e+06;poly g = 10806.8*x^2 + 648407*x - 3593.22*y^2  + 373419*y - 3593.22*z^2  + 10779.7*z + 16315;poly h = -782.305*x^2 - 12470.8*x*y - 694938*x + 6417.69*y^2  + 292823*y - 4382.31*z^2 + 13146.9*z - 2.82616e+06;ideal i_ideal=f,g,h;option(redSB);LIB "solve.lib";def T=solve(i_ideal, 5, 0, "nodisplay");I get the error message: Quote:? ideal not zero-dimensionalWhy? What does that mean? If I try a different set of polynomials, e.g.Quote:poly f = 4*x^2 + 2*x*y + 3*x*z + 2*y*z + y^2 + z^2 - 42; poly g = 6*x^2 + x*y - x*z - y*z + y^2 + z^2 - 12; poly h = x^2 - x*y - 2*y^2 - 3*z^2 + 36;the script works fine. However, with the previous set and different software, I do find solutions, so it's not a set without solutions. By the way, another question is: when I want to print the solutions, I could only find the methodCode:setring T;SOL;However, this gives all complex solutions. Is there a way to print out only the real solutions? Many thanks, Machiel Hello, I execute the following code: [code]ring s = real,(x,y,z),dp;poly f = 723.056*x^2 + 12470.8*x*y - 86766.7*x + 7923.06*y^2 - 748246*y - 2876.94*z^2 + 8630.83*z + 2.59653e+06;poly g = 10806.8*x^2 + 648407*x - 3593.22*y^2 + 373419*y - 3593.22*z^2 + 10779.7*z + 16315;poly h = -782.305*x^2 - 12470.8*x*y - 694938*x + 6417.69*y^2 + 292823*y - 4382.31*z^2 + 13146.9*z - 2.82616e+06;ideal i_ideal=f,g,h;option(redSB);LIB "solve.lib";def T=solve(i_ideal, 5, 0, "nodisplay");[/code]I get the error message: [quote]? ideal not zero-dimensional[/quote]Why? What does that mean? If I try a different set of polynomials, e.g.[quote]poly f = 4*x^2 + 2*x*y + 3*x*z + 2*y*z + y^2 + z^2 - 42; poly g = 6*x^2 + x*y - x*z - y*z + y^2 + z^2 - 12; poly h = x^2 - x*y - 2*y^2 - 3*z^2 + 36;[/quote]the script works fine. However, with the previous set and different software, I do find solutions, so it's not a set without solutions. By the way, another question is: when I want to print the solutions, I could only find the method[code]setring T;SOL;[/code]However, this gives all complex solutions. Is there a way to print out only the real solutions? Many thanks, Machiel
 Posted: Fri Mar 10, 2017 11:59 am

 It is currently Tue Oct 16, 2018 11:18 pm