Polynomial using linear least squares fitting
Show older comments
I want to determining an objective polynomial P(s) by the condition
P(s)=P_pie(s)/(2*sqrt (real (ZL(s))))
P_pie(s) is a polynomial ,P_pie(s)=s-1.266i; ZL(s) is a function of s, which is complex.
the order of P(s)is 4 , so it not only shares the zeros of P_pie(s) but also possibly incorporates extra zeros caused by the ZL(s).
I use polyfit function get the wrong roots of P(s),so I want fix one roots 1.266i of P(s),what linear least squares fitting function should I use to fit P(s).
sorry for my poor English.
Accepted Answer
More Answers (1)
Walter Roberson
on 29 Sep 2018
Edited: Walter Roberson
on 29 Sep 2018
0 votes
You have sqrt() of a function of s. sqrt() only potentially results in a polynomial if the function happened to be raised to an even power (and then you have to worry about sign, as sqrt(x^2) is like sign(x)*x )
You then have that in the denominator. Even if the sqrt() happened to result in a polynomial, the only time you can have function in the denominator and have the result be a polynomial is if the function being divided by is a numeric constant or happens to be the reciprocal of a polynomial.
In other words, it is very likely that you do not have a polynomial and so you cannot use linear least squares. You will need to use nonlinear least squares.
"the order of P(s)is 4"
That is quite unlikely. ZL(s) would have to be a polynomial raised to -2 and P_pie would have to be a polynomial of degree 2.
4 Comments
jiang tao
on 29 Sep 2018
Walter Roberson
on 29 Sep 2018
Your ZL is a polynomial, so it has as many zeros as its maximum degree, and is infinite at +/- infinity. Taking the sqrt() of that will have zeros and infinities at the same locations. Dividing by that will be infinite at all the places where it was 0, and zero at the places it was infinite.
This is not something you can reproduce with any polynomial. Every polynomial must be +/- infinity at +/- infinity, but your system will not necessarily be infinite or even defined: it would depend upon the relative rates at which your two polynomials went to infinity.
Bruno Luong
on 29 Sep 2018
Edited: Bruno Luong
on 29 Sep 2018
Your ZL is a polynomial
I don't think he ever said that. If P s polynomial the ZL is a fraction of 2 polynomials (and a square of it).
Walter Roberson
on 29 Sep 2018
Edited: Walter Roberson
on 29 Sep 2018
Ah, correct, they said ZL is a function, without saying it was a polynomial.
Then: in order for the overall system to be reasonably approximated by a polynomial, then ZL would have to be be +/-0 at +/- infinity and non-zero anywhere else -- though oddly it could be infinite in-between, as long as it was non-zero.
Categories
Find more on Polynomials in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!