poly2symb command for multivariable polynomial (list)

Messages in english

Modérateur : xcasadmin

compsystems
Messages : 518
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

poly2symb command for multivariable polynomial (list)

Message par compsystems » ven. déc. 27, 2019 4:21 pm

Hello, an idea =), add in the poly2symb command, an array as a list representation of a multivariable polynomial

univariable polynomials
symb2poly( x^2 + 2*x^1 + 3*x^0, x ) [↵] returns poly1[ 1, 2, 3 ]
poly2symb( poly1[ 1, 2, 3 ], x ) [↵] returns x^2 + 2*x + 3

multivariable polynomial
symb2poly( 10*x^3*y^1 + 12*x^2*y^2, [x, y ] ) [↵] returns %%%{ 10, [ 3, 1 ]%%%}+%%%{ 12 ,[ 2 ,2 ]%%%}
convert( symb2poly( 10*x^3*y^1 + 12*x^2*y^2, [x, y ] ), list ) [↵] returns [ [10, [ 3, 1 ] ], [ 12, [ 2, 2 ]] ]

poly2symb( [ [10, [ 3, 1 ] ], [ 12, [ 2, 2 ]] ], [ x, y ] ) -> 10*x^3*y + 12*x^2*y^2

Reason: it is easier and faster to type a polynomial in its list form or list of lists than the algebraic expression, then the list is converted to symbolic expression with poly2symb cmd

Thanks

parisse
Messages : 5081
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: poly2symb command for multivariable polynomial (list)

Message par parisse » sam. déc. 28, 2019 7:47 pm

This already exists in recursive representation, like this symb2poly( 10*x^3*y^1 + 12*x^2*y^2, x, y )

Répondre