a.a.letterbox wrote:
> My idea is to use substitution rules.
> For xi ( eq. 10 ) it may look like
>
> xi_rule := rule xi(t) == Up * t - beta * sin( 2 * omg * t )
>
> However, the application of xi_rule works only for Real-valued exponents
> and fails for complex-valued
>
> (17) -> xi_rule( exp( %i * xi(t) ) )
> Cannot find a definition or applicable library operation named=20
> xi_rule with argument type(s)=20
> Expression(Complex(Integer))
<snip>
> Eq. (12) is a bigger problem however.
> It is necessary to define an identity
>
> exp( i * z * sin( theta ) ) = sum_{ N = -infty }^{+ infty }
> BesselJ_N( z ) * exp( i * N * theta )
>
> ( see http://en.wikipedia.org/wiki/Jacobi=E2=80=93Anger_expansion )
> My first idea was to use streams to represent infinite summations.
Stream are good if you have order such that there is only finitely
many elements smaller than given element and you are satified
with finite approximation. Strength of streams is that you
do not need to specify how many elements are needed (they are
computed on demand). But usually streams loose information
about "tail".
Problem with summation is similar to integral: you must fake
infinite bounds using symbols and there is problem trying
to evaluate unevaluated summation. There is no operator
to create unevaluated sum.
> My second attempt was to define a rule without summation
>
> exp_to_bessel_rule := rule exp( %i * z * sin( t ) ) == _
> besselJ(N, z ) * exp( %i * N * t )
>
> This is not the best idea, since in the case of expression =20
>
> exp( i * z * sin( theta ) ) * exp( i * x * sin( phi ) )=20
>
> I'll get identical summation indices after substitution.
> But I was not able to apply even such simple rule:
>
> (23) -> exp_to_bessel_rule( exp( %i * z * sin(t) ) )
>
> %i z sin(t)
> (23) %e
> Type: Expression(Complex(Integer))
>
> So, how do I do the substitution?
This is just a bug. Possible workaround is to use 'sqrt(-1)' instead
of '%i':
(19) -> exp_to_bessel_rule := rule exp(sqrt(-1)*z*sin(t)) == besselJ(N,
z)*exp(sexp_to_bessel_rule := rule exp(sqrt(-1)*z*sin(t)) == besselJ(N,
z)*exp(sqrt(-1)*N*t)
+---+ +---+
z\|- 1 sin(t) N t\|- 1
(19) %e == 'besselJ(N,z)%e
Type: RewriteRule(Integer,Integer,Expression(Integer))
(20) -> exp_to_bessel_rule(exp(sqrt(-1)*z*sin(t)))
+---+
N t\|- 1
(20) %e besselJ(N,z)
Type: Expression(Integer)
Using 'sqrt(-1)' you can compute complex conjugate of many expressions
via 'eval':
(21) -> eval(exp(sqrt(-1)*z*sin(t)), sqrt(-1) = -sqrt(-1))
+---+
- z\|- 1 sin(t)
(21) %e
Type: Expression(Integer)
I just commited fix for the bug to the repository, but note then
even with fix you may prefer to use 'sqrt(-1)' insted of '%i' in
rules, because '%i' does not match imaginary part of '2 + %i':
complex pattern matching considers '%i' and '2 + %i' to be to
distinct complex constants. OTOH 'sqrt(-1)' is considered "kernel"
and is matched separately form constants.
If you do changes that are not mathematical equalities, then
'eval' may be useful:
(23) -> eval(exp(%i*u*sin(v)), exp(%i*u*sin(v)) = besselJ(N,u)*exp(%i*N*v))
%i N v
(23) %e besselJ(N,u)
Type: Expression(Complex(Integer))
because it gives more control (rules ignore variable names, while
eval matches only exact kernel).
--
Waldek Hebisch
[email protected]
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.