Page 1 of 1

Maxima CAS and Calc

Posted: Mon Mar 31, 2025 11:43 pm
by Lupp
Recently I posted this:
https://ask.libreoffice.org/t/data-exch ... cas/120032.
There was no answer.

A bit earlier I found this:
https://wiki.openoffice.org/wiki/Educat ... ntegration.
That topic was created 2010-02-24 and got no contribution since.

Is Maxima extremely outdated? Is the problem unsolvable?
My German Maxima handbook is (C) 2014 and >300 pages. Rather complete and academic.
I never read the complete book, but as far as I can see there is no mention of any spreadsheet software.

Any knowledge about all this here?

Re: Maxima CAS and Calc

Posted: Tue Apr 01, 2025 5:24 pm
by Zizi64
I never heard about maxima software before.
Maybe others not too.
Here is some help for others:
https://maxima.sourceforge.io/
It seems the Maxima was updated in the year 2023. I do not know anything about its comaptibility with the LO.

Re: Maxima CAS and Calc

Posted: Tue Apr 01, 2025 6:53 pm
by Jan_J
Maxima is open source successor of much older LISP symbolic calculator named MACSYMA. Current maintainer of the project is Robert Dodier (https://github.com/robert-dodier, https://stackoverflow.com/users/871096/robert-dodier). In fact, there was no Maxima update since 2023, but the project is active (https://sourceforge.net/p/maxima/code/ci/master/tree/). Discussion list at Sourceforge (https://sourceforge.net/p/maxima/mailma ... a-discuss/) is also alive: typically above 200 posts per month.

I use Maxima extensively for symbolic scientific calculations. I call it from inside project written in Python, using subprocess Popen interface. Main idea is to redirect std input and output streams to capture interprocess communication. Making Maxima non-interative is possible using --very-quiet command line option.

I found some problems around the fact that Maxima diagnostic communications arrive to stdout together with output data, and sometimes it is not clear how to identify which is which. Another problem is stiff memory limitation of Maxima session, that results from LISP architecture.

As LibreOffice has Python scripting enabled, there is a chance to build a Calc–Maxima bridge via Python. But I did not ever try neither to integrate it to Calc by myself nor to find a ready-to-use solution.

Python alone has also very good symbolic engine named SymPy. Maxima however is more efficient in simplifying compound expressions. SymPy tends to exhaust all memory available when numerous expressions flow into the system during session.

Maxima and Python are also core parts of multipurpose computational server named SAGE (https://sagemath.org).

Re: Maxima CAS and Calc

Posted: Wed Apr 02, 2025 1:29 pm
by Lupp
@Jan_J
Thanks!
You thoroughly explained the situation.
Unfortunately I use Maxima only occasionally on a low level. Naively I hoped for existing support for limited exchange of (mainly) data treated as kinds of matrices (matrix in Maxima, 2D-array in Calc).
Being 80 I also can't start to study a field which is as complex as described by you.
I hope nonetheless you don't feel you just wasted your time.
Thanks again.
Lupp (aka Wolfgang)

Re: Maxima CAS and Calc

Posted: Wed Apr 02, 2025 1:38 pm
by Jan_J
Your problem would be reduced then to collect some texts from Calc range and construct either a SymPy array (when using sympy) — there's convenient Sympify class to do that, or build a text representing an array, or a matrix, in Maxima language; then send it to the engine and obtain a result.

In first approach, it could be more natural to consider using pure Python facilities like SymPy.

If you are interested, I can send you in a PM a module providing Python to Maxima connectivity. It does not utilize symbolic computation, which is not necessary when using Calc. However “sympifying” the result makes back converstion easier, because handling nested enumerative structures can be tedious without a parser.

Re: Maxima CAS and Calc

Posted: Wed Apr 02, 2025 2:14 pm
by Lupp
Thank you again!
However, I think the interactive way using the clipboard which I roughly described in my above linked post in the ask.libreoffice site must do it for the few cases I have to expect.