Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline mikekaganski  
#1 Posted : 30 March 2016 02:54:04(UTC)
mikekaganski


Rank: Advanced Member

Groups: Registered
Joined: 17/01/2013(UTC)
Posts: 296
Man
Russian Federation
Location: Khabarovsk, Russia

Was thanked: 151 time(s) in 107 post(s)
scr5.png

(Last line with error is just to demonstrate that without vectorize(), the error is the same as with vectorize(), so seems that vectorize() has no effect)

I suspect that the problem is because the Bessel function is defined in a IPluginLowLevelEvaluation plugin (StatisticalTools by Davide). This interface is afaik the most used among SMath plugin writers, so it would be desirable to extend vectorize() to work correctly with that kind of plugins.

Please excuse me if my reasoning is incorrect, and the real cause is something other.

Edited by moderator 23 April 2016 12:10:41(UTC)  | Reason: marked as solved

Best regards,
Mike Kaganski
thanks 1 user thanked mikekaganski for this useful post.
on 31/03/2016(UTC)

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline Jean Giraud  
#2 Posted : 30 March 2016 06:45:29(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Hello Boris,

If that's not your first name, then tell us to shoot Vodka !
"Bessel" but which Bessel ?
In Smath 5346, there are quite a few built-in "Bessel" from menu f(x).
I understand what you are attempting, give me a day or two.
For what I can see, vectorising is not the best approach.

Jean

Bessel mwbesselj.sm (9kb) downloaded 19 time(s).
Offline mikekaganski  
#3 Posted : 30 March 2016 07:00:02(UTC)
mikekaganski


Rank: Advanced Member

Groups: Registered
Joined: 17/01/2013(UTC)
Posts: 296
Man
Russian Federation
Location: Khabarovsk, Russia

Was thanked: 151 time(s) in 107 post(s)
OH MY! Not again!

Originally Posted by: Jean Giraud Go to Quoted Post
Hello Boris,

If that's not your first name, then tell us to shoot Vodka !
"Bessel" but which Bessel ?
In Smath 5346, there are quite a few built-in "Bessel" from menu f(x).


Originally Posted by: mikekaganski Go to Quoted Post
I suspect that the problem is because the Bessel function is defined in a IPluginLowLevelEvaluation plugin (StatisticalTools by Davide).


Quote:

I understand what you are attempting, give me a day or two.
For what I can see, vectorising is not the best approach.


I only used any first custom function from my function list, just to demonstrate the problem. I could use e.g. CoolProp wrapper, or anything else.
Best regards,
Mike Kaganski
Offline Jean Giraud  
#4 Posted : 30 March 2016 07:21:22(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Mike,

Trust me: vectorising is not a substitute to the right ways of doing.
I have only two legs and 10 fingers ... at night my brain dilutes.

Jean
Offline Andrey Ivashov  
#5 Posted : 30 March 2016 18:31:46(UTC)
Andrey Ivashov


Rank: Administration

Groups: Developers, Registered, Knovel Developers, Administrators, Advanced Member
Joined: 11/07/2008(UTC)
Posts: 1,616
Man
Russian Federation

Was thanked: 1978 time(s) in 666 post(s)
Hello.

Originally Posted by: mikekaganski Go to Quoted Post
I suspect that the problem is because the Bessel function is defined in a IPluginLowLevelEvaluation plugin (StatisticalTools by Davide). This interface is afaik the most used among SMath plugin writers, so it would be desirable to extend vectorize() to work correctly with that kind of plugins.

Everything you said is correct. I've just improved vectorize function to support functions from plug-ins.

vectorize_improved_1.png

Thank you!

Best regards.
thanks 1 user thanked Andrey Ivashov for this useful post.
on 31/03/2016(UTC)
Offline Jean Giraud  
#6 Posted : 30 March 2016 20:55:42(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: Andrey Ivashov Go to Quoted Post

Everything you said is correct.
I've just improved vectorize function to support functions from plug-ins.


Which Bessel ? There are 34 "Bessel functions"
Your Bessel is typically a vector of 5*5 = 25 elements.
Still something not correct.

Jean

Offline Alex M.  
#7 Posted : 02 April 2016 20:22:43(UTC)
Alex M.


Rank: Advanced Member

Groups: Registered
Joined: 03/03/2014(UTC)
Posts: 418
Canada

Was thanked: 125 time(s) in 96 post(s)
Hi all, did not want to open a new vectorize() topic so posting my question here. From what I know about vectorize is that in order for it to evaluate you need to satisfy the following:

1. Arguments must be two matrices with matching dimensions
2. Operator must be applicable to scalar variables

If the above is correct, I might have detected an odd behaviour.

And as a side note: Andrey, please do not get discouraged by all the recent controversy surrounding vectorize(). It is a very useful function. My only suggestion would be to make sure that it consistently follows a simple list of logical rules, and to make this list available in the SMath release notes / documentation.

http://smath.info/cloud/sheet/xVqGb4rhZq

vectorize1.sm (10kb) downloaded 20 time(s).
vectorize1.png
Offline Jean Giraud  
#8 Posted : 02 April 2016 23:06:38(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
You didn't test completely ... Ah !

Forum Vectorise Correct.gif
Offline mikekaganski  
#9 Posted : 03 April 2016 00:23:19(UTC)
mikekaganski


Rank: Advanced Member

Groups: Registered
Joined: 17/01/2013(UTC)
Posts: 296
Man
Russian Federation
Location: Khabarovsk, Russia

Was thanked: 151 time(s) in 107 post(s)
Well, then I will add here, too Good

scr29.png

This minimal example is completely made up for demonstration only. No meaning in it other than to demonstrate a problem.

Here three pieces are relevant: if(), assignment of y, and eval(). Without any of these, it works.

Edited by user 12 April 2016 11:19:18(UTC)  | Reason: Not specified

Best regards,
Mike Kaganski
Users browsing this topic
Guest
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.