comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » roots of polynomial on a 2d grid
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
roots of polynomial on a 2d grid [message #5408] Fri, 22 December 1995 00:00
brooker is currently offline  brooker
Messages: 12
Registered: March 1994
Junior Member
folks,

I have a polynomial function of the form

f(u) = c_o + c_1*u + c_2*u^2 + c_3*u^3

and I want to find all the roots of the polynomial. By the roots of the
polynomial I mean the values of u such that f(u)=0. To do this one usually
makes an array coefs=[c_o,c_1,c_2,c_3] and the call

roots=nr_zroots(coefs)

All the roots are then stored in the array roots.

This is all fine but ...

Suppose that instead of just one set of coefficients you have an array of sets
of coefficients. For example consider
c_o=[0,1,3,4]
c_1=[2,2,2,2]
c_2=[4,3,2,1]
c_3=[3,3,4,4]

In order to find the roots must you use a FOR loop like
roots=fltarr(3,4)
for i=0,3 do begin
coefs=[c_o(i),c_1(i),c_2(i),c_3(i)]
roots(*,i)=nr_zroots(coefs)
endfor

Is there any way to find the roots without having to use the for loop??

sorry for the long winded question,

peter brooker
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Need Help With idl library rpcidl.a
Next Topic: Re: 4-bit words

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:40:11 PDT 2025

Total time taken to generate the page: 0.00614 seconds