AlgLib 3.1x

AlgLib 3.1x - AlgLib Plugin (based on ALGLIB 3.1x) - Сообщения

#1 Опубликовано: 26.04.2013 18:52:04
Martin Kraska

Martin Kraska

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

Группа: Moderator

Didn't find an explicit alglib topic, thus I post this here:

It seems that the convolution function from the alglib plugin does not care for the second and fourth arguments (problem size in alglib ). I guess that the problem size is nothing else than the size of the 1st and 3rd arguments, thus they are obsolete.

If that is correct than I suggest to provide a convr1d(2) function.
BTW, a real symmetric eigensolver would be fine...

It seems that the alglib license does not allow for inclusion of the plugin in any smath distribution, except if someone buys a commercial license.

[Moderator]: Moved.
conv.sm (6 КиБ) скачан 170 раз(а).
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#2 Опубликовано: 27.04.2013 06:18:16
Вячеслав Мезенцев

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

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

Группа: Moderator

AlgLib 3.1x

SMath Studio compatibility SMath Viewer compatibility mono compatibility Extension page Sources


Functions list: al_airy(), al_beta(), al_convr1d(), al_convr1dinv(), al_fftc1d(), al_fftc1dinv(), al_nleqsolve(), al_rkckadapt(), al_polyroots().


[albumimg]81[/albumimg] [albumimg]83[/albumimg] [albumimg]121[/albumimg] [albumimg]1546[/albumimg] [albumimg]1585[/albumimg]
[albumimg]1560[/albumimg] [albumimg]1547[/albumimg] [albumimg]1561[/albumimg] [albumimg]1562[/albumimg] [albumimg]1563[/albumimg]

Examples:

alglib.ode.integrate.sm (11 КиБ) скачан 94 раз(а).
alglib.ode.kinetic1.sm (7 КиБ) скачан 141 раз(а).
alglib.ode.kinetic2.sm (10 КиБ) скачан 120 раз(а).
alglib.ode.kinetic3.sm (10 КиБ) скачан 126 раз(а).
alglib.ode.test1.sm (10 КиБ) скачан 137 раз(а).
alglib.ode.test2.sm (10 КиБ) скачан 119 раз(а).
alglib.ode.Amplitude detector.sm (19 КиБ) скачан 123 раз(а).

alglib.ode.integrate.pdf (92 КиБ) скачан 100 раз(а).
alglib.ode.kinetic1.pdf (75 КиБ) скачан 123 раз(а).
alglib.ode.kinetic2.pdf (89 КиБ) скачан 110 раз(а).
alglib.ode.kinetic3.pdf (83 КиБ) скачан 111 раз(а).
alglib.ode.test1.pdf (85 КиБ) скачан 108 раз(а).
alglib.ode.test2.pdf (89 КиБ) скачан 107 раз(а).
alglib.ode.Amplitude detector.pdf (147 КиБ) скачан 114 раз(а).

Fourier series coefficients.sm (28 КиБ) скачан 166 раз(а).
Fourier series coefficients.pdf (170 КиБ) скачан 140 раз(а).

Links:

1. ALGLIB
Russia ☭ forever, Viacheslav N. Mezentsev
3 пользователям понравился этот пост
Radovan Omorjan 27.04.2013 07:03:00, Davide Carpi 27.04.2013 06:37:00, ioan92 08.05.2013 14:08:00
#3 Опубликовано: 27.04.2013 19:57:43
Вячеслав Мезенцев

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

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

Группа: Moderator

Wrote

It seems that the convolution function from the alglib plugin does not care for the second and fourth arguments (problem size in alglib ). I guess that the problem size is nothing else than the size of the 1st and 3rd arguments, thus they are obsolete.

If that is correct than I suggest to provide a convr1d(2) function.


I think it's best to follow the description in the source code (see doc.pdf). I corrected the behavior of the function and added an inverse function convr1dinv().
Russia ☭ forever, Viacheslav N. Mezentsev
#4 Опубликовано: 28.04.2013 02:34:59
Martin Kraska

Martin Kraska

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

Группа: Moderator

Wrote


I think it's best to follow the description in the source code (see doc.pdf). I corrected the behavior of the function and added an inverse function convr1dinv().



Uni, thanks for the update. Now the function convr1d seems to insist on providing the correct vector sizes as arguments. This is not really an improvement unless values differing from the actual length can be provided for some magic purpose. I did not find any such hint in the doc. Thus, in order to keep the argument list lean, I would recommend to have
[MATH]convr1d(f;g)[/MATH] and let the interface determine the sizes as in the previous version.

However, I do not want to distract you from progress in the xyplot-plugin!

Martin

Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#5 Опубликовано: 28.04.2013 06:24:22
Вячеслав Мезенцев

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

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

Группа: Moderator

Wrote

Wrote


I think it's best to follow the description in the source code (see doc.pdf). I corrected the behavior of the function and added an inverse function convr1dinv().


Thus, in order to keep the argument list lean, I would recommend to have
[MATH]convr1d(f;g)[/MATH] and let the interface determine the sizes as in the previous version.


Ok, I'll add this too. It seems to me that I need to follow the documentation to describe the interfaces of functions.
Russia ☭ forever, Viacheslav N. Mezentsev
#6 Опубликовано: 28.04.2013 07:52:45
Martin Kraska

Martin Kraska

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

Группа: Moderator

Wrote

Wrote


Thus, in order to keep the argument list lean, I would recommend to have
[MATH]convr1d(f;g)[/MATH] and let the interface determine the sizes as in the previous version.


Ok, I'll add this too. It seems to me that I need to follow the documentation to describe the interfaces of functions.



Thanks for considering the change. This would perhaps apply to the other integral transforms as well. When providing sort of convr1d(2), then you could add a hint to the doc string that the size parameters in alglib are determined from the actual size).

The alglib version of the Beta function seems o return values if one argument is negative despite of the docs limiting the range to posive arguments. Also, in contrast to the implementation in the StatisticalTools Plugin, the function cannot handle complex numbers.

I added the plugin to the inofficial SMath distribution.

After a look at the alglib license I feel safe to do so. The available functions are (at least a little) documented in the Handbook based on alglib docs and examples by uni.
Beta2.png
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#7 Опубликовано: 06.05.2013 06:55:55
Вячеслав Мезенцев

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

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

Группа: Moderator

Updated. al_convr1d(2), al_convr1dinv(2) added.

[albumimg]116[/albumimg]
Russia ☭ forever, Viacheslav N. Mezentsev
2 пользователям понравился этот пост
Davide Carpi 06.05.2013 07:46:00, Martin Kraska 06.05.2013 10:20:00
#8 Опубликовано: 06.05.2013 10:42:24
Martin Kraska

Martin Kraska

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

Группа: Moderator

Wrote

Updated. al_convr1d(2), al_convr1dinv(2) added.



Thanks for implementing the proposal.

On my system, Example 2.sm fails to run correctly. If I replace the al_convr1dinv(4) by al_convr1dinv(2) then it is ok. My handbook examples show the same effect, on top of that, in conv.sm, there is an xy-plot-region throwiing an critical error. It does not recover, even if I fix the convolution problem with the new (2)-call. conv1.sm is the fixed version.
conv1.sm (11 КиБ) скачан 109 раз(а).
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#9 Опубликовано: 08.05.2013 12:57:13
Вячеслав Мезенцев

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

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

Группа: Moderator

Updated. al_nleqsolve() function added (Levenberg-Marquardt-like nonlinear solver).

This algorithm solves system of nonlinear equations F(x).

Parameters:

X0 - starting point.
StepMax - maximum step length, >=0. Set StpMax to 0.0,  if you don't want to limit step length.
Eps - >=0. The subroutine finishes  its work if on k+1-th iteration the condition ||F||<=EpsF is satisfied.


[albumimg]121[/albumimg] [albumimg]123[/albumimg]
Russia ☭ forever, Viacheslav N. Mezentsev
1 пользователям понравился этот пост
Radovan Omorjan 08.05.2013 14:18:00
#10 Опубликовано: 08.05.2013 14:22:45
Radovan Omorjan

Radovan Omorjan

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

Группа: Moderator

Thank you uni for this one

I could see that al_nleqsolve() will not work with

[MATH=eng]f(v):eval(F(el(v,1),el(v,2),el(v,3)))[/MATH]

[MATH=eng]j(v):eval(Jac(el(v,1),el(v,2),el(v,3)))[/MATH]

Is there any way to make this possible?

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

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

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

Группа: Moderator

I think it is not necessary, since the function within itself already performs this. I need more examples. Try this solver at work.
Russia ☭ forever, Viacheslav N. Mezentsev
#12 Опубликовано: 08.05.2013 16:17:40
Radovan Omorjan

Radovan Omorjan

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

Группа: Moderator

Wrote

I think it is not necessary, since the function within itself already performs this. I need more examples. Try this solver at work.


I just have some frustrating experience when the Jacobian is involved, and would rather appreciated some "derivative free" algorithms of this kind.

Here is just a playing with the NonlinearSolver plugin which includes Levenberg-Marquard algorithm and this one in AlgLib. For this particular example all performed quite well.

[albumimg]122[/albumimg]

Regards,
Radovan

When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
1 пользователям понравился этот пост
#13 Опубликовано: 08.05.2013 16:38:49
Вячеслав Мезенцев

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

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

Группа: Moderator

Wrote

Wrote

I think it is not necessary, since the function within itself already performs this. I need more examples. Try this solver at work.


I just have some frustrating experience when the Jacobian is involved, and would rather appreciated some "derivative free" algorithms of this kind.

Here is just a playing with the NonlinearSolver plugin which includes Levenberg-Marquard algorithm and this one in AlgLib. For this particular example all performed quite well.

[albumimg]122[/albumimg]

Regards,
Radovan



Thank you, Radovan. Unfortunately, this interface is defined by the function.

[albumimg]123[/albumimg]
Russia ☭ forever, Viacheslav N. Mezentsev
#14 Опубликовано: 11.07.2013 19:04:23
Вячеслав Мезенцев

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

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

Группа: Moderator

Updated. al_rkckadapt() function added (Runge-Kutta-Cash-Karp adaptive ODE solver).

You can compare with the examples from here: Using the AlgLib ODE (Runge-Kutta) Solver with Excel.

[albumimg]228[/albumimg] [albumimg]230[/albumimg] [albumimg]231[/albumimg] [albumimg]229[/albumimg]
Russia ☭ forever, Viacheslav N. Mezentsev
1 пользователям понравился этот пост
Radovan Omorjan 12.07.2013 10:08:00
#15 Опубликовано: 19.07.2013 15:07:01
Вячеслав Мезенцев

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

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

Группа: Moderator

Updated. Source code refactoring.
Russia ☭ forever, Viacheslav N. Mezentsev
1 пользователям понравился этот пост
sergio 17.06.2018 16:02:00
#16 Опубликовано: 17.06.2018 07:10:00
Вячеслав Мезенцев

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

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

Группа: Moderator

Updated to AlgLib 3.14, refactored.

2018-06-17_15-09-26.png

al_nleqsolve.sm (15 КиБ) скачан 113 раз(а).
al_nleqsolve.pdf (41 КиБ) скачан 103 раз(а).
Russia ☭ forever, Viacheslav N. Mezentsev
1 пользователям понравился этот пост
Andrey Ivashov 17.06.2018 14:15:00
#17 Опубликовано: 18.06.2018 00:58:25
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

Updated to AlgLib 3.14, refactored



Thanks UNI, works fine 6179.

Jean
#18 Опубликовано: 08.07.2018 14:07:58
Igor Skarine

Igor Skarine

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

Группа: User

al_nlsolve.png
Some problem in the latest plugin. Another solver f_nrk(...) works fine.
x is formal parameter, how I can define it ? Optimization is numerical, the same for both solvers.
#19 Опубликовано: 09.07.2018 04:33:54
Вячеслав Мезенцев

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

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

Группа: Moderator

I need a complete example.
Russia ☭ forever, Viacheslav N. Mezentsev
#20 Опубликовано: 09.07.2018 10:54:22
Igor Skarine

Igor Skarine

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

Группа: User

Hello uni,
Unfortunately I can't provide complete example, but if I pass to solver copy-pasted copies of the equations, it works.
See it below. The problem is that plugin can't read correct result of symbolic calculations, but solver written in Smath does it right.

example.sm (48 КиБ) скачан 105 раз(а).
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений