PC Review


Reply
Thread Tools Rate Thread

complex numbers with excel

 
 
Andrew
Guest
Posts: n/a
 
      31st Mar 2009
Hello,
I am trying to find the complex roots of a polynomial using Excel. If
I have the polynomial s^2-5s+1000, I should get the roots to be 31.6
angle 85.4 and 31.6 angle -85.4. How do I do this calculation in
excel?

thanks
 
Reply With Quote
 
 
 
 
joel
Guest
Posts: n/a
 
      31st Mar 2009
y= (-b+/-sqrt(b^2-4ac))/2a

y=(5+/-sqrt(5^2-4(1000))/2

y=2.5+31.52i
and
y=2.5-31.52i


the angle in radians is
atan(31.42/2.5)

convert radians to angles mult by 180/pi = 85.46

the length = sqrt((31.42^2)+(2.5^2)) = 31.62


follow same steps for 2nd root.


"Andrew" wrote:

> Hello,
> I am trying to find the complex roots of a polynomial using Excel. If
> I have the polynomial s^2-5s+1000, I should get the roots to be 31.6
> angle 85.4 and 31.6 angle -85.4. How do I do this calculation in
> excel?
>
> thanks
>

 
Reply With Quote
 
jasontferrell
Guest
Posts: n/a
 
      31st Mar 2009
I'm a little rusty on complex numbers, so I'm not getting what you say
the answer should be, but here's what I did. I separated the formula
into imaginary and real parts. Taking the complex portion to be a+bi,
I came up with:
(a+bi)*(a+bi)-5(a+bi)+1000
=
a^2+abi+abi+bi^2-5a-5bi+1000
=
a^2-b^2-5a+1000 (real)
2abi-5bi (imaginary)
Next, I put the last two formulas into individual cells. Let's say a
is in A6, b is in B6, the real formula is A11, and the imaginary
formula is B11. I ran solver to set cell A11 equal to 0 subject to
the constraint of B11 also being 0, by changing cells A6:B6.
However, I came up with a=2.5 and b=31.5238
I think I am doing something wrong, because I cannot get two
solutions, but does this technique of separating real and imaginary
and using solver help you?
 
Reply With Quote
 
Dana DeLouis
Guest
Posts: n/a
 
      31st Mar 2009
Andrew wrote:
> Hello,
> I am trying to find the complex roots of a polynomial using Excel. If
> I have the polynomial s^2-5s+1000, I should get the roots to be 31.6
> angle 85.4 and 31.6 angle -85.4. How do I do this calculation in
> excel?


Hi. One of a few ways...
Assume this equation in B1, with b= -5, and k = +1000

'complex solution...
=IMDIV(IMSUB(IMSQRT(b^2-4*k),b),2)

' Magnitude
=IMABS(B1)

'Angle (other angle is opposite sign)
=DEGREES(ATAN2(IMREAL(B1),IMAGINARY(B1)))

Returns:

2.5+31.5238005322962i
31.6227766
85.46563923

= = =
HTH
Dana DeLouis
 
Reply With Quote
 
Andy
Guest
Posts: n/a
 
      1st Apr 2009
On Mar 31, 3:16*pm, Dana DeLouis <ddelo...@bellsouth.net> wrote:
> Andrew wrote:
> > Hello,
> > I am trying to find the complex roots of a polynomial using Excel. *If
> > I have the polynomial s^2-5s+1000, I should get the roots to be 31.6
> > angle 85.4 and 31.6 angle -85.4. *How do I do this calculation in
> > excel?

>
> Hi. *One of a few ways...
> Assume this equation in B1, with b= -5, and k = +1000
>
> 'complex solution...
> =IMDIV(IMSUB(IMSQRT(b^2-4*k),b),2)
>
> ' Magnitude
> =IMABS(B1)
>
> 'Angle *(other angle is opposite sign)
> =DEGREES(ATAN2(IMREAL(B1),IMAGINARY(B1)))
>
> Returns:
>
> 2.5+31.5238005322962i
> 31.6227766
> 85.46563923
>
> = = =
> HTH
> Dana DeLouis


Thanks for your help.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Complex numbers in excel knutso Microsoft Excel Programming 1 25th Nov 2007 01:33 PM
import complex numbers to excel =?Utf-8?B?d2Fib2RpZQ==?= Microsoft Excel Worksheet Functions 0 9th Sep 2006 07:31 PM
import complex numbers to excel =?Utf-8?B?d2Fib2RpZQ==?= Microsoft Excel Worksheet Functions 0 9th Sep 2006 07:31 PM
Complex Numbers in Excel? =?ISO-8859-15?Q?Oliver_Gr=E4ser?= Microsoft Excel Programming 1 19th Jun 2006 01:40 PM
Complex numbers in VBA (Excel( levent Microsoft Excel Programming 2 22nd Jul 2004 08:58 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:16 PM.