Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #14405

Re: MarcumQ function

From Donagh Horgan <donagh.horgan@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: MarcumQ function
Date 2013-05-03 07:50 +0000
Message-ID <klvq8g$2ea$1@smc.vnet.net> (permalink)
References <20130502014331.5FD146A86@smc.vnet.net> <CAEtRDScDEUOARuvDheHG7RmvdmWuywOxdEhDRqjZ1NtDg6HkEg@mail.gmail.com>
Organization Time-Warner Telecom

Show all headers | View raw


Hi Bob,

Thanks for the quick reply! Everything seems to be working nicely now. For
future reference (in case anybody else has the same problem), the command

Plot[{MarcumQ[100, 10, x], 1 - MarcumQ[100, 10, 0, x]}, {x, 0, 30},
WorkingPrecision -> 20]

works fine, but the command

Plot[{MarcumQ[100, 10, x], N[1 - MarcumQ[100, 10, 0, x], 20]}, {x, 0, 30}]

does not. This appears to be because Mathematica treats the commands N and
WorkingPrecision differently under the hood. The fourth example under the
Scope -> Data Objects and Special Rules subsection of the N command
documentation <http://reference.wolfram.com/mathematica/ref/N.html> gives
an example of this difference.

Thanks again,
Donagh




On Thu, May 2, 2013 at 6:48 AM, Bob Hanlon <hanlonr357@gmail.com> wrote:

> It's a precision issue. Specify a working precision rather than using
> machine precision; however, it slows down the computations.
>
>
> Plot[{
>   MarcumQ[100, 10, x],
>   1 - MarcumQ[100, 10, 0, x]},
>  {x, 0, 30},
>  WorkingPrecision -> 20]
>
>
> Plot[{
>   MarcumQ[51, 10, x],
>   1 - MarcumQ[51, 10, 0, x]},
>  {x, 0, 30},
>  WorkingPrecision -> 20]
>
>
>
> Bob Hanlon
>
>
>
>
> On Wed, May 1, 2013 at 9:43 PM, Donagh Horgan <donagh.horgan@gmail.com>wrote:
>
>> Hello,
>>
>> I recently upgraded to Mathematica 9, and I've noticed a problem with the
>> MarcumQ function. The following command should illustrate it:
>>
>> Plot[{MarcumQ[100, 10, x], 1 - MarcumQ[100, 10, 0, x]}, {x, 0, 30}]
>>
>> While the two functions are mathematically equivalent, the second
>> incorrectly evaluates to zero between (approximately) x = 14 and x = 17.
>>
>> The problem only seems to occur when the first parameter is large. For
>> example, the command
>>
>> Plot[{MarcumQ[50, 10, x], 1 - MarcumQ[50, 10, 0, x]}, {x, 0, 30}]
>>
>> evaluates correctly, while the command
>>
>> Plot[{MarcumQ[51, 10, x], 1 - MarcumQ[51, 10, 0, x]}, {x, 0, 30}]
>>
>> does not.
>>
>> I've tried wrapping the functions with the N command, e.g. N[f, 100], but
>> the same problem occurs. I've also tried increasing $MaxExtraPrecision and
>> $WorkingPrecision using Block, but with no luck.
>>
>> I've been testing my old code since I upgraded from Mathematica 8 a few
>> days ago, so the error appears (to me, at least) to be new.
>>
>> All suggestions greatly appreciated!
>>
>> Best regards,
>> Donagh Horgan
>>
>>
>

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: MarcumQ function Donagh Horgan <donagh.horgan@gmail.com> - 2013-05-03 07:50 +0000

csiph-web