Michael Thomas Flanagan's Java Scientific Library

PlotPoleZero Class:      Plotting Poles and Zeros

     

Last update: 12 August 2008
Main Page of Michael Thomas Flanagan Java Scientific Library

This class contains constructors and methods for calculating the poles and zeros of a transfer function, of the form, polynomial/polynomial, and ploting them on an s- or z-plane graph and writing the results to a text file. The poles and zeros, if known, may alternatively be entered directly.

import directive: import flanagan.plot.PlotPoleZero; Related classes:

SUMMARY OF CONSTRUCTORS AND METHODS

Constructors public void PlotPoleZero(ComplexPoly numerPoly, ComplexPoly denomPoly)
public void PlotPoleZero(Complex[ ] numerCoeff, Complex[ ] denomCoeff)
public void PlotPoleZero(double[ ] numerCoeff, double[] denomCoeff)
public void PlotPoleZero()
Set the numerator public void setNumerator(ComplexPoly numerPoly)
public void setNumerator(Complex[ ] numerCoeff)
public void setNumerator(double[ ] numerCoeff)
Set the denominator public void setDenominator(ComplexPoly denomPoly)
public void setDenominator(Complex[ ] denomCoeff)
public void setDenominator(double[ ] denomCoeff)
Set the zeros directly public void setZeros(Complex[] zeros)
public void setZeros(double[] zeros)
Set the poles directly public void setPoles(Complex[] poles)
public void setPoles(double[] poles)
Choose s-plane plot public void setS()
Choose z-plane plot public void setZ()
Set unit axes public void setUnitAxes()
Set equal axes public void setEqualAxes()
Set scale factor public void setScaleFactor()
Find roots and plot graph public Complex[] pzPlot(String title)
public Complex[] pzPlot()

CONSTRUCTORS AND METHODS

CONSTRUCTORS
public void PlotPoleZero(ComplexPoly numerPoly, ComplexPoly denomPoly)
public void PlotPoleZero(Complex[ ] numerCoeff, Complex[ ] denomCoeff)
public void PlotPoleZero(double[ ] numerCoeff, double[ ] denomCoeff)
public void PlotPoleZero()
Usage:                      PlotPoleZero ppz = new PlotPoleZero(numerator, denominator);
Creates a new instance of PlotPoleZero for finding and plotting the poles and zeros of a transfer function of the form, polynomial/polynomial. The numerator (argument numerator) and denominator (argument denominator) may be entered as polynomials (type ComplexPoly) or as arrays of the coefficients of the polynomials. The array of coefficients may be complex (type Complex[]) or real (type double[]). The coefficients must be in the order corresponding to a polynomial of the form:
coeff[0] + coeff[1].s + coeff[2].s^2 + coeff[3].s^3 . . .
If no zeros are to be plotted the first argument, e.g. numerCoeff in the above usage, may be entered as null.
If no poles are to be plotted the second argument, e.g. denomCoeff in the above usage, may be entered as null.

Usage:                      PlotPoleZero ppz = new PlotPoleZero();
Creates a new instance of PlotPoleZero for finding and plotting the poles and/or zeros of a transfer function of the form, polynomial/polynomial, where the coefficients of the polynomials are to be entered using either setNumerator() and setDenominator() or setZeros() and setPoles() (below).



SET THE NUMERATOR
public void setNumerator(ComplexPoly numerPoly)
public void setNumerator(Complex[ ] numerCoeff)
public void setNumerator(double[ ] numerCoeff)
Usage:                      ppz.setNumerator(numerator);
Enters the numerator (argument numerator) of a transfer function of the form, polynomial/polynomial. The numerator may be entered as a polynomial (type ComplexPoly) or as an array of the coefficients of the polynomial. The array of coefficients may be complex (type Complex[]) or real (type double[]). The coefficients must be in the order corresponding to a polynomial of the form:
coeff[0] + coeff[1].s + coeff[2].s^2 + coeff[3].s^3 . . .



SET THE DENOMINATOR
public void setDenominator(ComplexPoly denomPoly)
public void setDenominator(Complex[ ] denomCoeff)
public void setDenominator(double[ ] denomCoeff)
Usage:                      ppz.setDenominator(denominator);
Enters the denominator (argument denominator) of a transfer function of the form, polynomial/polynomial. The denominator may be entered as a polynomial (type ComplexPoly) or as an array of the coefficients of the polynomial. The array of coefficients may be complex (type Complex[]) or real (type double[]). The coefficients must be in the order corresponding to a polynomial of the form:
coeff[0] + coeff[1].s + coeff[2].s^2 + coeff[3].s^3 . . .



ENTER THE ZEROS DIRECTLY
public void setZeros(Complex[ ] zeros)
public void setZeros(double[ ] zeros)
Usage:                      ppz.setZeros(zeros);
Enters the zeros directly. The zeros may be passed as an array of Complex or as an array of doubles.



ENTER THE POLES DIRECTLY
public void setPoles(Complex[ ] poles)
public void setPoles(double[ ] poles)
Usage:                      ppz.setPoles(poles);
Enters the poles directly. The poles may be passed as an array of Complex or as an array of doubles.



SET THE PLOT TO AN s-PLANE PLOT
public void setS()
Usage:                      ppz.setS();
See setZ (below) for choosing a z-plane plot.



SET THE PLOT TO AN z-PLANE PLOT
public void setZ()
Usage:                      ppz.setZ();
See setS (above) for choosing an s-plane plot.



SET THE AXES SPAN TO +1 TO -1
public void setUnitAxes()
Usage:                      ppz.setUnitAxes();
An optional method that:
See setEqualAxes (below) for setting axes to equal length.



SET THE AXES SPAN TO BE THE SAME FOR BOTH AXES
public void setEqualAxes()
Usage:                      ppz.setEqualAxes();
An optional method that:
See setUnitAxes (above) for setting axes to unit circle diameter.



SET THE OVERALL SIZE OF THE PLOT
public void setScaleFactor()
Usage:                      ppz.setScaleFactor();



FIND ROOTS AND PLOT POLES AND ZEROS
public Complex[] pzPlot(String title)
public Complex[] pzPlot()
Usage:
                     ppz.pzPlot(title);
                     ppz.pzPlot();

or
                     zerosAndPoles = ppz.pzPlot(title);
                     zerosAndPoles = ppz.pzPlot();




OTHER CLASSES USED BY THIS CLASS

This class uses the following classes in this library:



This page was prepared by Dr Michael Thomas Flanagan