Singular
https://www.singular.uni-kl.de/forum/

HELP, how do you write a polynomial with symbols (*) and (^)
https://www.singular.uni-kl.de/forum/viewtopic.php?f=10&t=1841
Page 1 of 1

Author:  ber [ Tue Jul 06, 2010 6:06 pm ]
Post subject:  HELP, how do you write a polynomial with symbols (*) and (^)

Write polynomials in a text file with "write". Singular keeps to the agreement to omit the signs of the product (*) and power (^) between the variables. For example:

ring R=0, (x,y), dp;
poly P=xy2;
P;
=> xy2


I need to write it this way:

=> x*y^2

And then export it.
Singular How can I write in the symbols I need?


Other exemple,

ring R=0, (x,y,z,t,s), dp;

poly Qs=x2+y2-z2-st2;

poly S=x3+y3+z3+xyz+t3;


string sQs=print(Qs,"%s");
string sS=print(S,"%s");

def T=ramificacion_1param(Qs,S); //the calculation procedure
setring T;
divisor_r;
string fichero_text1="divisor_r_unos_Q_"+sQs+"_S_"+sS+".txt";
string fichero_text2="cuadrados_Q_"+sQs+"_S_"+sS+".txt";

write(":w "+fichero_text1,divisor_r_unos);
write(":w "+fichero_text2,cuadrados_R1);


PD: when one defines a ring R = 0 (x (1 .. 3)), dp, Singular shows the polynomial with symbols, but when i define the ring different variable, for example, R = 0 (x, y , Z), dp; shown without symbols.

Author:  gorzel [ Tue Jul 06, 2010 9:02 pm ]
Post subject:  Re: HELP, how do you write a polynomial with symbols (*) and (^)

The solution to your problem comes with system variable short http://www.singular.uni-kl.de/Manual/la ... htm#SEC380

To see the actual value just enter short;

If you set short=0; then the output contains the * and ^

Each time you change the basering, short will be set to its default value which is:

short==1; if all varnames are single letters like x,y,z, but

short==0; if at least one of the varnames consists of more than one letter, e.g. if you use varname like x1,x2,x3 or indexed variables like x(1),x(2),x(3).

This answers your post scriptum (P.D.).

N.B. If you write Singular's polynomials to an extern file,
not only to use it as input for other programs but for later input to Singular itself,
you should always set in advance short=0;, even if the basering does not need the long format with * and ^as input.

Author:  ber [ Mon Jul 12, 2010 7:01 pm ]
Post subject:  Re: HELP, how do you write a polynomial with symbols (*) and (^)

thank you very much! I have far too much time with your help.

Page 1 of 1 All times are UTC + 1 hour [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/