I've been trying to get the asmypa package working here and am having some
problems.
Here's a simple test program:
-------------------------
load(asympa);
assume_pos:true;
assume_nonzero:true;
logsimp:true;
logexpand:true;
exponentialize:true;
g:(1-exp(2*k*t)+exp(2*k*l))/(2*exp(2*k*l)-2);
put(l,inf,'limit);
taylor(g,l,inf,2);
asymp(g);
asympseries(g,2);
asymp(g);
taylormax:1;
asymp(g);
-------------------------------------------
When I run this, here's what I get (with some comments and questions
throughout).
Maxima 5.9.0.1cvs http://maxima.sourceforge.net
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
This is a development version of Maxima. The function bug_report()
provides bug reporting information.
(C1) load(asympa);
(D1) /usr/local/share/maxima/5.9.0.1cvs/share/calculus/asympa.mac
(C2) assume_pos:true;
(D2) TRUE
(C3) assume_nonzero:true;
(D3) TRUE
(C4) logsimp:true;
(D4) TRUE
(C5) logexpand:true;
(D5) TRUE
(C6) exponentialize:true;
(D6) TRUE
(C7) g:(1-exp(2*k*t)+exp(2*k*l))/(2*exp(2*k*l)-2);
2 k t 2 k l
- %E + %E + 1
(D7) -----------------------
2 k l
2 %E - 2
(C8) put(l,inf,'limit);
(D8) INF
(C9) taylor(g,l,inf,2);
k t 2 - k l 2
1 ((%E ) - 2) (%E )
(D9)/T/ - - ------------------------- + . . .
2 2
(C10) asymp(g);
1
(D10) ASYMP(-)
2
Up to this point everything is as expected. Although, why the return is
ASYMP(1/2) and not simply 1/2 isn't clear to me.
(C11) asympseries(g,2);
Is [%E - 2, [0, k - 2, t - 2]] zero or nonzero?
n;
Minor question: Why isn't this assumed nonzero by default given my
assignment to assume_nonzero above?
- 2 k l - 2 k l
(2 - %E) %E 1 1 (2 - k) %E 1
(D11) [------------------ + -, [-, ----------------- + -,
2 2 2 2 2
- 2 k l
%E (2 - t) 1
----------------- + -]]
2 2
I don't know what this, but it doesn't seem to break anything.
(C12) asymp(g);
1
(D12) ASYMP(-)
2
Now the source code seems to use a different algorithm when TAYLORMAX
is nonzero (the comment in asympa.mac erroneously calles it MAXTAYLOR
BTW)
(C13) taylormax:1;
(D13) 1
(C14) asymp(g);
2 k t + 2 INF k
k %E
(D14) - ----------------------------------------------
2 4 INF k 2 2 INF k 2
INF %E l - 2 INF %E l + INF l
4 INF k
1 %E
- ----------------------------- + -----------------------------
4 INF k 2 INF k 4 INF k 2 INF k
2 %E - 4 %E + 2 2 %E - 4 %E + 2
2 INF k 2 k t
2 k %E %E
- ------------------------------------- + -----------------------------
4 INF k 2 INF k 4 INF k 2 INF k
INF %E - 2 INF %E + INF 2 %E - 4 %E + 2
2 k t + 2 INF k 2 k t + 2 INF k
%E k %E
- ----------------------------- + -------------------------------------
4 INF k 2 INF k 4 INF k 2 INF k
2 %E - 4 %E + 2 INF %E - 2 INF %E + INF
2 INF k
2 k %E
+ ----------------------------------------------
2 4 INF k 2 2 INF k 2
INF %E l - 2 INF %E l + INF l
This is clearly wrong. Somehow the taylor expansions in asympa.mac
aren't treating inf as infinity (even though d9 is correct, and is the
answer I'd expect from asympseries().
David