Limit applyed to a very long expression



Dear Leo, your solution is great. And it is very simple, I was
searching for something like that. This can greatly simplify Maxima
computations with such long expressions.
In my case, expression are always rational in parameter _bk, in fact
what I do is a trick to impose a linear dependency relation between
some variables of a linear system. Plus, ratmx and algebraic are both
set to true (maybe this doesn't affect ratlimit().
Therefore, to let you know if I am rigth, in a system like:

Ku=f

were K is a stiffness matrix, u a displacement vector (the unknown)
and f a vector of forces, if I want to impose a linear dependency
relation, let's say, between u1 and u2, I do write:

K[1,1]=K[1,1]+_bk;
K[1,2]=K[1,2]-_bk;
K[2,1]=K[2,1]-_bk;
K[2,2]=K[2,2]+_bk;

then, in resulting u, for each component I do the limit for _bk -> inf.
Resultant expressions should be always rational in _bk, therefore your
ratlimit() should be the best solution.
I will include it in my code if it's ok for you, it will be GPL.

Thank you
Stefano




2009/8/25 Leo Butler <l.butler at ed.ac.uk>:


> Stefano,
> If your expressions are *always* rational functions of the parameter, you
> can easily outperform maxima's built-in routines by using some
> elementary calculus:
>
> ratlimit(f,x,l) := block([d:denom(f),n:denom(1/f),dd],
> ?dd : hipow(d,x),
> ?d : tlimit(x^(-dd)*d,x,l),
> ?n : tlimit(x^(-dd)*n,x,l),
> ?n/d)$
>
> (%i28) tlimit(u,_bk,inf);
> Evaluation took 5.2300 seconds (5.2300 elapsed) using 116.604 MB.
> (%o28) -l^3*q/(24*E*I)
> (%i29) ratlimit(u,_bk,inf);
> Evaluation took 0.1800 seconds (0.1800 elapsed) using 2.770 MB.
> (%o29) -l^3*q/(24*E*I)
>
> Leo
>
>
>
> --
> The University of Edinburgh is a charitable body, registered in
> Scotland, with registration number SC005336.
>
>