Ask Your Question
1

Problems with maxima.function of one variable

asked 2014-01-25 18:47:36 +0100

Alasdair gravatar image

Here is a mwe of my query:

sage: var('F,F1,F2,h')
sage: MF = maxima.function('b','F+F1*b^2+F2*b^3')
sage: k1 = MF(0)
sage: k2 = MF(h*k1)

    Maxima ERROR:
        incorrect syntax: f is not an infix operator
                h F)

sage: F+F1*(h*k1)^2+F2*(h*k1)^3

    h^3*F^3*F2+h^2*F^2*F1+F

Now, I had none of this problem when I was using Maxima functions of two variables:

sage: var('c')
sage: MF = maxima.function('a,b','F+F1*b^2+F2*a^2')
sage: k1 = MF(0,0)
sage: k2 = MF(h*c,h*k1)
sage: k2

       c2^2*h^2*F2+h^2*F^2*F1+F

Can anybody enlighten me why a Maxima function of two variables should work perfectly well, but a Maxima function of one variable produces errors? And how can I work round this?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2014-06-30 09:50:57 +0100

rws gravatar image

I have reported this as http://trac.sagemath.org/ticket/16592

Thanks for the report!

edit flag offensive delete link more
1

answered 2014-07-01 18:43:51 +0100

kcrisman gravatar image

Having now diagnosed the problem rws reported, I think a good workaround is

sage: k2 = MF(h*k1.sage())
sage: k2
h^3*F^3*F2+h^2*F^2*F1+F

Basically, k1 is a Maxima element, not a Sage element, so you have to be careful putting it back with a Sage expression, like h.

Hopefully we can get #16592 fixed as well, of course.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2014-01-25 18:47:36 +0100

Seen: 1,673 times

Last updated: Jul 01 '14