PolyTools: A Polynomial Toolbox for Matlab®

DOWNLOAD: PolyTools

Untitled

Developed at The Computational Hydrodynamics and Informatics Laboratory (The CHIL) at The Ohio State University, PolyTools provides a collection of functions intended to expand the existing collection of polynomial (poly) functions already available in MATLAB®, which include, for example, polyval, polyder, polyfit, etc, and to extend, in a simple way, this type of functionality to bipolynomials (or bivariate polynomials). With its extensive documentation, which includes a number of worked examples, it is also meant to serve as an educational resource for students and researchers.

Functions

The functions currently available in PolyTools fall into one of two categories ─ those that expand the existing (univariate) polynomial functions already available in MATLAB®, which have a poly prefix, and those that extend these ideas to the bivariate case, which have a bipoly prefix. These functions include:
Detailed descriptions of each bipoly and poly function, with examples, are available in the links above. PolyTools is under continual development. Check back here for updates.

General Description

Central to the use of the functions in PolyTools is the MATLAB® representation of polynomials, or the MATLAB® polynomial form, which represents the polynomial as a row vector containing coefficients ordered by descending powers. For example, the polynomials
would be represented by the row vectors
p = [ 4 0 1 8 ];
q = [ 1 0 1 3 0 ];
respectively, where it is important to note that all terms less than the leading power that have a coefficient of zero must be entered into the vector as a placeholder for that particular power of x (e.g., for and and (the constant term) for ). In general form, a polynomial of degree n, i.e.,
is represented by the row vector
The bipolynomial (bipoly) functions available in PolyTools extend this approach to bipolynomials (that is, functions of two variables with nonnegative integer exponents) by representing them as matrices. For example, the bipolynomial
would be represented by the matrix
P = [ 1 0 -1; 0 0 0; -1 0 1 ];
where, analogous to the univariate case, it is important to note that all terms less than the leading power that have a coefficient of zero must be entered into the matrix as a placeholder for that particular power of . It is instructive to write out the matrix in the tabular form
so that the analogy to the single-variable polynomial form can be seen more clearly. In general form, a bipolynomial of (at most) degree m in x and degree n in y, i.e.,
is represented by the matrix
It is also instructive to note that for any bipolynomial that can be written as the product of two polynomials, one in x and one in y, i.e.,
its bipoly form can be easily obtained by taking the outer (or tensor) product (usually defined as the matrix multiplication of a column and row vector) of the two univariate MATLAB® polynomial forms. For example, the bipolynomial considered above can be written in the factored form
Then, by defining p and q in MATLAB® polynomial form, i.e.,
p = [ 1 0 -1 ]; q = [ 1 0 -1 ];
the bipolynomial form can be easily obtained by
P = q’*p
P = 3×3
1 0 -1
0 0 0
-1 0 1
which is equal to the matrix P above.