Maxima

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

#21 Опубликовано: 26.11.2013 04:34:02
Radovan Omorjan

Radovan Omorjan

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

Группа: Moderator

Wrote

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.



Have no idea what is going on??? Here is what happened on my x64 Win7 notebook Maxima load()
I can not see any pattern here, sometimes recalculating many times worked fine and once or twice failed. Sometimes every few calculations it fails.

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
1 пользователям понравился этот пост
Martin Kraska 26.11.2013 12:55:00
#22 Опубликовано: 26.11.2013 12:59:41
Martin Kraska

Martin Kraska

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

Группа: Moderator

There may be issues with the socket connection, Kay will have a look at these problems. Stabilizing is on top of our agenda.
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#23 Опубликовано: 27.12.2013 13:44:15
Martin Kraska

Martin Kraska

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

Группа: Moderator

Here are some examples, showing the following issues:
  • how to create log plots
  • how to perform a nonlinear least square fit
  • how to work around translation problems. Currently, no nested lists and no mixed list and matrix arguments are allowed.

The trick with mixed and nested arguments is to define them step by step as Maxima variables.
Please note that you must kill such variables before you can re-define them.

EDIT: HV_WEZ.prn data file added (zipped, because prn files are not allowed as attachments).
HV_WEZ.zip (247 Б) скачан 94 раз(а).
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 пользователям понравился этот пост
Radovan Omorjan 27.12.2013 15:10:00
#24 Опубликовано: 27.12.2013 15:26:02
Radovan Omorjan

Radovan Omorjan

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

Группа: Moderator

Hello Martin,

The file "HV_WEZ.prn" is missing here and there are errors in "HV_WEZ_lsquares.sm".
Could you add this file please. I just tried with some random data, sometimes partially worked sometimes not.
There are some "empty stack" errors and I just wanted to check this with your file or the data matrix you used.

Regards,
Radovan

Edit: I manage somehow to use the data from your plot just randomly, and it seems to work. Very nice
Still, I do not know what those "stack empty" mean

By the way, it seems that you manage that we can resize the plots now? As I remember it was not possible before

Edit2: Ah yes, I can see you added the data - thank you
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
1 пользователям понравился этот пост
Martin Kraska 27.12.2013 16:25:00
#25 Опубликовано: 27.12.2013 18:27:21
Martin Kraska

Martin Kraska

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

Группа: Moderator

Sorry, I forgot the datafile, it is now added. The fitting procedure is not really robust, thus it may fail easily when the data is changed or the initial values are to far off.

empty stack errors result from back-translation problems (if the result contains nested lists), yet the maxima commands work.

Resizing the images works for images created with the standard gnuplot interface of Maxima, images generated with the draw package still cannot be scaled (did not yet find the right settings).
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 пользователям понравился этот пост
Radovan Omorjan 28.12.2013 02:32:00
#26 Опубликовано: 28.12.2013 02:42:48
Radovan Omorjan

Radovan Omorjan

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

Группа: Moderator

Wrote

Resizing the images works for images created with the standard gnuplot interface of Maxima, images generated with the draw package still cannot be scaled (did not yet find the right settings).


Ah yes, you are right. Did not pay attention, sorry.
Here are some examples with draw package
[albumimg]327[/albumimg][albumimg]328[/albumimg][albumimg]329[/albumimg][albumimg]330[/albumimg]

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
1 пользователям понравился этот пост
Martin Kraska 02.01.2014 22:27:00
#27 Опубликовано: 02.01.2014 22:28:44
Martin Kraska

Martin Kraska

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

Группа: Moderator

from the gnuplot examples page
param.PNG
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#28 Опубликовано: 02.01.2014 22:30:29
Martin Kraska

Martin Kraska

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

Группа: Moderator

From the gnuplot examples page

EDIT: file corrected
Example Maxima Gnuplot transparent solids.sm (10 КиБ) скачан 107 раз(а).
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
2 пользователям понравился этот пост
Radovan Omorjan 03.01.2014 02:43:00, Вячеслав Мезенцев 03.01.2014 12:31:00
#29 Опубликовано: 03.01.2014 02:44:22
Radovan Omorjan

Radovan Omorjan

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

Группа: Moderator

Thank you Martin,

I did not have a success for this example. Here is the log file. I suppose the problem is in the international settings (coma, semicolon etc.)

Regards,
Radovan
Maxima.zip (1 КиБ) скачан 80 раз(а).
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
1 пользователям понравился этот пост
Martin Kraska 03.01.2014 04:25:00
#30 Опубликовано: 03.01.2014 05:13:08
Martin Kraska

Martin Kraska

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

Группа: Moderator

I uploaded the wrong version of the file, corrected now. Lists as function arguments seem to have some complexity limit. Inspection of the log file shows that the translator re-uses the strings from the preamble list in the right hand sides of other options, where expressions are expected, not strings. I don't know if there is a quick fix.

In the meantime, we either have to limit the complexity or to define Maxima variables.

You can assign the previous expression to a variable l by Maxima("$l:%$" )
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 пользователям понравился этот пост
Radovan Omorjan 03.01.2014 06:32:00
#31 Опубликовано: 03.01.2014 06:35:48
Radovan Omorjan

Radovan Omorjan

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

Группа: Moderator

Yes it is Ok now. Thank you

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

Martin Kraska

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

Группа: Moderator

Example for linear programming and plotting
simplex.PNG
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 пользователям понравился этот пост
Radovan Omorjan 03.01.2014 11:59:00
#33 Опубликовано: 03.01.2014 12:21:30
Radovan Omorjan

Radovan Omorjan

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

Группа: Moderator

This was nice as well, thank you

By the way, I tried most of the stats hypothesis testing functions and they work by following your example how to do that. One of them did not work regarding simple linear regression. Here are the test file and the log file as well. From the debug window I had the impression that the calculations performed well, but there is no SMath output (again "stack empty" error).

Regards,
Radovan
stats-testing.png
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
1 пользователям понравился этот пост
Martin Kraska 03.01.2014 13:10:00
#34 Опубликовано: 03.01.2014 13:04:28
Martin Kraska

Martin Kraska

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

Группа: Moderator

There seems to be a problem with display of functions with list arguments. In the given case, you can avoid the function in the output by wrapping it in args(), which returns a list of the function arguments.
The outer mat2sys is just for cosmetic reason. I just prefer that type of results being left justified.

Make sure to set optimization None in the function call and in results display to get float results. Opt numeric won't work due to the texts being bare variable names.

It seems that the functions are capable of handling matrices.
Example Maxima stats.sm (16 КиБ) скачан 92 раз(а).
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 пользователям понравился этот пост
Radovan Omorjan 03.01.2014 14:00:00
#35 Опубликовано: 03.01.2014 13:57:02
Radovan Omorjan

Radovan Omorjan

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

Группа: Moderator

Unfortunately, it does not work for me.

I can not use matrices here, therefore I defined it in Maxima with Maxima( "$ $" ). If I use a matrix like you did with matrix M, the error message in the debug window appeared

"
apply: second argument must be a list; found: M
#0: simple_linear_regression(dat=M,select=[conflevel = 0.99])
-- an error. To debug this try: debugmode(true);
(%i7) "

Moreover, when I use the same command as you did, no result - stack empty again, although still look that the result is here - see the log file please.

Regards,
Radovan
Maxima.zip (1 КиБ) скачан 79 раз(а).
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#36 Опубликовано: 03.01.2014 16:13:36
Martin Kraska

Martin Kraska

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

Группа: Moderator

The problems seem to be arg/dec separator related. I can reproduce a crash with my file. It occures in the back-translation step. This is definitely a bug with little chance of fast fixing (Kay has to focus on exam session).

What puzzles me is that the error message refers to the second argument. In the call, M is (should be) the first argument.

If you still want to go on testing, then as a workaround you might extract individual elements of the solution. Could you please try that? If that works, then the matrices should not be an issue. Could, however, be a Maxima version issue (newer versions might be more picky about argument type than mine). I still use 5.31.1-1.
stats.PNG
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#37 Опубликовано: 03.01.2014 17:42:58
Radovan Omorjan

Radovan Omorjan

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

Группа: Moderator

I use the same Maxima version as you do 5.31.1-1. I am really puzzled that whatever works for you in this example, it does not work for me. I just tried and again here are the two pictures with matrices M defined in two ways and their respective logs - with errors. I also noted that matrix M is referred as second argument? Have no idea what that might be. I alo tried to change the arg/dec into coma and semicolon - no sucess.

If there is anything else I could try regarding this - just let me know. Otherwise, we can just wait for Kay

Regards,
Radovan
stats-testing-2.png
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#38 Опубликовано: 03.01.2014 19:00:21
Martin Kraska

Martin Kraska

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

Группа: Moderator

I think there are two problems:

1. If in the debugger, you have to set the preprocessing flag. Otherwise M is not replaced by it's symbolic contents. The dialog is obscured by the log but I would bet a pivo that you did not set the flag ;-)
2. You applied the second el() function to the index 2, not to the complete expression. You want the first list from the result structure. I admit, that this was not obvious from the screenshot.

Removing the debug flag from the Maxima call and correcting the el function should do the job.
stats.PNG
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#39 Опубликовано: 03.01.2014 19:11:51
Martin Kraska

Martin Kraska

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

Группа: Moderator

Example plots from the drawdf package documentation. This package provides functions for direction field plots. The sheet is tested with ;, and ,. arg and dec separator settings.
Examples maxima drawdf.sm (61 КиБ) скачан 111 раз(а).
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 пользователям понравился этот пост
Radovan Omorjan 04.01.2014 04:11:00
#40 Опубликовано: 04.01.2014 04:34:50
Radovan Omorjan

Radovan Omorjan

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

Группа: Moderator

Wrote

1. If in the debugger, you have to set the preprocessing flag. Otherwise M is not replaced by it's symbolic contents. The dialog is obscured by the log but I would bet a pivo that you did not set the flag ;-)


You definetelly won a pivo (more than one actually ).

Wrote


2. You applied the second el() function to the index 2, not to the complete expression. You want the first list from the result structure. I admit, that this was not obvious from the screenshot.

Removing the debug flag from the Maxima call and correcting the el function should do the job.


You are right again, my mistake sorry. Here is the screenshot. If I understood you well, the complete calling of the entire system here is problematic - maybe a bug (sometimes it crashed for me as well) but it can be done by calling one by one - like in the picture.

Regards,
Radovan
stats-testing-3.png
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений