Maxima has a fairly serviceable Laplace transform utility built-in. Here’s an example from the popular ordinary differential equations book by Blanchard, Devaney and Hall:
Trouble arises when we look at discontinuous forcing functions, which is especially sad because it seems to me that’s what makes it worthwhile to spend time with Laplace transforms. In particular, the inverse transform function ilt() fails on the Heaviside Function and Dirac Delta, even though the built-in laplace() treats them correctly:
So, I’ve written an alternative inverse Laplace function laplaceInv() that fixes that problem:
Here are a few differential equation solutions to show how the new function behaves:
A second-order linear equation with a constant forcing function that vanishes at
A second-order equation with two impulsive forces:
The new Laplace transform Maxima function can be downloaded here.
A few months ago, inspired by the PYPL PopularitY of Programming Language, I compared Google trends data for the 3M of CAS software: Maxima, Maple, and Mathematica based searches of the form “<language> tutorial”. The result was that Maxima seems to be slowly increasing in popularity with about 20% of the interest in the 3M.
Today I saw another popularity metric: The TIOBE index. Using their methodology of Google trends data for the search string <language> + programming, I have these results for the proportion of searches among the 3M:
Today, a student turned in some Maxima work for my class. I discovered he had successfully used the command derivative() in place of diff() with seemingly identical results. I verified that the same thing works in several versions of Maxima I have installed on my windows computer. Who knew?
Here’s something I just learned and want to share with others and record for my use the next time I need to do this and have already forgotten!
The position and appearance of the figure legend in Maxima plots drawn with plot() (by setting gnuplot_preamble) and in draw() (by setting user_preamble), can be manipulated to any of the gnuplot options listed here.
Here are some examples:
In MATLAB, I occasionally have need for the plotyy() command for making a plot of two different functions with widely varying scales.
Turns out Maxima draw has an equivalent functionality by setting the option yaxis_secondary:
Here’s the documentation.
In MATLAB, pause
interrupts execution of a loop until the user strikes a key, and pause(<n>)
pauses for <n>
seconds before resuming execution.
Here’s my attempt at a pause() function for Maxima that works in a similar way to MATLAB. It uses Maxima’s read() to stop everything and wait for user input, and it uses the lisp function sleep to stop for a fixed number of seconds.
**note that a lisp function
can be called inside Maxima as
I’m not happy that in order to resume after the pause, the user needs to enter a valid character (space or nothing results in an error) followed by CTRL-SHIFT. I hope to either figure something else out or even better hear suggestions from other Maxima users!
if tsecs=0 then
read("Execution Paused...enter any character then CTRL-ENTER")
disp(sconcat("paused for ", tsecs," seconds")),
call this either as
or, for a three second pause
In MATLAB, I often use the subplot() command to make an array of multiple plots in a single figure.
In Maxima, we can achieve that by generating each of the subplots using gr2d(), and then putting them all together with a call to draw() or wxdraw():
There’s an optional columns argument — the subplots are drawn row-wise in an array with the specified number of columns:
And of course all this works for 3d plots using gr3d():