# Maxima (open source computer algebra system)

Maxima is a system for the manipulation of symbolic and numerical expressions, including differentiation, integration, Taylor series, Laplace transforms, ordinary differential equations, systems of linear equations, polynomials, sets, lists, vectors, matrices and tensors. Maxima yields high precision numerical results by using exact fractions, arbitrary-precision integers and variable-precision floating-point numbers. Maxima can plot functions and data in two and three dimensions.

The Maxima source code can be compiled on many systems, including Windows, Linux, and MacOS X. The source code for all systems and precompiled binaries for Windows and Linux are available at the SourceForge file manager.

Maxima is a descendant of Macsyma, the legendary computer algebra system developed in the late 1960s at the Massachusetts Institute of Technology. It is the only system based on that effort still publicly available and with an active user community, thanks to its open source nature. Macsyma was revolutionary in its day, and many later systems, such as Maple and Mathematica, were inspired by it.

The Maxima branch of Macsyma was maintained by William Schelter from 1982 until he passed away in 2001. In 1998 he obtained permission to release the source code under the GNU General Public License (GPL). It was his efforts and skill which have made the survival of Maxima possible, and we are very grateful to him for volunteering his time and expert knowledge to keep the original DOE Macsyma code alive and well. Since his death, a group of users and developers has formed to bring Maxima to a wider audience.

I’ve barely scratched the surface on using maxima but have found it useful for some symbolic integrals and formula creation I’ve worked on recently, it was able to give me answers for problems which both the free and lowest paid tier of Wolfram Alpha timed out. I use it across my windows and linux machines as well.

Ex 1 - Linear Stress Block Second Moment of Area integrals:

Ex 2 - General Strain Formula (uses variable substitution and past formula references):

1 Like

Much appreciated!

Has anyone else got some example(s) using Maxima?

So, if I entered:

into Maxima, and asked it to differentiate wrt M, would it?

I remembered d(u^n)/dx, but I had to brush up on the “Chain Rule” to do it myself.

Ha… was just typing in your formula.

The “ratsimp(%)” is an attempt to simplify the result of the F(M)/F’(M) step.

1 Like

WOW! That was PDQ! The algebra looks a little different in places, but I see a LOT of similarities. It probably just needs some rearrangement and simplification to be an exact match. I’m impressed!

yeah sometimes, a lot of times, the automated simplifications and factoring can be a little difficult to follow/counterintuitive. I wound up doing some value plugins to make sure maxima was returning the same numerical results against some hand checks.

Folks,

Celt83 produced those results 2-3 MINUTES after I asked. Shazam!!!

I’m embarrassed to say how long it took me to do it by hand.

What are you running Maxima on/under? Win10?

Windows 10 on my work machine and Pop!_Os (Ubuntu) on my home laptop.

I couldn’t help myself, so I stopped working and tried this in Julia using Symbolics.jl. It worked but it looks pretty ugly…

2 Likes

And now in Python, using Sympy and a Jupyter Notebook.

2 Likes

The sympy output is neater, bolder, and more concise. In essence, more aesthetically pleasing.

Unfortunately, in my equation immediately before the M^2 term, it’s (k-1)/2, not (R-1)/2.

1 Like

Just a comment out of the blue: it took only a minute to type your formula into Mathcad, click the symbolic operator, and (after correcting a mistake I made because I haven’t use the operator for a while) out popped the result.

The way Mathcad works, however, is you don’t really need to care what the formula looks like after you have made a function with it. Just use it as a function and solve for whatever condition you enter into the dependent variable. Even differentiate at the same time if you want. Which is why I haven’t needed the symbolic solve operator for a while. I would only need it now for high school homework.

Will fix it. Just let me get my kids to school.

Here’s the corrected SymPy version.

1 Like

@avscorreia

FYI

Your first import statement is unnecessary.

I thought so as well but it didn’t work properly without it…

@avscorreia

Works fine for me.

Note sp.sqrt vs sqrt
sp.diff vs diff

import sympy as sp
w, A, P, M, k, g, R, T = sp.symbols(‘w, A, P, M, k, g, R, T’)
f = w/A - P * M * sp.sqrt((kg)/(RT))(1+(k-1)/2M2)((k+1)/(2*(1-k)))
sp.diff(f,M)

Complete Python newbie here.
Thank you for your help!

For my part, I’ve never tried sympy before. Thanks for bringing it to our attention.