Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: HELP, how do you write a polynomial with symbols (*) and (^)
PostPosted: Tue Jul 06, 2010 6:06 pm 

Joined: Wed May 02, 2007 12:40 pm
Posts: 5
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: HELP, how do you write a polynomial with symbols (*) and (^)
PostPosted: Tue Jul 06, 2010 9:02 pm 

Joined: Wed Mar 03, 2010 5:08 pm
Posts: 108
Location: Germany, Münster
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: HELP, how do you write a polynomial with symbols (*) and (^)
PostPosted: Mon Jul 12, 2010 7:01 pm 

Joined: Wed May 02, 2007 12:40 pm
Posts: 5
thank you very much! I have far too much time with your help.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

It is currently Fri May 13, 2022 11:06 am
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group