How do I make full simplification of expressions?

I am using Maple 12.

I often try to simply expressions, but I found that very often I must manually guide the simplification procedure.  For example a result from inverse laplace trasformation is:

Ssi(t)+pi/2

But this, by definition, equals Si(t).

However, the function simplify doesn't work for such a purpose.  Also in many other cases the function 'simplify' don't work without human guide.

Is there a way to cause Maple try very hard to find the minimal size expression?

JacquesC's picture

simplify with option 'size'

Try the 'size' option.  But don't expect miracles!

Thanks! But I tried before post, it had no effect.

Thanks!  But I tried before post, it had no effect.

Axel Vogt's picture

convert

of course "convert(%,Si)" works - and use Pi, not pi ...

Great! Thank you!

Great!  Thank you!

But how did you find the method?  I cannot find a 'Si' option for convert in Maple help.

Axel Vogt's picture

by 'intuition'

by 'intuition', i.e. sometimes some trials (with cross checking) are not so bad, since not everything is documented

by table

'Si' is in this list:

`convert/to_special_function/hierarchy`["function"];

Thank you!

Thank you!  But I cannot find a topic by:

?convert/to_special_function/hierarchy

Si is also listed by:

FunctionAdvisor(Ei_related)

But convert(Ssi(t)+Pi/2,`Ei_related`) doesn't help.

 

No topic

I think that there is no topic:

?convert/to_special_function/hierarchy

or the like. This arises by inspecting the code:

showstat(`convert/to_special_function`,12);
...
 12     CLASSES := `convert/to_special_function/hierarchy`["classes"];
...

Both 'Si' and 'Ssi' are already within the "Ei_related" class, so convert/Ei_related, that "converts" special functions not in this class, into Ei related functions, makes nothing.

Robert Israel's picture

convert

See the help page ?convert,to_special_function (which is in turn referenced by ?convert.

Incomplete?

The problem is that the list of (special) functions in ?convert,to_special_function misses tens of function names shown in the list

`convert/to_special_function/hierarchy`["function"];

including:

AngerJ, Beta, Chi, Ci, Dirac, EllipticCE, EllipticCK, EllipticCPi, EllipticF,
EllipticModulus, EllipticNome, EllipticPi, FresnelC, FresnelS, Fresnelf,
Fresnelg, GaussAGM, Heaviside, HeunB, HeunBPrime, HeunC, HeunCPrime, HeunD,
HeunDPrime, HeunG, HeunGPrime, HeunT, HeunTPrime, Hypergeom, ...

Presumably, conversions to these functions are available, but I have not checked every case.

alec's picture

Heun

Last time I checked, the implementation of Heun functions was very incomplete, and none of the conversions to or from them was supported. Perhaps, it has changed by now, and they were not added to the help page list for some other reason.

Alec

Don't know when was that you

Don't know when was that you checked, but conversions to and from for these functions work pretty well, if I remember correctly that is so since the introduction of the Heun functions in the system. As Robert Israel correctly pointed, you see that by specializing the functions via FunctionAdvisor(specialize, foo), where foo is any math function. As Alejandro Jakubi noticed, this approach shows more conversions than those actually implemented, because the FunctionAdvisor is able to "invert" conversions. For example, in Maple12, it knows how to convert BesselI into HeunB but not the other way around (oversight, explained in another post in this thread). But from the conversion BesselI -> HeunB the FunctionAdvisor is able to derive the conversion and conditions to be satisfied  to go HeunB -> BesselI.

Anyway, these functions are new in the Maple system and actually in the mathematical language. If you are aware of implementation details regarding the Heun functions that you feel are relevant and are missing please let us know so that we give it a look.

Edgardo S. Cheb-Terrab
Physics, Maplesoft

Robert Israel's picture

Conversions

A useful way to find out what conversions are possible from a given function is FunctionAdvisor(specialize, ...). For example:

> FunctionAdvisor(specialize, Ssi(x));

 [Ssi(x) = -1/2*I*(Ei(1,x*I)-Ei(1,-I*x))+1/2*(csgn(x)-1)*Pi, `with no restrictions on `(x)]

[Ssi(x) = 1/4*x*Pi^(1/2)*MeijerG([[1/2], []],[[0], [-1/2, -1/2]],1/4*x^2)-1/2*Pi, `with no restrictions on `(x)]

[Ssi(x) = 1/2*I*(2*Shi(-I*x)+Pi*I), `with no restrictions on `(x)]

[Ssi(x) = Si(x)-1/2*Pi, `with no restrictions on `(x)]

[Ssi(x) = x*hypergeom([1/2],[3/2, 3/2],-1/4*x^2)-1/2*Pi, `with no restrictions on `(x)]

I wonder

how it works. Ie the relationship between 'FunctionAdvisor' and 'convert'. Eg:

FunctionAdvisor(specialize, HeunB);

<br />
HeunB(alpha,beta,gamma,delta,z) = BesselI(1/4*alpha,1/2*z^2)/((1/2*z^2)^(1/4*alpha))*GAMMA(1+1/4*alpha)*2^(1/4*alpha)*exp(1/2*z^2)<br />

 And(beta = 0,gamma = 0,delta = 0)

But

convert(HeunB(alpha,0,0,0,z),BesselI);

                       HeunB(alpha, 0, 0, 0, z)

This is an implementation

This is an implementation oversight - call it bug if you prefer - Heun functions were introduced in the system after the conversion network got developed. The implementation details are tricky but in short: the setup of the network includes knowledge regarding "from which functions" can a conversion exists. For Bessel functions an update telling, that from HeunB and HeunC that conversion is possible, is missing in Maple12 and before.

To make it more concrete: if that information were in place, the network would have found that through pFq it is possible to convert to BesselI; try this convert(HeunB(alpha,0,0,0,z), compose, hypergeom, BesselI); and you see it working. The problem is fixed in the version of Maple under development

Edgardo S. Cheb-Terrab
Physics, Maplesoft

option compose

This seems very interesting though I am not finding a hint about it in ?convert/to_special_function > The Optional Arguments. I hope that it will be documented in the next version.

Somewhat related to this issue, I was looking today on simplification of Heun functions and though directly does not work:

simplify(HeunC(1,1,1,-3,7/2,-z));
                     HeunC(1, 1, 1, -3, 7/2, -z)

presumably as there is no 'simplify/HeunC', I have found that a by-pass through eg 'hypergeom' works:

FunctionAdvisor(specialize,HeunC(1,1,1,-3,7/2,-z),hypergeom):
map(simplify,op(1,%));


                                                       2
                                            6 - 6 z + z
              HeunC(1, 1, 1, -3, 7/2, -z) = ------------
                                             6 (z + 1)


You are correct,

You are correct, simplify/Heun is not there. There is a general approach in simplify for special functions though; I'm adding Heun functions there now.

Edgardo S. Cheb-Terrab
Physics, Maplesoft

Re: Incomplete

Conversions to most of these functions are available; it suffices to check whether convert/foo is or not assigned, where foo is any function's name. As you know Maple frequently incorporates new stuff in different areas; it could be different but in practice  the help system is always catching up a bit.

Edgardo S. Cheb-Terrab
Physics, Maplesoft

Thank you!

<p>Thank you!</p>

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
}