Maxima - Examples for using the Maxima Plugin - Messages
example beam integration piecewise.sm (34 KiB) downloaded 363 time(s).

By the way, I was playing with the special functions from Maxima. It seems to work pretty well, except I do not know how to deal with small numbers - look at the picture please.
Regards,
Radovan
Maxima_spec_functions.sm (10 KiB) downloaded 187 time(s).
In general, if any function in a Maxima-command is known to SMath, it will be evaluated before the call of Maxima. Thus, if you want to see Maxima's erf(), you must switch off the Statistical Tools plugin.
Maxima functions normally can handle vector or matrix arguments (applied by element). Thus plotting should be possible without loops.
There seems to be an expression size restriction for the Maxima call. If the increment in vx in the bessel plotting example is reduced, than the evaluation process seems to hang and needs to be stopped.
WroteIssue was already fixed, obviously became victim of the arg/dec sep change. Is on the todo list again.
Thank you
WroteIn general, if any function in a Maxima-command is known to SMath, it will be evaluated before the call of Maxima. Thus, if you want to see Maxima's erf(), you must switch off the Statistical Tools plugin.
Ah yes, you ar right. You already mentioned this in one of your examples
WroteMaxima functions normally can handle vector or matrix arguments (applied by element). Thus plotting should be possible without loops.
There seems to be an expression size restriction for the Maxima call. If the increment in vx in the bessel plotting example is reduced, than the evaluation process seems to hang and needs to be stopped.
I like this vector, matrix handling thing. It looks to me that in this way we can get numerical values by avoiding loops. As for the matrix, vector sizes in Maxima(float()) expressions, I looked at the "string" expression passed to Maxima system and suppose this has to do with the maximal size of the string Maxima can handle.
Regards,
Radovan
WroteI do not know how to deal with small numbers - look at the picture please.
Fixed, plugin updated. For other changes see Update description sheet
One needs to experiment a bit in order to completely avoid "evil red text" (verbatim Maxima code) in Maxima() arguments.
Example Maxima Laplace.sm (19 KiB) downloaded 131 time(s).
This is actually done using the current public state of the plugin, but cannot be recommended yet for serious work. Setting the plot options is painful (because of the many translation errors it causes) and functionality is very limited therefore. Actually, it is gnuplot doing the job in the background.
Limitations:
- you cannot specify output names with extensions or path specifications (currently no way to convey . or \ in strings to Maxima)
- therefore no way to use svg output, as image region refuses to display svg files without extension (complains about insufficient memory).
- we have problems with list translation, thus parameter handling for plot functions is unstable. Perhaps we need to really parse the expression structure in order to get this right (currently, translation is based on a set of regular expressions).
Edit: the plot files are written to the install directory of SMath.
plotting.sm (22 KiB) downloaded 193 time(s).
Limitations:
- still no way to send strings to maxima, thus no path names, no file name extensions and no options with space characters such as "png size 300 200"
- any command or option must not have strings in it, however, most options may be written as plain variable names.
- different plots need different filenames, it can work with one name for all plots of a sheet but that is not reliable.
- Calls to set_plot_options() fail to display the result in SMath but do their job on the Maxima side.
- EDIT: Again, all this works only, if your current directory is the SMath install directory.
The good news is that so far all plots from the maxima handbook which I've tried did actually work. Also, the format for options spec is quite readable.
[albumimg]323[/albumimg][albumimg]325[/albumimg]
plotting.sm (18 KiB) downloaded 149 time(s).
I was playing with ODE.2 (nice job Martin

I could not see the source of this difference - only in one point, I think (look at the green line please). Have I missed something?
Regards,
Radovan
For the time being you may replace the file smath.mac in the SMath install dir by the attached one (zipped because of .mac attachments blocked).
EDIT: you can save computation/translation time by doing the numeric evaluation on Maxima side
Wrote... bumped into this difference about numeric and symbolic optimization, again.
I could not see the source of this difference - only in one point, I think (look at the green line please). Have I missed something?
Regards,
Radovan
Fixed, Plugin updated.
Note that this required implementation of string constant transfer between SMath and Maxima.
Background has been set to nearly white to avoid transparency in the image region.
svg.sm (23 KiB) downloaded 140 time(s).
Here is an example of using distrib package in Maxima. One can also use Statistical Tools plugin, but there are some important quantile functions missing there.
I also used Function's Extension plugin.
By the way, I also tried descriptive and stats packages, but they can not be loaded (draw package is problematic here). I do not know what is the problem here. Just accepted that some of the packages, like the mentioned ones, can not be used at this stage of Maxima plugin development. Did not want to bother to much

Regards,
Radovan
If I open the first one (distrib-Maxima-1.sm) and do the recalculation few times, sometimes it just fail (see the second picture). When I open additionally ODE.2-Plugflow-2.sm and recalculate distrib-Maxima-1.sm, again some unexpected errors appear (see the third picture).
If someone is wiling, try to reproduce please.
Regards,
Radovan
I can reproduce the reported problem.
Your distrib sheet relies on Maxima not taking over the internal functions, because the sum() function works differently in Maxima and thus corrupts most programs using the sum function (just like StdDev()).
As all sheets of a given SMath instance share the same Maxima session and plugin settings, the takeover/surrender status is global for all open sheets. In ODE.2... you explicitly ask for takeover, thus after doing that, distrib...sm won't work any more.
Thus, add MaximaControl("surrender" ) to your distrib sheet, then the problem is solved.
I see the following problems to be solved:
- the takeover/surrender status should be local to a given sheet (this might require considerable effort)
- the takeover/surrender status should be reset to default upon cleanup and restart (this is just a bug, to be fixed)
- the sum takeover/surrender should be controlled separately, because the maxima version is good for symbolic handling but incompatible to the native version otherwise.
- perhaps we might switch to takeover of int(), det(), lim() and surrender for sum and diff by default.
By the way, did you have a chance to open the distrib sheet on a 64bit computer. This time just to open only this sheet - without the second one. I am just surprised because the subsequent recalculation on my home 32 bit Win7 worked well and did not produce an error. Contrary, on my office 64bit the subsequent recalculation sometimes produces an error in loading distrib package (picture two on the previous post). I just do not know when and why is this happening. If you can not reproduce this, I will make a video presentation of this behavior when I get to my office.
Regards,
Radovan
-
New Posts
-
No New Posts