Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default complex numbers with excel

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default complex numbers with excel

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default complex numbers with excel

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?
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 947
Default complex numbers with excel

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
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default complex numbers with excel

On Mar 31, 3:16*pm, Dana DeLouis 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Complex numbers in excel knutso Excel Programming 1 November 25th 07 01:33 PM
import complex numbers to excel wabodie Excel Worksheet Functions 0 September 9th 06 07:31 PM
How do I set up Excel to handle complex (& imaginary) numbers? Peter Thompson Excel Worksheet Functions 2 September 1st 06 02:58 PM
Complex Numbers in Excel? Oliver Gräser Excel Programming 1 June 19th 06 01:40 PM
Complex numbers in VBA (Excel( levent Excel Programming 2 July 22nd 04 08:58 PM


All times are GMT +1. The time now is 03:39 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"