next up previous contents
Next: Exercise 11 Up: Working with Jasymca Previous: Exercise 10 (Plotting)

Polynomials (1)

Jasymca can handle polynomials with symbolic variables. In this chapter, however, we work with the Matlab/Octave/Scilab-approach of using vectors as list of polynomial coefficients: A polynomial of degree $n$ is represented by a vector having $n+1$ elements, the element with index $1$ being the coefficient of the highest exponent in the polynomial. With poly(x) a normal polynomial is created, whose zeros are the elements of x, polyval(a,x) returns functionvalues of the polynomial with coefficients a in the point x, roots(a) calculates the zeros, and polyfit(x,y,n) calculates the coefficients of the polynomial of degree $n$, whose graph passes through the points x ynd y. If their number is larger than $n+1$ a least square estimate is performed. The regression analysis in exercise 8 was performed using this method.



Helmut Dersch