Thread Subject: Polynomial roots

Subject: Polynomial roots

From: Pawel

Date: 7 Sep, 2006 05:06:30

Message: 1 of 7

Hello,

I am trying to find roots of a polynomial of the form:

(1-d*x^(-1))*(1-conj(d)*x)-b^2=0

d is complex number,
b is real number,

The main problem is how to make Matlab interpret properly orders of
the polynomial - some of them are negative some positive.

Thanks for any help.

Pawel

Subject: Polynomial roots

From: pisz_na.mirek@dionizos.zind.ikem.pwr.wroc.pl

Date: 7 Sep, 2006 09:30:56

Message: 2 of 7

Pawel <prulikowski@removegmail.com> wrote:
> Hello,
>
> I am trying to find roots of a polynomial of the form:
>
> (1-d*x^(-1))*(1-conj(d)*x)-b^2=0
>
> d is complex number,
> b is real number,
>
> The main problem is how to make Matlab interpret properly orders of
> the polynomial - some of them are negative some positive.

Your equation is equivalent to:

                           2 2 2
                        d x + (- d + b - 1) x + d
                      - ---------------------------- = 0
                                     x

then your answer is: roots([ d, -d^2+b^2-1, d ])
or analitically solved:

                4 2 2 4 2 2 2
          SQRT(d + (- 2 b - 2) d + b - 2 b + 1) - d + b - 1
    x = - --------------------------------------------------------
                                    2 d

                 4 2 2 4 2 2 2
           SQRT(d + (- 2 b - 2) d + b - 2 b + 1) + d - b + 1
    x = --------------------------------------------------------
                                     2 d

Subject: Polynomial roots

From: Sebastian Nowoisky

Date: 7 Sep, 2006 05:31:51

Message: 3 of 7

Hi Pawel,

you schould write the function in Matrixform
like this:

x^3 -3ix^2 +ix -1
c=[1 -3i i -1]

to get the roots of this function use the roots command

roots(c)

ans =

  -0.0020 +16.6079i
  -0.0024 -13.6079i
   0.0044 + 0.0000i

The next MATLAB function, which I remember is the fzero command.

Hope this example help, let me know.

Best regards

Sebastian Nowoisky

 Pawel wrote:
>
>
> Hello,
>
> I am trying to find roots of a polynomial of the form:
>
> (1-d*x^(-1))*(1-conj(d)*x)-b^2=0
>
> d is complex number,
> b is real number,
>
> The main problem is how to make Matlab interpret properly orders of
> the polynomial - some of them are negative some positive.
>
> Thanks for any help.
>
> Pawel

Subject: Polynomial roots

From: John D'Errico

Date: 7 Sep, 2006 05:42:06

Message: 4 of 7

Pawel wrote:
>
>
> Hello,
>
> I am trying to find roots of a polynomial of the form:
>
> (1-d*x^(-1))*(1-conj(d)*x)-b^2=0
>
> d is complex number,
> b is real number,
>
> The main problem is how to make Matlab interpret properly orders of
> the polynomial - some of them are negative some positive.
>
> Thanks for any help.
>
> Pawel
  
This is not a polynomial as roots
can understand it.

However, why not multiply by x?
Then it is of a proper form for
both conv and roots to manipulate.

 (x-d)*(1-conj(d)*x) - x*b^2 = 0

Thus,

 p = conv([1,-d],[[-conj(d),1] - [0,b^2,0];

 roots(p)

Your original post had a product of
n terms of this form, so multiply by
x^n.

HTH,
John D'Errico

Subject: Polynomial roots

From: Pawel

Date: 7 Sep, 2006 06:01:25

Message: 5 of 7

pisz_na.mirek wrote:
>
>
> Pawel <prulikowski@removegmail.com> wrote:
>> Hello,
>>
>> I am trying to find roots of a polynomial of the form:
>>
>> (1-d*x^(-1))*(1-conj(d)*x)-b^2=0
>>
>> d is complex number,
>> b is real number,
>>
>> The main problem is how to make Matlab interpret properly
orders
> of
>> the polynomial - some of them are negative some positive.
>
> Your equation is equivalent to:
>
> 2 2 2
> d x + (- d + b - 1) x + d
> - ---------------------------- = 0
> x
>
> then your answer is: roots([ d, -d^2+b^2-1, d ])
> or analitically solved:
>
> 4 2 2 4 2 2 2
> SQRT(d + (- 2 b - 2) d + b - 2 b + 1) - d + b - 1
> x = - --------------------------------------------------------
> 2 d
>
> 4 2 2 4 2 2 2
> SQRT(d + (- 2 b - 2) d + b - 2 b + 1) + d - b + 1
> x = --------------------------------------------------------
> 2 d
>
>

Hello Mirek,

Thanks a lot for all your suggestions - the problem is slightly more
complicated as the actual, proper equation looks like this:

_N
||[(1-dk*x^(-1))*(1-conj(dk)*x)]-b^2=0
k=1

How would you handle this problem ?

Regards

Pawel

Subject: Polynomial roots

From: pisz_na.mirek@dionizos.zind.ikem.pwr.wroc.pl

Date: 7 Sep, 2006 10:44:55

Message: 6 of 7

Pawel <prulikowski@removegmail.com> wrote:
>
> Hello Mirek,
>
> Thanks a lot for all your suggestions - the problem is slightly more
> complicated as the actual, proper equation looks like this:
>
> _N
> ||[(1-dk*x^(-1))*(1-conj(dk)*x)]-b^2=0
> k=1
>
> How would you handle this problem ?


Is -b^2 outside of Pi (multiplication)? If so then your complex term is
equivalent to
                               2 2
                           dk x + (- dk - 1) x + dk
(%o125) - --------------------------
                                       x

You can remove denominator by multipling your equation by x^N. So matlab
solution is

p=1;
for k=1:N
  p=conv(p,[ -d(k), d(k)^2+1, -d(k) ]);
end;
p(end-N)=p(end-N)+(-b^2); % add -b^2*x^N
roots(p)

Subject: Polynomial roots

From: John D'Errico

Date: 7 Sep, 2006 13:05:36

Message: 7 of 7

In article <ef40263.3@webcrossing.raydaftYaTP>, Pawel <prulikowski@REMOVEgmail.com> wrote:

> pisz_na.mirek wrote:
> >
> >
> > Pawel <prulikowski@removegmail.com> wrote:
> >> Hello,
> >>
> >> I am trying to find roots of a polynomial of the form:
> >>
> >> (1-d*x^(-1))*(1-conj(d)*x)-b^2=0
> >>
> >> d is complex number,
> >> b is real number,
> >>
> >> The main problem is how to make Matlab interpret properly
> orders
> > of
> >> the polynomial - some of them are negative some positive.
> >
> > Your equation is equivalent to:
> >
> > 2 2 2
> > d x + (- d + b - 1) x + d
> > - ---------------------------- = 0
> > x
> >
> > then your answer is: roots([ d, -d^2+b^2-1, d ])
> > or analitically solved:
> >
> > 4 2 2 4 2 2 2
> > SQRT(d + (- 2 b - 2) d + b - 2 b + 1) - d + b - 1
> > x = - --------------------------------------------------------
> > 2 d
> >
> > 4 2 2 4 2 2 2
> > SQRT(d + (- 2 b - 2) d + b - 2 b + 1) + d - b + 1
> > x = --------------------------------------------------------
> > 2 d
> >
> >
>
> Hello Mirek,
>
> Thanks a lot for all your suggestions - the problem is slightly more
> complicated as the actual, proper equation looks like this:
>
> _N
> ||[(1-dk*x^(-1))*(1-conj(dk)*x)]-b^2=0
> k=1
>
> How would you handle this problem ?
>
> Regards
>
> Pawel

All of us have suggested essentially the
same thing.

Multiply by x^N.

Then use roots.

What is the problem?

John


--
The best material model of a cat is another, or preferably the same, cat.
A. Rosenblueth, Philosophy of Science, 1945

Those who can't laugh at themselves leave the job to others.
Anonymous

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com