Ask Your Question

Problems with maxima.function of one variable

asked 2014-01-25 11:47:36 -0500

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


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


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

answered 2014-07-01 11:43:51 -0500

kcrisman gravatar image

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

sage: k2 = MF(h*k1.sage())
sage: k2

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

answered 2014-06-30 02:50:57 -0500

I have reported this as

Thanks for the report!

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


Asked: 2014-01-25 11:47:36 -0500

Seen: 270 times

Last updated: Jul 01 '14