Re:Maxima – A Computer Algebra System built with Lisp
by nsajko on Sunday September 13, 2020 @11:43PM
(#24466550)
Fricas (a fork of Axiom, which is a rename of Scratchpad 2) is another very old CAS implemented with Lisp, also now open sourced. I think Fricas is more powerful than Maxima (maybe much more) regarding symbolic integration and its type system, but it sadly has very few developers maintaining it.
Re:Maxima – A Computer Algebra System built with Lisp
by blihp on Monday September 14, 2020 @04:53AM
(#24468145)
At least a couple of non-technical reasons: I believe Maxima was open sourced a few years earlier (1998 vs 2001) which helped it get established. Maxima was also supported by a rather prolific open source developer which probably helped a community coalesce around it. Axiom, on the other hand, looks like it was more of a 'throw it over the wall' open source project which only happened after it failed commercially.
Re:Maxima – A Computer Algebra System built with Lisp
by lokedhs on Monday September 14, 2020 @10:54AM
(#24470869)
Axiom is also not a normal Lisp program. Maxima can be loaded using ASDF and you can hack on it like any other Lisp project. Axiom in the other hand generates Lisp code from some other format and is rather incomprehensible to someone just coming into the project.
Not that Maxima is all that easy to understand either. The nature of the software makes it complicated, but there is code in there from the 60's, which carries with it some more the classic issues with Lisp code from that era, short symbol names, use of dynamic variables, etc.
Re:Maxima – A Computer Algebra System built with Lisp
by jart on Tuesday September 15, 2020 @01:54AM
(#24478258)
Axiom is sort of like Scratchpad source code converted to Literate Programming, and since TeX is near impossible to build these days, that makes Axiom score low on the hackability scale. Fricas on the other hand is much easier to build. However a lot of the equations that are programmed into the system, are sort of like ASCII art mathematics that the system is trained to decipher. A lot of those certainly got handed down over the decades of people figuring things out at IBM.
Re:Maxima – A Computer Algebra System built with Lisp
by nsajko on Monday September 14, 2020 @11:53AM
(#24471626)
The linked Wikipedia page already mentions the Risch-Bronstein-Trager algorithm, which is supposedly implemented most fully in Fricas (i.e. Fricas or Axiom should, modulo bugs, be able to find an elementary function integral for any function that has an elementary function integral). But note that even in Fricas, there are still unimplemented cases of the "Risch algorithm" (and bugs), as the problem is hard and requires a lot of work and knowledge.
Fricas scores quite a bit better than Maxima there, but note that there are big problems with the test, although there is a somewhat active effort to improve its accuracy. It is problematic (but understandable) that the test uses Sage, as the Sage interface to Fricas, at least, is imperfect. I.e., AFAIK some of the integration tests will fail simply because Sage fails to communicate with Fricas successfully.
Fricas (and Axiom) also has a more well thought out type system (with type checking at time of compilation) than other computer mathematics systems, so writing Fricas programs (the language is called Spad, which presumably comes from Scratchpad) is nice. (Fricas can be used both interactively and as a compiled language.)
Re:Maxima – A Computer Algebra System built with Lisp
by SiempreViernes on Monday September 14, 2020 @07:03AM
(#24468784)
Does it come with proper equation printing?
A big problem for me getting into Maxima is that the frontends I've found are pretty unstable and the terminal version only does equations as ascii art, which I just cant' stand reading.
Re:Maxima – A Computer Algebra System built with Lisp
by nsajko on Monday September 14, 2020 @09:53AM
(#24470135)
Fricas supports several different output formats including TeX and MathML, which can be toggled and redirected independently. (There is some relatively recent work on that front, so changes are possible. I hope interfacing with Fricas programmatically will become nicer.)
It's an ugly solution, but when an output expression is complicated enough that I want it nicely rendered, I copy the TeX output to, e.g., https://arachnoid.com/latex/ while removing the \leqno command and replacing \sp commands with carets (^).
Re:Maxima – A Computer Algebra System built with Lisp
by jgalt212 on Monday September 14, 2020 @09:46AM
(#24470049)
I've had good success with wxMaxima as well, but none of the equations I've worked with can fill a blackboard. SymPy is very nice as well, but for obvious reasons, it feels a bit more forced when interacting with it.
Re:Maxima – A Computer Algebra System built with Lisp
by ogogmad on Tuesday September 15, 2020 @02:45AM
(#24478514)
I would change the first two lines to:
from sympy.abc import *
from sympy import *
I would put that into a file, and auto-load it at startup so I don't need to run it manually every time - one way of doing that is using iPython profiles.
Also put this in your startup file to get more pleasant looking output:
Re:Maxima – A Computer Algebra System built with Lisp
by forgotpwd16 on Tuesday September 15, 2020 @04:49AM
(#24479168)
SymPy already comes with `isympy` script that will import everything from SymPy and create some common symbols (x, y, z, t, k, m, n, f, g, h) using either `python` or `ipython` (default). To do what you said the following script may be run.
#!/usr/bin/env python
from sympy.abc import *
from sympy import *
import code
init_printing()
code.interact(local=locals())
Re:Maxima – A Computer Algebra System built with Lisp
by lokedhs on Monday September 14, 2020 @03:03AM
(#24467593)
Of interest may be my project that implements a CLIM-based user interface on top of Maxima. It turns out that CLIM is perfect for this, as its idea of presentation forms matches the way mathematical expressions are represented in Maxima.
I have made a few videos showing how it works. It's also available on Flathub, or if you're brave you can build it yourself.
Re:Maxima – A Computer Algebra System built with Lisp
by smabie on Monday September 14, 2020 @07:35PM
(#24476362)
I love CLIM, too bad it's not used much. The whole idea of it is very interesting, an evolutionary dead end that in many ways seems far superior then what "modern" GUIs provide
Re:Maxima – A Computer Algebra System built with Lisp
by lokedhs on Wednesday September 16, 2020 @03:49AM
(#24490465)
I think there are more practical reasons why it's not used more. What you say is absolutely true of course, but the bigger issue is that McCLIM still has some technical issues.
What is really needed is a multiplatform backend that implements everything completely. Right now the only production grade backend is the CLX one, and even that one requires you to jump though hoops to get complete font rendering.
I built all of this into the flatpak distribution, but few people are willing to go through that just to distribute some software.
Re:Maxima – A Computer Algebra System built with Lisp
by 1MachineElf on Monday September 14, 2020 @11:01AM
(#24470964)
To my detriment, I avoided having to learn anything in my 2007 highschool online Algebra 2 class by simply feeding the equations into Maxima. That was the year I first started using Linux - a Ubuntu 8.04 install CD on a Linux magazine saved my laptop from a corrupted Windows Vista install while away from home.
Re:Maxima – A Computer Algebra System built with Lisp
by narwally on Monday September 14, 2020 @12:41PM
(#24472193)
I was doing my first Linux install around the same time. I ordered an install CD from both Ubuntu and Linux Mint; the Mint one came in first, so that's the OS I used for my first few years. I used the CD to make a bootable usb stick so that I could use the internet when my parents weren't home (they kept Windows password protected). I've never actually run Windows on a personal machine since I didn't have my own until college, and but that time I was a few years into my Linux journey.
Re:Maxima – A Computer Algebra System built with Lisp
by em500 on Monday September 14, 2020 @04:08AM
(#24467905)
Why are you amazed about that? A modern Android phone is a general purpose computer roughly as powerful as a 2010-2015 laptop. Math software like Maxima, Mathematica, Maple have a very long history and was widely used on 1980s/1990s hardware.
Re:Maxima – A Computer Algebra System built with Lisp
by ploika on Monday September 14, 2020 @06:19AM
(#24468563)
Because it is amazing? Intellectually I know all about Moore's law, but having a supercomputer in your pocket still feels like science fiction in reality. There's no reason to push that feeling away.
Re:Maxima – A Computer Algebra System built with Lisp
by Sharlin on Monday September 14, 2020 @12:07PM
(#24471789)
But things like plotting a simple function, 3D or not, are vastly less performance-intensive than almost all other things that people do with their phones, like rendering just about any modern webpage. Never mind actually demanding things like playing 3D games (doing that on a cellphone was indeed rather amazing back in 2011, being accustomed to mobile games mostly being simple 2D affairs).
Re:Maxima – A Computer Algebra System built with Lisp
by narwally on Monday September 14, 2020 @12:47PM
(#24472258)
I recently pulled out an old 2008 unibody Macbook pro just to play around on. It was a nearly %100 CPU utilization just attempting to play a 4K youtube video. That's something my $400 phone doesn't even break a sweat on. It's amazing how well cell phones have been optimized in the last decade.
Re:Maxima – A Computer Algebra System built with Lisp
by alchadoor on Monday September 14, 2020 @08:22AM
(#24469234)
This is nicee... With this we can bridge between historic Maxima and technology of present aka Python. As they say “It is in the roots, not the branches, that a tree’s greatest strength lies.”
Re:Maxima – A Computer Algebra System built with Lisp
by williamstein on Monday September 14, 2020 @01:07AM
(#24466951)
That is correct. We embed Maxima at the C level using ECL for much better performance than one might expect (basically call Maxima from python very efficiently in the same process!).
Re:Maxima – A Computer Algebra System built with Lisp
by vortico on Sunday September 13, 2020 @11:36PM
(#24466517)
Yes, "Under the name of Maxima, it [Macsyma] was released under the GPL in 1999, and remains under active maintenance." https://en.wikipedia.org/wiki/Macsyma
Re:Maxima – A Computer Algebra System built with Lisp
by e40 on Monday September 14, 2020 @12:15AM
(#24466696)
Maxima was the port of Macsyma to Franz Lisp at UC Berkeley done by Prof. Fateman and his students. Franz Lisp was written to be Mac Lisp compatible for the sole purpose of running Macsyma. Prof Fateman worked on Macsyma at MIT.
Re:Maxima – A Computer Algebra System built with Lisp
by minxomat on Monday September 14, 2020 @03:03AM
(#24467583)
And today Franz Lisp is instrumental in running older maclisp programs because the Franz lisp binaries still run unmodified on current BSD releases (with kernel compatibility turned on).
Re:Maxima – A Computer Algebra System built with Lisp
by williamstein on Monday September 14, 2020 @01:05AM
(#24466939)
Yes, Sage includes Python and the Python numerical stack (numpy, scipy, etc). It also has a lot of new code related to interval arithmetic (arbitrary precision numerical computation with proven error bounds).
Re:Maxima – A Computer Algebra System built with Lisp
by bee_rider on Monday September 14, 2020 @01:22AM
(#24467039)
I do numerical linear algebra stuff, but every time I hear about interval arithmetic my ears perk up. It just seems like our error bounds require caveats (a-hah, I actually gave you the backward error, nyaah!) while theirs are just numbers.
Re:Maxima – A Computer Algebra System built with Lisp
by kzrdude on Monday September 14, 2020 @04:49AM
(#24468127)
See https://en.wikipedia.org/wiki/SageMath#Software_packages_con... for an overview of what Sage contains. Sage is like a colonial organism rather than an individual, and maxima is one of the packages that provides CAS features in Sage. Some other packages like SymPy, do too :)
The integration between the various packages in sage it exists, but it's a bit clunky.
Re:Maxima – A Computer Algebra System built with Lisp
by konjin on Monday September 14, 2020 @02:02AM
(#24467257)
Sage is everything and the kitchen sink. Numerical, analytical, integer, all accessible from a leaky python abstraction.
Your python code will look a lot like calls to maxima, which will happen under the hood.
You can think of it like bash, as a contrived example, most sage programs would be like calling an inline python script to find all files whose size is an even number of bytes, passing the results through pipes, pretty printing them with ls and finally sorting them alphabetically with sort.
Whether you think this is good or bad depends on how familiar you are with the underlying systems. I think that it's great since I can use one program to dispatch whatever I need to the correct state of the art project and get a result that with a bit of massaging can be fed into another project.
Fricas links:
https://en.wikipedia.org/wiki/FriCAS https://fricas.github.io https://fricas.github.io/book.pdf
Axiom links:
https://en.wikipedia.org/wiki/Axiom_(computer_algebra_system... https://github.com/daly/axiom
Not that Maxima is all that easy to understand either. The nature of the software makes it complicated, but there is code in there from the 60's, which carries with it some more the classic issues with Lisp code from that era, short symbol names, use of dynamic variables, etc.
Citations or proofs?
You probably want something more concrete, so take a look at this effort to test symbolic integration software using a common testsuite: https://www.12000.org/my_notes/CAS_integration_tests/reports...
Fricas scores quite a bit better than Maxima there, but note that there are big problems with the test, although there is a somewhat active effort to improve its accuracy. It is problematic (but understandable) that the test uses Sage, as the Sage interface to Fricas, at least, is imperfect. I.e., AFAIK some of the integration tests will fail simply because Sage fails to communicate with Fricas successfully.
Main page of the integration tests: https://www.12000.org/my_notes/CAS_integration_tests/index.h...
Fricas (and Axiom) also has a more well thought out type system (with type checking at time of compilation) than other computer mathematics systems, so writing Fricas programs (the language is called Spad, which presumably comes from Scratchpad) is nice. (Fricas can be used both interactively and as a compiled language.)
This mailing list discussion may also be of interest: https://groups.google.com/forum/#!topic/fricas-devel/xVtvZ46...
A big problem for me getting into Maxima is that the frontends I've found are pretty unstable and the terminal version only does equations as ascii art, which I just cant' stand reading.
It's an ugly solution, but when an output expression is complicated enough that I want it nicely rendered, I copy the TeX output to, e.g., https://arachnoid.com/latex/ while removing the \leqno command and replacing \sp commands with carets (^).
What do you mean? wxMaxima has worked fine for me.
I included some example videos in this reply: https://news.ycombinator.com/item?id=24467593
Also put this in your startup file to get more pleasant looking output:
Once you've done that, you only need to type:I have made a few videos showing how it works. It's also available on Flathub, or if you're brave you can build it yourself.
https://peertube.mastodon.host/videos/watch/df751bd5-5a26-44...
https://peertube.mastodon.host/videos/watch/b003360f-97a9-4f...
https://github.com/lokedhs/maxima-client
What is really needed is a multiplatform backend that implements everything completely. Right now the only production grade backend is the CLX one, and even that one requires you to jump though hoops to get complete font rendering.
I built all of this into the flatpak distribution, but few people are willing to go through that just to distribute some software.
https://people.eecs.berkeley.edu/~fateman/papers/mma.review....
https://github.com/dharmatech/mpl
Not sure what difference it makes, but probably some.
Would be happy to answer any questions about it.
I am pleasantly surprised to get a reply from you! I have one question, How often is Sympy used in Sagemath compared to Maxima?
Or rather when I do symbolic math in sagemath, do I ever hit Sympy?
Details are here: https://github.com/turbo/netlisp
However, I am terribly frightened by programs like this, as I suspect they are much smarter than me, so I tend to avoid them.
The integration between the various packages in sage it exists, but it's a bit clunky.
Your python code will look a lot like calls to maxima, which will happen under the hood.
You can think of it like bash, as a contrived example, most sage programs would be like calling an inline python script to find all files whose size is an even number of bytes, passing the results through pipes, pretty printing them with ls and finally sorting them alphabetically with sort.
Whether you think this is good or bad depends on how familiar you are with the underlying systems. I think that it's great since I can use one program to dispatch whatever I need to the correct state of the art project and get a result that with a bit of massaging can be fed into another project.