News for hackers. Stuff that matters.
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.

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

Re:Maxima – A Computer Algebra System built with Lisp by kzrdude on Monday September 14, 2020 @04:43AM (#24468098)
There must be a reason that maxima is more widely used. Is Maxima easier to use? Or did maxima just have better distribution channels?
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 jxy on Monday September 14, 2020 @10:57AM (#24470910)
> I think Fricas is more powerful than Maxima (maybe much more) regarding symbolic integration and its type system

Citations or proofs?

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.

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...

Re:Maxima – A Computer Algebra System built with Lisp by jxy on Monday September 14, 2020 @12:15PM (#24471890)
That's a very complete analysis. Thanks. I really wish researchers could spend their time developing on top of open sourced CAS engines.
Re:Maxima – A Computer Algebra System built with Lisp by muizelaar on Monday September 14, 2020 @11:32AM (#24471352)
https://www.12000.org/my_notes/CAS_integration_tests/reports... gives Fricas solving 68% of the integrals vs. Maxima's 43%
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 ogogmad on Monday September 14, 2020 @12:24PM (#24471997)
You can use Maxima via Emacs with Latex output: https://www.emacswiki.org/emacs/MaximaMode
Re:Maxima – A Computer Algebra System built with Lisp by forgotpwd16 on Monday September 14, 2020 @07:20AM (#24468882)
>pretty unstable

What do you mean? wxMaxima has worked fine for me.

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 lokedhs on Monday September 14, 2020 @10:51AM (#24470821)
Do you accept the output from Climaxima? Granted, the project isn't near finished (currently held back due to some dependency issues).

I included some example videos in this reply: https://news.ycombinator.com/item?id=24467593

Re:Maxima – A Computer Algebra System built with Lisp by ogogmad on Monday September 14, 2020 @12:25PM (#24472008)
I use Sympy interactively, and I don't know what you mean by "forced". It doesn't feel that way to me.
Re:Maxima – A Computer Algebra System built with Lisp by jgalt212 on Monday September 14, 2020 @09:58PM (#24477170)
this is a bit rush, but an example setting up the quadratic equation.

  f(x) := a*x^2 + b*x + c
  solve( f(x),x );
  
  from sympy import symbols, solve
  a, b, c, x = sympy.symbols(('a', 'b', 'c', 'x'))
  y = sympy.Eq(a*x**2+b*x+c, 0)
  solve(y, x)
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:

  init_printing(use_unicode=True)
Once you've done that, you only need to type:

  y = a*x**2 + b*x + c
  solve(y,x)
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 ogogmad on Monday September 14, 2020 @09:33AM (#24469911)
Sympy can output to Latex or unicode - either looks good.
Re:Maxima – A Computer Algebra System built with Lisp by coliveira on Monday September 14, 2020 @11:58AM (#24471688)
wxMaxima is a very good front end, which I have used for many years. You just need to make sure you get a stable version, not a development release.
Re:Maxima – A Computer Algebra System built with Lisp by smabie on Monday September 14, 2020 @07:34PM (#24476347)
Just use it with Emacs, equations will render in LaTeX