robert-dodier / maxima-jupyter

A Maxima kernel for Jupyter, based on CL-Jupyter (Common Lisp kernel)
Other
185 stars 31 forks source link

taylor() and pade() #120

Open imakn634 opened 1 year ago

imakn634 commented 1 year ago

In Maxima-Jupyter, the pade() does not work:

taylor (1 + x + x^2 + x^3, x, 0, 3); pade (%, 1, 1);

pade: first argument must be a Taylor series; ...

This is because taylor() in Maxima-Jupyter does not return /T/ expression.
Any help? Is there any tip to return /T/ expression?

robert-dodier commented 1 year ago

Hmm, I guess maxima-jupyter is converting % to an ordinary, non-Taylor, form for display. I find a workaround is to assign the result to a named variable, e.g. foo: taylor(...) and then pade(foo, 1, 1).

Not sure what to do about the problem in general. Aside from Taylor, there are rational function representations which are displayed with /R/. I guess the problem is that there is a display form which is different, but at present there isn't a way to distinguish them.

imakn634 commented 1 year ago

Thank you for quick reply! Surely, pade (taylor (1 + x + x^2 + x^3, x, 0, 3), 1, 1) works.

Maxima on terminal returns:

(%i1) taylor (1 + x + x^2 + x^3, x, 0, 3);
                              2    3
(%o1)/T/             1 + x + x  + x  + . . .

It woud be nicer if Maxima-Jupyter returns the same form...