[Date Index]
[Thread Index]
[Author Index]
Re: question
*To*: mathgroup at smc.vnet.net
*Subject*: [mg74882] Re: [mg74865] question
*From*: dimitris anagnostou <dimmechan at yahoo.com>
*Date*: Tue, 10 Apr 2007 05:12:14 -0400 (EDT)
Thanks a lot Andrzej!
I really appreciate your reply.
The code works properly (it just appears with two "misprints"; Degree ins=
tead of Infinity
and f instead of ff).
Also the insight you offered about Mathematica's evaluator is very import=
ant
for me. Thanks again!
Faithfully,
Dimitris
Andrzej Kozlowski <akoz at mimuw.edu.pl> wrote:
On 9 Apr 2007, at 19:11, dimitris wrote:
> BesselI[n, x] can be expressed as (x^n*Hypergeometric0F1Regularized[1
> + n, x^2/4])/2^n
>
> Mathematica knows this and simplifies the hypergeometric function
> (applying
> FunctionExpand or FullSimplify)
>
> In[53]:==
> (x^n*Hypergeometric0F1Regularized[1 + n, x^2/4])/2^n//FunctionExpand
>
> Out[53]==
> BesselI[n, x]
>
> The opposite is also possible.
>
> In[54]:==
> FullSimplify[BesselI[n, x], ComplexityFunction -> (Count[{#1},
> _BesselI, Infinity] & )]
>
> Out[54]==
> (x^n*Hypergeometric0F1Regularized[1 + n, x^2/4])/2^n
>
> The same holds true for some special functions I have tried.
>
> Let see a more trivial function: Log[1+x].
>
> Log[1+z] can be expressed as z*Hypergeometric2F1[1, 1, 2, -z]
> and Mathematica automatically simplifies the hypergeometric series
>
> In[55]:==
> z*Hypergeometric2F1[1, 1, 2, -z]
>
> Out[55]==
> Log[1 + z]
>
> Is it possible the opposite through some command(s)?
>
> Something like the following does not look very smart. That's why it
> fails!
>
> In[57]:==
> FullSimplify[Log[x+1],ComplexityFunction\[Rule]
> (Count[{#1},_Log,Infinity]&)]
>
> Out[57]==
> Log[1+x]
>
> Thanks
> Dimitris
>
>
Note that Mathematica's evaluator automatically evaluates:
(z-1)*Hypergeometric2F1[1, 1, 2, -z+1]
log(z)
This happens before one applies Simplify (never mind FullSimplify).
It is precisely this automatic evaluation that makes doing what you
wish so hard. Even if FullSimplify finds that an expression involving
HypergeometricF1 has the lowest value of complexity function the
evaluator will immediately convert it into an expression in terms of
log. This brings ones to an issue that used to frequenly appear on
this list: how much automatic simplification should be performed by
Mathematica without invoking Simplify? Some people think Mathematica
should do more and some that it should do less, but there is a price
to be paid for each choice. Personally I would prefer less, which
would give more choice to the user but would also require more skill
and patience in using functions such as Simplify. In your particular
case there is no alternative but to use HoldForm or some equivalent.
You could do something like this:
ff[expr_] :== expr /. Log[
z_] :> ((z - 1)*HoldForm[Hypergeometric2F1[1, 1, 2, v]] /. v -> (1
- z))
Now you can use:
In[2]:==
FullSimplify[Log[x+1],ComplexityFunction->(Count[{#1},_Log,=B0]&),\
TransformationFunctions->{f,Automatic}]
Out[2]==
x Hypergeometric2F1[1,1,2,-x]
which at least in Standard and Traditional forms looks right, but of
course:
In[3]:==
ReleaseHold[%]
Out[3]==
Log[x+1]
Andrzej Kozlowski
---------------------------------
Don't pick lemons.
See all the new 2007 cars at Yahoo! Autos.
Prev by Date:
**Re: Re: ftp from mathematica code**
Next by Date:
**RootSum**
Previous by thread:
**Re: Re: Question**
Next by thread:
**Re: question**
| |