[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: residue() confusion
From: |
Ben Abbott |
Subject: |
Re: residue() confusion |
Date: |
Sat, 22 Sep 2007 15:46:41 -0700 (PDT) |
ok ... sigh ... I just noticed that
http://www.nabble.com/bug-in-residue.m-tf4475396.html Hodel's original post
has the same answer as I derived and is consistent with Matlab.
So no my question is ...
Does anyone's Octave installation give the wrong answer?
Specifically is there someone with a Mac who used Fink to install Octave,
and what does their installation give for
num = [1 0 1];
den = [1 0 18 0 81];
[a,p,k,e] = residue(num,den)
Ben Abbott wrote:
>
> ok, I did some quick math
>
> (x^2+1)/(x^4+18*x^2+81) = (2/9)/(x-3i) + (2/9)/(x+3i) + (1/54i)/(x-3i)^2 -
> (1/54i)/(x+3i)^2
>
> Thus,
>
> a = [1/54i 2/9 -1/54i 2/9]
> p = [3i 3i -3i -3i]
> k = []
> e = [2 1 2 1]
>
> Can someone confirm they are able to get the correct answer from their
> installation of Octave?
>
> I'm running 2.9.13 on both PPC and Intel based Macs
>
>
> Ben Abbott wrote:
>>
>> Regarding the various results, I was more concerned about the differences
>> in "a" ... the pole locations are consistent but their residues are
>> different.
>>
>>
>> Henry F. Mollet wrote:
>>>
>>> The result for e should be [1 2 1 2] (multiplicity for both poles). Note
>>> that Matlab does not even give e. My mis-understanding of the problem
>>> was
>>> pointed out by Doug Stewart. Doug posted new code yesterday, which I've
>>> tried unsuccessfully, but I cannot be sure that I've implemented
>>> residual.m
>>> correctly. The corrected code still produced e = [1 1 1 1] for me.
>>> Henry
>>>
>>>
>>> on 9/22/07 1:31 PM, Ben Abbott at address@hidden wrote:
>>>
>>>>
>>>> As a result of reading through Hodel's
>>>> http://www.nabble.com/bug-in-residue.m-tf4475396.html post I decided
>>>> to
>>>> check to see how my Octave installation and my Matlab installation
>>>> responded
>>>> to the example
>>>>
>>>> Using Matlab v7.3
>>>> --------------------------
>>>> num = [1 0 1];
>>>> den = [1 0 18 0 81];
>>>> [a,p,k] = residue(num,den)
>>>>
>>>> a =
>>>>
>>>> 0 - 0.0926i
>>>> 0.2222 - 0.0000i
>>>> 0 + 0.0926i
>>>> 0.2222 + 0.0000i
>>>>
>>>>
>>>> p =
>>>>
>>>> 0.0000 + 3.0000i
>>>> 0.0000 + 3.0000i
>>>> 0.0000 - 3.0000i
>>>> 0.0000 - 3.0000i
>>>>
>>>>
>>>> k =
>>>>
>>>> []
>>>> --------------------------
>>>>
>>>> Using Octave 2.9.13 (via Fink) on Mac OSX
>>>> --------------------------
>>>> num = [1 0 1];
>>>> den = [1 0 18 0 81];
>>>> [a,p,k] = residue(num,den)
>>>>
>>>> a =
>>>>
>>>> -3.0108e+06 - 1.9734e+06i
>>>> -3.0108e+06 + 1.9734e+06i
>>>> 3.0108e+06 + 1.9734e+06i
>>>> 3.0108e+06 - 1.9734e+06i
>>>>
>>>> p =
>>>>
>>>> -0.0000 + 3.0000i
>>>> -0.0000 - 3.0000i
>>>> 0.0000 + 3.0000i
>>>> 0.0000 - 3.0000i
>>>>
>>>> k = [](0x0)
>>>> e =
>>>>
>>>> 1
>>>> 1
>>>> 1
>>>> 1
>>>> --------------------------
>>>>
>>>> These are different from both the result that
>>>> http://www.nabble.com/bug-in-residue.m-tf4475396.html Hodel obtained ,
>>>> as
>>>> well as different from
>>>> http://www.nabble.com/bug-in-residue.m-tf4475396.html Mollet's
>>>>
>>>> Thoughts anyone?
>>>>
>>>
>>>
>>> _______________________________________________
>>> Help-octave mailing list
>>> address@hidden
>>> https://www.cae.wisc.edu/mailman/listinfo/help-octave
>>>
>>>
>>
>>
>
>
--
View this message in context:
http://www.nabble.com/residue%28%29-confusion-tf4502015.html#a12841085
Sent from the Octave - General mailing list archive at Nabble.com.