[scilab-Users] transforming the polynomial variable

Samuel GOUGEON Samuel.Gougeon at univ-lemans.fr
Mon Nov 8 18:59:19 CET 2010


  ----- Message d'origine -----
De : Sam Mathew
Date : 08/11/2010 05:10:
> Thanks Samuel for that solution. Just that I'm not able to figure out the 
> explanation for the last part:
>
>
>         Is it possible to also perform such transformations if a function is
>         of two
>         variables x and y, and the coordinate axes undergo different
>         transformations
>         (translation, rotation, etc.).
>
>
>     _It could be, whether the polynomial could be applied to a
>     matrix (it can) in a matrix way. But it is not the case :
>     horner() works on a matrix only in a element-wise way._
>

You are right, it is a bit obscure, and somewhat useless.
I was just wondering about a way to implement
bi-variate polynomials with matrices.
// Let
x=grand(4,1,"uin",0,9)
// be the coefficients of p(x)
  x  =
     2.
     2.
     4.
     5.
// and
y=grand(1,3,"uin",0,9)
// be the coefficients of q(y)
  y  =
     4.    1.    9.
// Then, the coefficients of P(x,y)=p(x).q(y) are in the matrix x*y
P=x*y
  P  =
     8.     2.    18.
     8.     2.    18.
     16.    4.    36.
     20.    5.    45.
// where P(i,j) is the coeff of the x^(i-1).y^(j-1) term

 From there, it should be possible to write a library of matrix-based
functions implementing operations between bi-variates polynomials,
or even N-variates polynomials (through hypermatrices).

Then, the evaluation of such polynomials could not be done with any
horner() algo, that does not fit for that, even if it could be called in
a matrix-oriented way.

For instance, for x=2 and y=3, the following would be required:

[X,Y] = ndgrid(x^(0:size(P,1)-1),y^(0:size(P,2)-1))
Result = sum(P.*X.*Y)  // evaluates P(x=2,y=3)

Other functions would be required for multiplying by-variate polynomials
with each others, etc

Besides all this stuff, it could be worthwhile to implement a horner()
release applicable in a matrix-wise way, instead of a element-wise one.
But this has nothing to do with multivariate polynomials.

Samuel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20101108/e8e69ae0/attachment.htm>


More information about the users mailing list