Mathcad Toolbox

Mathcad Toolbox - Contains analogs of functions from Mathcad - Сообщения

#1 Опубликовано: 10.11.2010 02:39:50
Вячеслав Мезенцев

Вячеслав Мезенцев

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

Группа: Moderator

Mathcad Toolbox

SMath Studio compatibility SMath Viewer compatibility mono compatibility Extension page Sources


Contents:

Показать спойлер


Examples:

Mathcad Block.sm Mathcad Block. Examples.sm Mathcad%20Block.%20Adams.sm Lorenz%20attractor.sm Chua's%20circuit.sm

Click to enlarge Click to enlarge Click to enlarge Click to enlarge Click to enlarge

Click to enlarge Click to enlarge Click to enlarge Click to enlarge Click to enlarge Click to enlarge

7-13-Three-Planets (Mathcad Block).sm (34 КиБ) скачан 171 раз(а).
7-13-Three-Planets (Mathcad Block).pdf (57 КиБ) скачан 140 раз(а).

7-13-Three-Planets 2 (Mathcad Block).sm (30 КиБ) скачан 112 раз(а).
7-13-Three-Planets 2 (Mathcad Block).pdf (54 КиБ) скачан 85 раз(а).

7-13-Three-Planets 3 (Mathcad Block).sm (25 КиБ) скачан 97 раз(а).
7-13-Three-Planets 3 (Mathcad Block).pdf (55 КиБ) скачан 96 раз(а).

7-13-Three-Planets 4 (Mathcad Block).sm (30 КиБ) скачан 94 раз(а).
7-13-Three-Planets 4 (Mathcad Block).pdf (73 КиБ) скачан 89 раз(а).

7-13-Three-Planets 5 (Mathcad Block).sm (26 КиБ) скачан 125 раз(а).
7-13-Three-Planets 5 (Mathcad Block).pdf (61 КиБ) скачан 94 раз(а).

7-13-Three-Planets 6 (Mathcad Block).sm (26 КиБ) скачан 114 раз(а).
7-13-Three-Planets 6 (Mathcad Block).pdf (67 КиБ) скачан 97 раз(а).

Utility for call dsolvers for initial and boundary values problems from a solver block.

Click to enlarge

Mathcad Block. RKA (Razonar).sm (59 КиБ) скачан 129 раз(а).
Mathcad Block. RKA (Razonar).pdf (66 КиБ) скачан 121 раз(а).

RKA.sm (308 КиБ) скачан 117 раз(а). (last version)
RKA.pdf (931 КиБ) скачан 132 раз(а).

See also:

● [topic=17088]Intel ODE Solver Library[/topic]
● [topic=1918]DotNumerics[/topic]
● [topic=13809]SADEL[/topic]
● [topic=1970]Matlab C++ Math Library[/topic]
● [topic=17063]OSLO[/topic]
● [topic=17067]lsoda[/topic]
● [topic=1997]GNU Scientific Library (GSL)[/topic]
ODE_manual.pdf (239 КиБ) скачан 757 раз(а).
Russia ☭ forever, Viacheslav N. Mezentsev
2 пользователям понравился этот пост
Radovan Omorjan 10.11.2010 08:14:00, Thiago Pereira 27.06.2024 00:24:00
#2 Опубликовано: 10.11.2010 08:36:44
Radovan Omorjan

Radovan Omorjan

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

Группа: Moderator

Many thanks uni for this plugin

Your examples are very interesting (Russian side of the Forum) and I hope that some additional ODE solvers will be implemented as plugins in the near future.
BTW, I've noted that the function used in rkfixed (Система(t;x) in this example) is tolerant to the argument names (t;x here). Actually, rkfixed will not complain if the variables t and x have been already defined - we should be carefull about it.

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#3 Опубликовано: 10.11.2010 10:24:03
Вячеслав Мезенцев

Вячеслав Мезенцев

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

Группа: Moderator

Цитата

I hope that some additional ODE solvers will be implemented as plugins in the near future.


Now it's not so hard. I'll try to implement odesolversolve() from AlgLib project. At this moment I have some functions from there:
AlgLib Plugin (based on ALGLIB 3.1.0)

Дополнение обрабатывает следующие вхождения:
al_airy("число" - Returns the Airy function: Ai(x), Ai'(x), Bi(x) and Bi'(x).
al_beta("1:число"; "2:число" - Beta function
al_convr1d("1:вектор"; "2:число"; "3:вектор"; "4:число" - 1-dimensional real convolution.
al_fftc1d("1:вектор"; "2:число" - 1-dimensional complex FFT
al_fftc1dinv("1:вектор"; "2:число" - 1-dimensional complex FFT

I think I can to implement full functionality. Also (if anybody need) it's possible to create plotting functions like: CreateMesh(), CreateSpace(), implicitplot2d() and implicitplot3d().

P.S. Three functions (CreateMesh(), implicitplot2d() and implicitplot3d()) based on SMath programming tools already exists.
Russia ☭ forever, Viacheslav N. Mezentsev
#4 Опубликовано: 10.11.2010 10:36:37
Radovan Omorjan

Radovan Omorjan

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

Группа: Moderator

Wish you good luck

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#5 Опубликовано: 10.11.2010 11:38:02
frapuano

frapuano

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

Группа: User

UNI

will be wonderful if based on your experience you can write ( if possible ) a further tutorial on how to develop a plugin for Smath for super NewBie like me and probably many others.
I have seen that your program is very detailed/commented but would be nice to have a diary of how you have put toghether the bit an pieces to develop the plugin , the difficulties that you have overcome , which are the biggest problem to face in writing a plug in amd the things that one person should be more carefull to succed .

Thanks a lot for your help

Francesco

P.S. In the last months I am following the Smath forum in Russian af far as is possible through the google traslate approach ( from Russian to English ..whose traslation is better then from Russian to Italian my mother tongue) and is really very interesting . Need to try to learn better Russian language ..hope to find something useful to this aim on Internet, I guess that we are missing a universe of knowledge due to ignoring the language
#6 Опубликовано: 10.11.2010 12:51:21
Вячеслав Мезенцев

Вячеслав Мезенцев

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

Группа: Moderator

Цитата

will be wonderful if based on your experience you can write ( if possible ) a further tutorial on how to develop a plugin for Smath for super NewBie like me and probably many others.


Unfortunately, I don't have the full manual for plugin development. There is a good video-manual for beginners on wiki: Tutorials for Creating Plugins. I used it and also examples from svn. As I see, in English much more materials on this subject than in Russian or other language.
Цитата

I have seen that your program is very detailed/commented but would be nice to have a diary of how you have put toghether the bit an pieces to develop the plugin , the difficulties that you have overcome , which are the biggest problem to face in writing a plug in amd the things that one person should be more carefull to succed.


"Step by step" instructions you mean? It will depend on type of a plugin and algorithm of function. rkfixed() is a difficult example. The main problem was: how to work with function in a plugin? It is better to begin with simple examples like combin() function from video-manual.

Цитата

In the last months I am following the Smath forum in Russian af far as is possible through the google traslate approach ( from Russian to English ..whose traslation is better then from Russian to Italian my mother tongue) and is really very interesting

I'll try to include all those examples in English in SMath Studio. You can try translate.ru.
Russia ☭ forever, Viacheslav N. Mezentsev
#7 Опубликовано: 11.11.2010 16:39:00
Вячеслав Мезенцев

Вячеслав Мезенцев

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

Группа: Moderator

For testing only: ODESolvers.dll (+ Rkadapt())

Click to enlarge
Russia ☭ forever, Viacheslav N. Mezentsev
1 пользователям понравился этот пост
Radovan Omorjan 11.11.2010 17:19:00
#8 Опубликовано: 12.11.2010 05:19:55
Вячеслав Мезенцев

Вячеслав Мезенцев

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

Группа: Moderator

New version: ODESolvers.dll

It works more correctly than previous.
Russia ☭ forever, Viacheslav N. Mezentsev
#9 Опубликовано: 12.11.2010 07:31:11
Radovan Omorjan

Radovan Omorjan

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

Группа: Moderator

Hello,
Wrote

New version: ODESolvers.dll

It works more correctly than previous.


Many thanks for your efforts on making this plugin
The ODE solvers are on the top of my "wish list".

I tested it a bit and this version is indeed much faster then the previous one.
Here is one of my simple test examples for ODE solvers:

And your solvers worked as expected, thank you The previous version was much slower and had a problem with larger "n".
This is also a test for a stiff ODE. As the rkfixed and Rkadapt are not stiff solvers, the result is as presented in the graph. Stiff ODE solver should cope with the situation when y2 is approaching zero.

Here are some of my comments, if you do not mind:
- I am not a programmer but am rather surprised how you managed to get the function as a function parameter (D(t,y) in this case - my congratulations . I suppose the side effect is that rkfixed and Rkadapt will be working wrong if this function (D(t,y)) uses t and vector y with t,y previously defined. I thought that the ODE solver will be realized in a similar way like "roots" function.

- I tried to define function D as a multiline function but this will not work.

Anyway, I am very grateful to you for this plugin.

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#10 Опубликовано: 12.11.2010 12:17:14
Вячеслав Мезенцев

Вячеслав Мезенцев

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

Группа: Moderator

Thank you, Radovan.
Цитата

- I tried to define function D as a multiline function but this will not work.


I asked Andrey about it and he has explained a problem. You can try newnew version: ODESolvers.dll

About comments feedback is necessary to me to fix errors.
Цитата

I am not a programmer but am rather surprised how you managed to get the function as a function parameter (D(t,y).

It is not so simply to explain in a few words about how I do that. May be later, specially for those who is interested.
Russia ☭ forever, Viacheslav N. Mezentsev
#11 Опубликовано: 12.11.2010 13:10:21
Вячеслав Мезенцев

Вячеслав Мезенцев

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

Группа: Moderator

Rkadapt() algorithm. Unfortunately, it doesn't work.
Rkadapt prog.sm


Russia ☭ forever, Viacheslav N. Mezentsev
1 пользователям понравился этот пост
Radovan Omorjan 12.11.2010 18:45:00
#12 Опубликовано: 12.11.2010 15:25:51
Вячеслав Мезенцев

Вячеслав Мезенцев

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

Группа: Moderator

Experiments:
Russia ☭ forever, Viacheslav N. Mezentsev
#13 Опубликовано: 12.11.2010 18:57:49
Radovan Omorjan

Radovan Omorjan

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

Группа: Moderator

Hello uni

Wrote

Rkadapt() algorithm. Unfortunately, it doesn't work.
Rkadapt prog.sm



I took a look at this sm file. On the basis of the error message about the function Rkadapt2 - "The matrix element does'nt exist." and by some inspection I think that there might be a mistake about vectors and row matrix. There might be that you used the single index for row matrix regarding it as a vector, and you might forgot to use two instead of one index.

Regards,
Radovan

P.S. I am not able to test the new *.dll at the moment because I do not know how to use it with portable 0.89_8 version (unfortunately, have no possibility to install SMath at my home computer).
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#14 Опубликовано: 23.11.2010 07:29:21
Radovan Omorjan

Radovan Omorjan

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

Группа: Moderator

Hello uni

I tested a little bit rkfixed and Rkadapt. Here is a simple picture:

It seems, as you mentioned, that Rkadapt will not work with multiline function. However, it is very good that rkfixed will work with it - a bit surprise for me. I also tried to define function f(x,t) by using "eval" - it does not work either with rkfixed or Rkadapt. Due to my previous experience, I thought it would not work. I know that this kind of functions, like you did with rkfixed and Rkadapt, will have troubles due to the SMath way of working. Never mind, I hope that SMath will have tha ability to cope with this kind of problems some day.

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#15 Опубликовано: 06.05.2013 18:16:42
Вячеслав Мезенцев

Вячеслав Мезенцев

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

Группа: Moderator

Updated description.
Russia ☭ forever, Viacheslav N. Mezentsev
#16 Опубликовано: 12.05.2013 15:08:39
Radovan Omorjan

Radovan Omorjan

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

Группа: Moderator

Just tried ODE plugin and figured out that it can accept additional parameters after the first two in D(x,y) function of derivatives.
I might miss that feature, but it should be pointed out that this is very nice and useful

[albumimg]140[/albumimg]

I hope that some stiff solvers would be available sooner or later

Regards,
Radovan
ODE-Lorentz.sm (11 КиБ) скачан 158 раз(а).
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
2 пользователям понравился этот пост
Martin Kraska 12.05.2013 17:27:00, Вячеслав Мезенцев 12.05.2013 15:50:00
#17 Опубликовано: 12.05.2013 15:48:41
Вячеслав Мезенцев

Вячеслав Мезенцев

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

Группа: Moderator

Oh, you found a bug, well, I'll fix it

[albumimg]142[/albumimg]

Usual, in such cases I use a different way of passing parameters, but it doesn't work for this example.

EDIT: I was wrong, it works.

[albumimg]141[/albumimg]
ODE-Lorentz-uni.sm (13 КиБ) скачан 149 раз(а).
Russia ☭ forever, Viacheslav N. Mezentsev
#18 Опубликовано: 12.05.2013 16:41:11
Radovan Omorjan

Radovan Omorjan

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

Группа: Moderator

Wrote

Oh, you found a bug, well, I'll fix it Usual, in such cases I use a different way of passing parameters, but it doesn't work for this example.

EDIT: I was wrong, it works.

[albumimg]141[/albumimg]


Actually, I thought this was by design and that I missed it , and now I am pleasantly surprised . I would prefer my solution, if you do not mind. This way, and in this case - there is a vector with three dependent variables, the rest are parameters (resulting the matrice with four columns). Your solution would have six variables - (resulting the matrice with seven columns). Your example is like the way it works in Mathcad (I never liked this way). If you need additional parameters you must put it in the vector, and use there derivatives equal to zero - it looks a bit artificial.

I also tried this one and it worked as well

[albumimg]143[/albumimg]

Uni, please keep it this way and do not change it

Regards,
Radovan
ODE-Lorentz-2.sm (11 КиБ) скачан 152 раз(а).
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
1 пользователям понравился этот пост
Davide Carpi 12.05.2013 17:29:00
#19 Опубликовано: 12.05.2013 17:26:44
Martin Kraska

Martin Kraska

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

Группа: Moderator

How about this dirty parameter handling...
[albumimg]144[/albumimg][albumimg]145[/albumimg]
Example.sm (12 КиБ) скачан 186 раз(а).
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 пользователям понравился этот пост
Radovan Omorjan 13.05.2013 01:09:00
#20 Опубликовано: 13.05.2013 01:32:56
Radovan Omorjan

Radovan Omorjan

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

Группа: Moderator

Thank you Martin,
Wrote

How about this dirty parameter handling...


Hmm... why dirty? Do not understand, sorry. This looks quite regular to me, except that it is not flexible. The third parameter must always have the same name as in the definition of D().

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