Maxima

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

#41 Опубликовано: 04.01.2014 09:52:21
Radovan Omorjan

Radovan Omorjan

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

Группа: Moderator

Nothing spectacular, just followed Martin's example from the least squared fit and produced this simple plot after using the problematic function from stats package. It was a bit trial-and-error, and it might be not so elegant-but it works.

Regards,
Radaovan
stats-testing-5.png
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#42 Опубликовано: 04.01.2014 14:58:55
Martin Kraska

Martin Kraska

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

Группа: Moderator

I added a plot with the draw package and tried to streamline the regression.

The result of the statistics functions is a so called inference_result object, being essentially a list structure with a set of access functions.
items_inference(obj) lists the available attributes, take_inference(attr,obj) returns the value of the specified attribute.

An advantage of the draw package is that you can plot 2 column matrices just like in SMath. Thus the example works without a single list<>matrix conversion.
Example Maxima stats draw.sm (14 КиБ) скачан 135 раз(а).
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 пользователям понравился этот пост
Radovan Omorjan 04.01.2014 18:24:00
#43 Опубликовано: 04.01.2014 18:40:16
Radovan Omorjan

Radovan Omorjan

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

Группа: Moderator

Thank you Martin very much,

It does really work and it is quite nice . I think I understand a bit more how the things are working
The "inference_results" thing is a good one as well. I do not now how much time it would take to figure out myself. Thank you.

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#44 Опубликовано: 19.01.2014 20:24:19
Martin Kraska

Martin Kraska

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

Группа: Moderator

Here is how the gaps in StatisticalTools by Davide could be filled. The quantile functions, however, are rather slow. I don't know if that is due to slow translation or to the slow algorithm. Also, the chi2-quantile seems to not be robust (sometimes fails to be plotted).

The function definitions in the attached sheet are not entirely consistent to Davide's plugin, as they do not produce a 2 column matrix when they receive vector input.

Davide, if you do not want to use the Maxima algorithms in your plugin (which might be more efficient), then we could provide the functions as part of the Maxima-plugin.
stats.PNG
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 пользователям понравился этот пост
Radovan Omorjan 20.01.2014 02:22:00
#45 Опубликовано: 20.01.2014 02:26:53
Radovan Omorjan

Radovan Omorjan

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

Группа: Moderator

Wrote

Davide, if you do not want to use the Maxima algorithms in your plugin (which might be more efficient), then we could provide the functions as part of the Maxima-plugin.


Thank you Martin for pointing this out once more. As I know, Davide asked for some appropriate algorithms to fill the gap in the StatisticalTools. These quantile functions which missed there are one of the most frequently used. It would be rather useful if they are inside Statistical tools, although we have them via Maxima as Martin presented.

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#46 Опубликовано: 29.03.2014 20:33:40
baijo

baijo

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

Группа: User

Would like to use the plot/draw functions from maxima in the executable file generated by the Smath viewer.
#47 Опубликовано: 30.03.2014 05:07:01
Martin Kraska

Martin Kraska

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

Группа: Moderator

Wrote

Would like to use the plot/draw functions from maxima in the executable file generated by the Smath viewer.


You might file your feature request in the bug tracking system. Please attach an .sm sheet for testing.
However, providing Maxima as part of compiled software might violate their license terms.
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#48 Опубликовано: 17.04.2014 18:20:12
Martin Kraska

Martin Kraska

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

Группа: Moderator

Here is a small program for generation of Ashby-like material property charts. The data has been taken from the online ressources for Buchmayr 2002. Besides the Maxima plugin and it's drawing functions this program also demonstrates the use of varous plugins by Davide (Table, Slider, DataExchange, Checkbutton List)

It would be easy to generate the bubbles in the modeller region. But that has to wait until Andrey finds some time to document how to place text annotations.
Then one might be able to click the bubbles in order to create and place label strings.

EDIT: Due to a checkboxlist bug I had to remove the material chooser. For now you have to switch on and off the materials by setting the corresponding entry in gr.sel to 1 or 0.
Werkstoffdiagramme.zip (48 КиБ) скачан 138 раз(а).
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
2 пользователям понравился этот пост
Davide Carpi 18.04.2014 06:15:00, IVR 18.04.2014 12:03:00
#49 Опубликовано: 18.04.2014 06:17:36
Davide Carpi

Davide Carpi

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

Группа: Moderator

Thanks Martin, nice work

CheckBoxList is under development (alpha/not public - in this state it's "naturally" buggy) :d


Best regards,

Davide


edit: for the testers, there's a plugin in the EM to open and save again worksheets containing ComboBoxList regions.
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#50 Опубликовано: 18.04.2014 18:50:34
Martin Kraska

Martin Kraska

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

Группа: Moderator

Improved version of the Ashby chart generator.
- bubbles are elliptic
- minimal bubble size independent of axes limits
- separate checkboxes for selection of material groups
materials.PNG
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#51 Опубликовано: 28.05.2014 12:27:03
Martin Kraska

Martin Kraska

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

Группа: Moderator

Here is a modified version of Radovan's distrib-example. Changes were required, because of
- The plugin does not convert Maxima lists to SMath vectors any more,
- distrib functions seem to require float arguments.
distrib.png
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 пользователям понравился этот пост
Radovan Omorjan 28.05.2014 12:32:00
#52 Опубликовано: 29.05.2014 05:21:39
Radovan Omorjan

Radovan Omorjan

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

Группа: Moderator

Thank you Martin for correcting the example. Here is another one using F distribution from Maxima distrib package. Statistical plugin by Davide is used as well. There is a nice feature in this plugin of returning two columns when using probability distribution functions (missing quantile functions unfortunately). One more interesting thing is to note about distrib package functions. They will not use vectors as arguments returning vector results - therefore we have to use loops (see the second picture). This is contrary to other Maxima examples where we can avoid loops in Smath

Regards,
Radovan
maximapdf.png
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
1 пользователям понравился этот пост
Davide Carpi 29.05.2014 05:25:00
#53 Опубликовано: 29.05.2014 18:09:22
Martin Kraska

Martin Kraska

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

Группа: Moderator

Wrote

One more interesting thing is to note about distrib package functions. They will not use vectors as arguments returning vector results - therefore we have to use loops (see the second picture). This is contrary to other Maxima examples where we can avoid loops in Smath



Much like the SMath plugins, many Maxima features are provided by third party packages (wrt the core development team) and there are as many opinions on what a good function interface is as there are contributors.

It is surely possible to re-define the Maxima functions such that they accept matrix arguments and return two-col matrices in that case. If you have a corresponding idea, then you can add the definition to your maxima.xml and try if it works. We can then include this into the plugin distribution.

I added a Maxima based plot to the sheet.


distrib-Maxima_Kr_F.sm (101 КиБ) скачан 132 раз(а).
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#54 Опубликовано: 30.05.2014 03:37:49
Radovan Omorjan

Radovan Omorjan

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

Группа: Moderator

Thank you Martin for this one . You read my mind, as I was browsing your Maxima drawing examples reminding the Draw2D options and trying to do a similar thing. Now, you've made me a template. Thank you.

About the changing maxima.xml, unfortunately it is beyond my capabilities at the moment. I am far from being an advanced user of these things - just a curious one.

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#55 Опубликовано: 30.05.2014 07:29:33
Radovan Omorjan

Radovan Omorjan

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

Группа: Moderator

Here is another simple example of using SMath and Maxima plugin for a textbook example. One has to admit that teaching with SMath might be a fun

Regards,
Radovan
texbook example units.png
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#56 Опубликовано: 05.06.2014 13:29:30
Martin Kraska

Martin Kraska

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

Группа: Moderator

Here is an example (LRC oscillator) for solving differential equations from the Maxima mailing list. The combination of SMath Studio and Maxima has much better and more convenient support for units than native Maxima.

The first version solves the generic system of differential and linear algebraic equations directly. A second version is to follow in the next post.
Example Maxima desolve.sm (12 КиБ) скачан 117 раз(а).
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 пользователям понравился этот пост
Radovan Omorjan 06.06.2014 01:17:00
#57 Опубликовано: 05.06.2014 13:36:27
Martin Kraska

Martin Kraska

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

Группа: Moderator

And here is a version of the previous example where we reduce the system to a second order ODE using Maxima's ev() function. Due to spurious imaginary parts in the numeric evaluation of the result, we have to use Maxima again for extraction of the real part.
lrc1.PNG
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 пользователям понравился этот пост
Radovan Omorjan 06.06.2014 01:17:00
#58 Опубликовано: 06.06.2014 01:21:13
Radovan Omorjan

Radovan Omorjan

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

Группа: Moderator

Nice example of desolve(), especially pointing out using of units. Thank you Martin.

Moreover, I just forgot this trick about setting x-range on the native Smath 2D plot.

Regards,
Radovan
Example x-range.png
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#59 Опубликовано: 06.06.2014 06:57:37
Radovan Omorjan

Radovan Omorjan

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

Группа: Moderator

Just testing desolve() based on the example from Maxima by Example. I am not sure that desolve() can solve other than initial conditions for t=0.

Regards,
Radovan
odesolve-ode2.png
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
1 пользователям понравился этот пост
Martin Kraska 06.06.2014 09:39:00
#60 Опубликовано: 06.06.2014 09:52:59
Martin Kraska

Martin Kraska

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

Группа: Moderator

Wrote

I am not sure that desolve() can solve other than initial conditions for t=0.


Maxima doc says that initial conditions can only be specified for x=0. One might wonder why then t has to be specified in atvalue(), but that function has more uses than just specification of initial conditions.

BTW, you also can use ODE.2, a wrapper for ode2, with preprocessing of the equation switched off.
Also, you can specify the initial conditions in Solve using Davide's at().


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