MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: $Assumptions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg92634] Re: $Assumptions
  • From: Peter Breitfeld <phbrf at t-online.de>
  • Date: Thu, 9 Oct 2008 06:35:00 -0400 (EDT)
  • References: <gci2ia$ta$1@smc.vnet.net>

Ruth Lazkoz Sáez schrieb:
> Dear all,
>
> I seem to be unable to change some default options globally.
>
> At the top of  my notebook I have
>
> $Assumptions = {MaxRecursion -> 30, AccuracyGoal -> 10};
>
> Then we I evaluate  NIntegrate[Exp[-x^2], {x, 20., 40.}]
> I get 4.78196*10^-176
>
> But if I  evaluate NIntegrate[Exp[-x^2], {x, 20., 40.}, MaxRecursion -> 30,
>  AccuracyGoal -> 10]
> I get quite a different value, 1.36703*10^-177
>
> I had the same problem trying to change the options for fonts in plots, 
> and then I had to add the options I wanted
> in every plot, I mean evaluation something like $TextStyle ={whatever} 
> before doing the plots did not work.
>
> Hope you can help me. Thanks,
>
> Ruth Lazkoz
>

If you evaluate

NIntegrate[Exp[-x^2], {x, 20, 40}, Assumptions -> True]

you will get the error message:

NIntegrate::optx: Unknown option Assumptions in \
NIntegrate[E^-x^2,{x,20,40},Assumptions->True]. 

This means, that NIntegrate doesn't have an Assumptions option.

Setting $Assumtions to any value works only for functions with an
Assumtions optin which must default to $Assumptions.

The function Assuming works similiar to construct like this:

Assuming[assum_,expr_]:=Block[{$Assumptions=assum},expr]

so using Assuming won't work with NItegrate either.

The following function, which I found in this group, lists all
functions in the System-context, which have an Assumptions option:

hatOption[option_] := 
  ToExpression /@ 
   Quiet[Select[Names["System`*"], 
     MemberQ[ToExpression[#, StandardForm, 
         Options[Unevaluated[#]] &][[All, 1]], option] &]];
hA = hatOption[Assumptions]

The only function of these, which has not Assumptions->$Assumptions
as default option is PowerExpand. It's Assumptions Option defaults
to Automatic. So PowerExpand too will not reacht on setting
$Assumptions or using Assuming.

Gruss Peter
-- 
==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==
Peter Breitfeld, Bad Saulgau, Germany -- http://www.pBreitfeld.de


  • Prev by Date: Re: Overlapping binning of differences of two lists
  • Next by Date: Re: Overlapping binning of differences of two lists
  • Previous by thread: Re: $Assumptions
  • Next by thread: Re: Why is Mathematica assuming k==l and how do I make it