Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

3 Pages123>
Options
Go to last post Go to first unread
Offline mkraska  
#1 Posted : 27 April 2013 01:52:04(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,637
Germany

Was thanked: 912 time(s) in 574 post(s)
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.

Edited by moderator 18 June 2018 15:10:29(UTC)  | Reason: Not specified

File Attachment(s):
conv.sm (7kb) downloaded 93 time(s).
mkraska attached the following image(s):
conv.png
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://en.smath.info/wi...th%20with%20Plugins.ashx
Offline uni  
#2 Posted : 27 April 2013 13:18:16(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,080
Man
Russian Federation

Was thanked: 964 time(s) in 549 post(s)
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().





Examples:

alglib.ode.integrate.sm (12kb) downloaded 22 time(s).
alglib.ode.kinetic1.sm (8kb) downloaded 49 time(s).
alglib.ode.kinetic2.sm (11kb) downloaded 41 time(s).
alglib.ode.kinetic3.sm (11kb) downloaded 47 time(s).
alglib.ode.test1.sm (11kb) downloaded 46 time(s).
alglib.ode.test2.sm (11kb) downloaded 41 time(s).
alglib.ode.Amplitude detector.sm (20kb) downloaded 47 time(s).

alglib.ode.integrate.pdf (93kb) downloaded 24 time(s).
alglib.ode.kinetic1.pdf (76kb) downloaded 35 time(s).
alglib.ode.kinetic2.pdf (90kb) downloaded 28 time(s).
alglib.ode.kinetic3.pdf (84kb) downloaded 34 time(s).
alglib.ode.test1.pdf (86kb) downloaded 33 time(s).
alglib.ode.test2.pdf (90kb) downloaded 30 time(s).
alglib.ode.Amplitude detector.pdf (148kb) downloaded 30 time(s).

Fourier series coefficients.sm (29kb) downloaded 66 time(s).
Fourier series coefficients.pdf (171kb) downloaded 47 time(s).

Links:

1. ALGLIB

Edited by user 27 October 2020 08:24:04(UTC)  | Reason: Not specified

Russia ☭ forever
Viacheslav N. Mezentsev
💰 Support me for plugins development: https://money.yandex.ru/to/410013245578758/100
thanks 3 users thanked uni for this useful post.
on 27/04/2013(UTC),  on 27/04/2013(UTC),  on 08/05/2013(UTC)
Offline uni  
#3 Posted : 28 April 2013 02:57:43(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,080
Man
Russian Federation

Was thanked: 964 time(s) in 549 post(s)
Originally Posted by: mkraska Go to Quoted Post
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
💰 Support me for plugins development: https://money.yandex.ru/to/410013245578758/100
Offline mkraska  
#4 Posted : 28 April 2013 09:34:59(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,637
Germany

Was thanked: 912 time(s) in 574 post(s)
Originally Posted by: uni Go to Quoted Post

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
convr1d(f;g) 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/wi...th%20with%20Plugins.ashx
Offline uni  
#5 Posted : 28 April 2013 13:24:22(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,080
Man
Russian Federation

Was thanked: 964 time(s) in 549 post(s)
Originally Posted by: mkraska Go to Quoted Post
Originally Posted by: uni Go to Quoted Post

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
convr1d(f;g) 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
💰 Support me for plugins development: https://money.yandex.ru/to/410013245578758/100
Offline mkraska  
#6 Posted : 28 April 2013 14:52:45(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,637
Germany

Was thanked: 912 time(s) in 574 post(s)
Originally Posted by: uni Go to Quoted Post
Originally Posted by: mkraska Go to Quoted Post

Thus, in order to keep the argument list lean, I would recommend to have
convr1d(f;g) 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.

Edited by user 28 April 2013 14:57:51(UTC)  | Reason: Not specified

mkraska attached the following image(s):
al_beta.png
Beta2.png
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://en.smath.info/wi...th%20with%20Plugins.ashx
Offline uni  
#7 Posted : 06 May 2013 13:55:55(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,080
Man
Russian Federation

Was thanked: 964 time(s) in 549 post(s)
Updated. al_convr1d(2), al_convr1dinv(2) added.

Russia ☭ forever
Viacheslav N. Mezentsev
💰 Support me for plugins development: https://money.yandex.ru/to/410013245578758/100
thanks 2 users thanked uni for this useful post.
on 06/05/2013(UTC),  on 06/05/2013(UTC)
Offline mkraska  
#8 Posted : 06 May 2013 17:42:24(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,637
Germany

Was thanked: 912 time(s) in 574 post(s)
Originally Posted by: uni Go to Quoted Post
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.

Edited by user 06 May 2013 19:03:55(UTC)  | Reason: Not specified

File Attachment(s):
conv.sm (13kb) downloaded 54 time(s).
conv1.sm (12kb) downloaded 52 time(s).
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://en.smath.info/wi...th%20with%20Plugins.ashx
Offline uni  
#9 Posted : 08 May 2013 19:57:13(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,080
Man
Russian Federation

Was thanked: 964 time(s) in 549 post(s)
Updated. al_nleqsolve() function added (Levenberg-Marquardt-like nonlinear solver).

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

Parameters:
Code:

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.



Edited by user 08 May 2013 23:15:10(UTC)  | Reason: Not specified

Russia ☭ forever
Viacheslav N. Mezentsev
💰 Support me for plugins development: https://money.yandex.ru/to/410013245578758/100
thanks 1 user thanked uni for this useful post.
on 08/05/2013(UTC)
Offline omorr  
#10 Posted : 08 May 2013 21:22:45(UTC)
omorr


Rank: Administration

Groups: Registered, Administrators, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,734
Man
Serbia

Was thanked: 313 time(s) in 267 post(s)
Thank you uni for this one Good

I could see that al_nleqsolve() will not work with

f(v):eval(F(el(v,1),el(v,2),el(v,3)))

j(v):eval(Jac(el(v,1),el(v,2),el(v,3)))

Is there any way to make this possible?

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline uni  
#11 Posted : 08 May 2013 21:37:08(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,080
Man
Russian Federation

Was thanked: 964 time(s) in 549 post(s)
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
💰 Support me for plugins development: https://money.yandex.ru/to/410013245578758/100
Offline omorr  
#12 Posted : 08 May 2013 23:17:40(UTC)
omorr


Rank: Administration

Groups: Registered, Administrators, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,734
Man
Serbia

Was thanked: 313 time(s) in 267 post(s)
Originally Posted by: uni Go to Quoted Post
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.



Regards,
Radovan

When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
thanks 1 user thanked omorr for this useful post.
on 08/05/2013(UTC)
Offline uni  
#13 Posted : 08 May 2013 23:38:49(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,080
Man
Russian Federation

Was thanked: 964 time(s) in 549 post(s)
Originally Posted by: omorr Go to Quoted Post
Originally Posted by: uni Go to Quoted Post
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.



Regards,
Radovan



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

Russia ☭ forever
Viacheslav N. Mezentsev
💰 Support me for plugins development: https://money.yandex.ru/to/410013245578758/100
Offline uni  
#14 Posted : 12 July 2013 02:04:23(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,080
Man
Russian Federation

Was thanked: 964 time(s) in 549 post(s)
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.

Edited by user 12 July 2013 02:51:38(UTC)  | Reason: Not specified

Russia ☭ forever
Viacheslav N. Mezentsev
💰 Support me for plugins development: https://money.yandex.ru/to/410013245578758/100
thanks 1 user thanked uni for this useful post.
on 12/07/2013(UTC)
Offline uni  
#15 Posted : 19 July 2013 22:07:01(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,080
Man
Russian Federation

Was thanked: 964 time(s) in 549 post(s)
Updated. Source code refactoring.
Russia ☭ forever
Viacheslav N. Mezentsev
💰 Support me for plugins development: https://money.yandex.ru/to/410013245578758/100
thanks 1 user thanked uni for this useful post.
on 17/06/2018(UTC)
Offline uni  
#16 Posted : 17 June 2018 13:10:00(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,080
Man
Russian Federation

Was thanked: 964 time(s) in 549 post(s)
Updated to AlgLib 3.14, refactored.

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

al_nleqsolve.sm (16kb) downloaded 52 time(s).
al_nleqsolve.pdf (42kb) downloaded 44 time(s).

Edited by user 17 June 2018 13:11:58(UTC)  | Reason: Not specified

Russia ☭ forever
Viacheslav N. Mezentsev
💰 Support me for plugins development: https://money.yandex.ru/to/410013245578758/100
thanks 1 user thanked uni for this useful post.
on 17/06/2018(UTC)
Offline Jean Giraud  
#17 Posted : 18 June 2018 06:58:25(UTC)
Jean Giraud


Rank: Advanced Member

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 4,872
Canada

Was thanked: 801 time(s) in 635 post(s)
Originally Posted by: uni Go to Quoted Post
Updated to AlgLib 3.14, refactored


Thanks UNI, works fine 6179.

Jean
Offline tomtit  
#18 Posted : 08 July 2018 20:07:58(UTC)
tomtit


Rank: Advanced Member

Groups: Registered
Joined: 22/02/2014(UTC)
Posts: 74

Was thanked: 9 time(s) in 8 post(s)
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.

Edited by user 09 July 2018 00:40:01(UTC)  | Reason: Not specified

Offline uni  
#19 Posted : 09 July 2018 10:33:54(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,080
Man
Russian Federation

Was thanked: 964 time(s) in 549 post(s)
I need a complete example.
Russia ☭ forever
Viacheslav N. Mezentsev
💰 Support me for plugins development: https://money.yandex.ru/to/410013245578758/100
Offline tomtit  
#20 Posted : 09 July 2018 16:54:22(UTC)
tomtit


Rank: Advanced Member

Groups: Registered
Joined: 22/02/2014(UTC)
Posts: 74

Was thanked: 9 time(s) in 8 post(s)
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 (49kb) downloaded 42 time(s).
Users browsing this topic
3 Pages123>
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.