Maxima CAS and Calc

Talk about anything at all....
Post Reply
User avatar
Lupp
Volunteer
Posts: 3710
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Maxima CAS and Calc

Post 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?
On Windows 10: LibreOffice 25.2.4 and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
User avatar
Zizi64
Volunteer
Posts: 11494
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Maxima CAS and Calc

Post 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.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Jan_J
Posts: 189
Joined: Wed Apr 29, 2009 1:42 pm
Location: Poland

Re: Maxima CAS and Calc

Post 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).
Last edited by Jan_J on Wed Apr 02, 2025 1:30 pm, edited 1 time in total.
JJ ∙ https://forum.openoffice.org/pl/
LO (25.2|24.8) ∙ Python (3.12|3.10) ∙ Unicode 16 ∙ LᴬTEX 2ε ∙ XML ∙ Unix tools ∙ Linux (Rocky|CentOS)
User avatar
Lupp
Volunteer
Posts: 3710
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: Maxima CAS and Calc

Post 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)
Last edited by Lupp on Wed Apr 02, 2025 2:05 pm, edited 1 time in total.
On Windows 10: LibreOffice 25.2.4 and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
Jan_J
Posts: 189
Joined: Wed Apr 29, 2009 1:42 pm
Location: Poland

Re: Maxima CAS and Calc

Post 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.
JJ ∙ https://forum.openoffice.org/pl/
LO (25.2|24.8) ∙ Python (3.12|3.10) ∙ Unicode 16 ∙ LᴬTEX 2ε ∙ XML ∙ Unix tools ∙ Linux (Rocky|CentOS)
User avatar
Lupp
Volunteer
Posts: 3710
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: Maxima CAS and Calc

Post 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.
On Windows 10: LibreOffice 25.2.4 and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
Post Reply