Maxima

Maxima - Examples for using the Maxima Plugin - Сообщения

#1 Опубликовано: 24.09.2013 17:14:54
Martin Kraska

Martin Kraska

1222 сообщений из 2150 понравились пользователям.

Группа: Moderator

Example for beam calculation using separate integration intervals.
example beam integration piecewise.sm (34 КиБ) скачан 363 раз(а).
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
3 пользователям понравился этот пост
Davide Carpi 25.09.2013 06:29:00, Radovan Omorjan 24.09.2013 17:49:00, ioan92 27.09.2013 04:06:00
#2 Опубликовано: 24.09.2013 18:47:25
Radovan Omorjan

Radovan Omorjan

325 сообщений из 2052 понравились пользователям.

Группа: Moderator

Thanks Martin

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 КиБ) скачан 187 раз(а).
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
1 пользователям понравился этот пост
Martin Kraska 25.09.2013 12:19:00
#3 Опубликовано: 25.09.2013 02:25:47
Davide Carpi

Davide Carpi

1415 сообщений из 2872 понравились пользователям.

Группа: Moderator

E must be replaced by *10^ before sending the answer to the canvas (inside the plugin, obviously)
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
1 пользователям понравился этот пост
Radovan Omorjan 25.09.2013 03:16:00
#4 Опубликовано: 25.09.2013 07:29:29
Martin Kraska

Martin Kraska

1222 сообщений из 2150 понравились пользователям.

Группа: Moderator

Issue was already fixed, obviously became victim of the arg/dec sep change. Is on the todo list again.

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.
mplot.PNG
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#5 Опубликовано: 26.09.2013 01:27:52
Radovan Omorjan

Radovan Omorjan

325 сообщений из 2052 понравились пользователям.

Группа: Moderator

Wrote

Issue was already fixed, obviously became victim of the arg/dec sep change. Is on the todo list again.


Thank you
Wrote

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.


Ah yes, you ar right. You already mentioned this in one of your examples
Wrote

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.


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
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
1 пользователям понравился этот пост
Martin Kraska 28.09.2013 18:53:00
#6 Опубликовано: 29.09.2013 11:03:45
Martin Kraska

Martin Kraska

1222 сообщений из 2150 понравились пользователям.

Группа: Moderator

Wrote

I do not know how to deal with small numbers - look at the picture please.



Fixed, plugin updated. For other changes see Update description sheet
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#7 Опубликовано: 29.09.2013 11:05:34
Martin Kraska

Martin Kraska

1222 сообщений из 2150 понравились пользователям.

Группа: Moderator

Wrote

I do not know how to deal with small numbers - look at the picture please.



Fixed, plugin updated.
float.PNG
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 пользователям понравился этот пост
Radovan Omorjan 29.09.2013 14:35:00
#8 Опубликовано: 10.10.2013 18:32:00
Martin Kraska

Martin Kraska

1222 сообщений из 2150 понравились пользователям.

Группа: Moderator

Laplace transformation with Maxima. Examples from the Maxima Handbook.
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 КиБ) скачан 131 раз(а).
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 пользователям понравился этот пост
Radovan Omorjan 11.10.2013 01:16:00
#9 Опубликовано: 16.10.2013 17:30:19
Martin Kraska

Martin Kraska

1222 сообщений из 2150 понравились пользователям.

Группа: Moderator

Here is a preview, how plotting can work with the Maxima plugin.

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 КиБ) скачан 193 раз(а).
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
2 пользователям понравился этот пост
Radovan Omorjan 17.10.2013 01:05:00, IVR 17.10.2013 03:54:00
#10 Опубликовано: 18.10.2013 15:47:08
Martin Kraska

Martin Kraska

1222 сообщений из 2150 понравились пользователям.

Группа: Moderator

Some more examples for plots with Maxima and Gnuplot.

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 КиБ) скачан 149 раз(а).
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 пользователям понравился этот пост
Radovan Omorjan 18.10.2013 16:06:00
#11 Опубликовано: 27.10.2013 18:05:39
Martin Kraska

Martin Kraska

1222 сообщений из 2150 понравились пользователям.

Группа: Moderator

Examples for using the ODE.2() function
ODE.2.sm (28 КиБ) скачан 132 раз(а).
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
3 пользователям понравился этот пост
IVR 29.10.2013 08:34:00, Radovan Omorjan 28.10.2013 08:34:00, sergio 29.10.2013 04:36:00
#12 Опубликовано: 31.10.2013 13:31:23
Radovan Omorjan

Radovan Omorjan

325 сообщений из 2052 понравились пользователям.

Группа: Moderator

Hello,

I was playing with ODE.2 (nice job Martin ) and 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
maximaoptnum.png
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
1 пользователям понравился этот пост
Martin Kraska 31.10.2013 16:19:00
#13 Опубликовано: 31.10.2013 16:26:57
Martin Kraska

Martin Kraska

1222 сообщений из 2150 понравились пользователям.

Группа: Moderator

Radovan, thanks for highlighting the problem. The source is in the different handling of expressions of type a^b^c in Maxima and SMath. The fix is much like with the a^-b problem. We include it in the next update of the plugin.

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
float.PNG
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 пользователям понравился этот пост
Radovan Omorjan 31.10.2013 17:26:00
#14 Опубликовано: 10.11.2013 09:15:04
Martin Kraska

Martin Kraska

1222 сообщений из 2150 понравились пользователям.

Группа: Moderator

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.
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 пользователям понравился этот пост
Radovan Omorjan 10.11.2013 12:50:00
#15 Опубликовано: 10.11.2013 09:33:37
Martin Kraska

Martin Kraska

1222 сообщений из 2150 понравились пользователям.

Группа: Moderator

Examples, how SVG images of variable size can be generated using Maxima plugin.
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 КиБ) скачан 140 раз(а).
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 пользователям понравился этот пост
Radovan Omorjan 10.11.2013 12:50:00
#16 Опубликовано: 24.11.2013 20:33:59
Radovan Omorjan

Radovan Omorjan

325 сообщений из 2052 понравились пользователям.

Группа: Moderator

Hello,

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
distrib-Maxima.png
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
1 пользователям понравился этот пост
Martin Kraska 25.11.2013 13:04:00
#17 Опубликовано: 25.11.2013 12:17:02
Radovan Omorjan

Radovan Omorjan

325 сообщений из 2052 понравились пользователям.

Группа: Moderator

Here what happened on my x64-Win7 laptop and Martin's unofficial build. Find two test files (distrib-Maxima-1.sm and ODE.2-Plugflow-2.sm).
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
distrib-Maxima-3.png
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
1 пользователям понравился этот пост
Martin Kraska 25.11.2013 13:04:00
#18 Опубликовано: 25.11.2013 13:03:53
Martin Kraska

Martin Kraska

1222 сообщений из 2150 понравились пользователям.

Группа: Moderator

Hi Radovan, thanks for your examples on statistics with Maxima.

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.
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 пользователям понравился этот пост
Radovan Omorjan 25.11.2013 13:49:00
#19 Опубликовано: 25.11.2013 13:49:06
Radovan Omorjan

Radovan Omorjan

325 сообщений из 2052 понравились пользователям.

Группа: Moderator

Thank you Martin. I just did not pay enough attention on takeover/surrender issue.

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
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#20 Опубликовано: 25.11.2013 18:16:33
Martin Kraska

Martin Kraska

1222 сообщений из 2150 понравились пользователям.

Группа: Moderator

I always use my x64 Win7 notebook. I had very severe problems when trying your files at work. Now at home (same computer), I cannot reproduce them, except the StdDev issue with Maxima sum. I saw rubbish error messages containing §§ characters.



Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений