AlgLib 3.1x

AlgLib 3.1x - AlgLib Plugin (based on ALGLIB 3.1x) - Poruke

#1 Objavljeno: 26. 4. 2013. 18:52:04
Martin Kraska

Martin Kraska

1.369 svidjanja u 2.283 postova.

Grupa: 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,15 KiB) preuzeto 1762 put(ova).
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
#2 Objavljeno: 27. 4. 2013. 06:18:16
Вячеслав Мезенцев

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

1.558 svidjanja u 1.868 postova.

Grupa: 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().


AlgLib_screen0.png AlgLib_screen1.png AlgLib_screen3.png 2018-12-20_16-48-12.png 2019-01-27_18-56-56.png
2018-12-24_15-42-32.png 2018-12-20_20-29-42.png 2018-12-24_15-43-00.png 2018-12-24_15-43-31.png 2018-12-24_15-43-56.png

Examples:

alglib.ode.integrate.sm (11,76 KiB) preuzeto 1666 put(ova).
alglib.ode.kinetic1.sm (7,78 KiB) preuzeto 1856 put(ova).
alglib.ode.kinetic2.sm (10,35 KiB) preuzeto 1949 put(ova).
alglib.ode.kinetic3.sm (10,04 KiB) preuzeto 1957 put(ova).
alglib.ode.test1.sm (10,46 KiB) preuzeto 1929 put(ova).
alglib.ode.test2.sm (10,63 KiB) preuzeto 1916 put(ova).
alglib.ode.Amplitude detector.sm (19,77 KiB) preuzeto 1946 put(ova).

alglib.ode.integrate.pdf (92,37 KiB) preuzeto 967 put(ova).
alglib.ode.kinetic1.pdf (75,29 KiB) preuzeto 1116 put(ova).
alglib.ode.kinetic2.pdf (89,97 KiB) preuzeto 1063 put(ova).
alglib.ode.kinetic3.pdf (83,16 KiB) preuzeto 1056 put(ova).
alglib.ode.test1.pdf (85,24 KiB) preuzeto 1051 put(ova).
alglib.ode.test2.pdf (89,96 KiB) preuzeto 1071 put(ova).
alglib.ode.Amplitude detector.pdf (147,84 KiB) preuzeto 1106 put(ova).

Fourier series coefficients.sm (28,46 KiB) preuzeto 1956 put(ova).
Fourier series coefficients.pdf (170,26 KiB) preuzeto 1272 put(ova).

Links:

1. ALGLIB
Russia ☭ forever, Viacheslav N. Mezentsev
3 korisnika je svidelo ovu objavu
Radovan Omorjan 27. 4. 2013. 07:03:00, Davide Carpi 27. 4. 2013. 06:37:00, ioan92 8. 5. 2013. 14:08:00
#3 Objavljeno: 27. 4. 2013. 19:57:43
Вячеслав Мезенцев

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

1.558 svidjanja u 1.868 postova.

Grupa: 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 Objavljeno: 28. 4. 2013. 02:34:59
Martin Kraska

Martin Kraska

1.369 svidjanja u 2.283 postova.

Grupa: 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

Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
#5 Objavljeno: 28. 4. 2013. 06:24:22
Вячеслав Мезенцев

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

1.558 svidjanja u 1.868 postova.

Grupa: 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 Objavljeno: 28. 4. 2013. 07:52:45
Martin Kraska

Martin Kraska

1.369 svidjanja u 2.283 postova.

Grupa: 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
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
#7 Objavljeno: 6. 5. 2013. 06:55:55
Вячеслав Мезенцев

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

1.558 svidjanja u 1.868 postova.

Grupa: Moderator

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

AlgLib_screen2.png
Russia ☭ forever, Viacheslav N. Mezentsev
2 korisnika je svidelo ovu objavu
Davide Carpi 6. 5. 2013. 07:46:00, Martin Kraska 6. 5. 2013. 10:20:00
#8 Objavljeno: 6. 5. 2013. 10:42:24
Martin Kraska

Martin Kraska

1.369 svidjanja u 2.283 postova.

Grupa: 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,32 KiB) preuzeto 1738 put(ova).
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
#9 Objavljeno: 8. 5. 2013. 12:57:13
Вячеслав Мезенцев

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

1.558 svidjanja u 1.868 postova.

Grupa: 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.


AlgLib_screen3.png AlgLib_screen4.png
Russia ☭ forever, Viacheslav N. Mezentsev
1 korisnika je svidelo ovu objavu
Radovan Omorjan 8. 5. 2013. 14:18:00
#10 Objavljeno: 8. 5. 2013. 14:22:45
Radovan Omorjan

Radovan Omorjan

325 svidjanja i 1 nesvidjanja u 2.052 postova.

Grupa: 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 Objavljeno: 8. 5. 2013. 14:37:08
Вячеслав Мезенцев

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

1.558 svidjanja u 1.868 postova.

Grupa: 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 Objavljeno: 8. 5. 2013. 16:17:40
Radovan Omorjan

Radovan Omorjan

325 svidjanja i 1 nesvidjanja u 2.052 postova.

Grupa: 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.

LevenbergMarquardt_testing- w3b5urf3r_reloaded-uni.png

Regards,
Radovan

When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
1 korisnika je svidelo ovu objavu
#13 Objavljeno: 8. 5. 2013. 16:38:49
Вячеслав Мезенцев

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

1.558 svidjanja u 1.868 postova.

Grupa: 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.

LevenbergMarquardt_testing- w3b5urf3r_reloaded-uni.png

Regards,
Radovan



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

AlgLib_screen4.png
Russia ☭ forever, Viacheslav N. Mezentsev
#14 Objavljeno: 11. 7. 2013. 19:04:23
Вячеслав Мезенцев

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

1.558 svidjanja u 1.868 postova.

Grupa: 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.

AlgLib_screen5.png AlgLib_screen7.png AlgLib_screen8.png AlgLib_screen6.png
Russia ☭ forever, Viacheslav N. Mezentsev
1 korisnika je svidelo ovu objavu
Radovan Omorjan 12. 7. 2013. 10:08:00
#15 Objavljeno: 19. 7. 2013. 15:07:01
Вячеслав Мезенцев

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

1.558 svidjanja u 1.868 postova.

Grupa: Moderator

Updated. Source code refactoring.
Russia ☭ forever, Viacheslav N. Mezentsev
1 korisnika je svidelo ovu objavu
sergio 17. 6. 2018. 16:02:00
#16 Objavljeno: 17. 6. 2018. 07:10:00
Вячеслав Мезенцев

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

1.558 svidjanja u 1.868 postova.

Grupa: Moderator

Updated to AlgLib 3.14, refactored.

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

al_nleqsolve.sm (15,02 KiB) preuzeto 1642 put(ova).
al_nleqsolve.pdf (41,21 KiB) preuzeto 971 put(ova).
Russia ☭ forever, Viacheslav N. Mezentsev
1 korisnika je svidelo ovu objavu
Andrey Ivashov 17. 6. 2018. 14:15:00
#17 Objavljeno: 18. 6. 2018. 00:58:25
Jean Giraud

Jean Giraud

983 svidjanja u 6.866 postova.

Grupa: User

Wrote

Updated to AlgLib 3.14, refactored



Thanks UNI, works fine 6179.

Jean
#18 Objavljeno: 8. 7. 2018. 14:07:58
Igor Skarine

Igor Skarine

14 svidjanja u 97 postova.

Grupa: 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 Objavljeno: 9. 7. 2018. 04:33:54
Вячеслав Мезенцев

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

1.558 svidjanja u 1.868 postova.

Grupa: Moderator

I need a complete example.
Russia ☭ forever, Viacheslav N. Mezentsev
#20 Objavljeno: 9. 7. 2018. 10:54:22
Igor Skarine

Igor Skarine

14 svidjanja u 97 postova.

Grupa: 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,62 KiB) preuzeto 1681 put(ova).
  • Novi postovi
  • Nema novih postova