1 Pages (6 items)
failing evaluation under vectorize() - Messages
#1 Posted: 11/22/2023 1:22:45 AM
Why does the vectorize operation fail while it seems to be safe to use an explicit loop?
6-2-Bug.sm (27 KiB) downloaded 68 time(s).
![2023-11-21 18_18_50-SMath Solver - [6-2-Bug.sm_].png](/en-US/file/nuebhM/2023-11-21-18_18_50-SMath-Solver---_6-2-Bug_sm___png)
6-2-Bug.sm (27 KiB) downloaded 68 time(s).
Martin Kraska
Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#3 Posted: 11/22/2023 4:35:34 AM
Is that just by observation or is there a fundamental obstacle?
Martin Kraska
Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#4 Posted: 11/22/2023 6:57:58 AM
WroteIs that just by observation or is there a fundamental obstacle?
Hi. I guess that it is fundamental.
Some notes about how other CAS handle this issue.
Pretty old matlab version, from its symbolic toolbox
The help page from the newest version
So, it looks like they have some issues with automatic vectorization.
With maple it is very uncomfortable, you need to use map even for simple cases
Wolfram's solution is very practical: Function with attribute 'Listable' expands over lists
But for make a table you actually need a loop or the Mathematica's Map function.
Best regards.
Alvaro.
2 users liked this post
#5 Posted: 11/25/2023 8:15:21 PM
WroteWhy does the vectorize operation fail while it seems to be safe to use an explicit loop ?
Set the demand in local definition mode ...
new(t):=|a(t)
vectorize and equate
6-2-Bug Doctored.sm (29 KiB) downloaded 51 time(s).
1 users liked this post
Martin Kraska 11/25/2023 11:04:00 PM
#6 Posted: 11/25/2023 11:17:47 PM
Thanks Alvaro and Jean. Here is a reduced working example.
When a scalar function involves scalar products then it must be defined in a line()-block in order to be vectorize()able.

Worksheet13.sm (5 KiB) downloaded 53 time(s).
When a scalar function involves scalar products then it must be defined in a line()-block in order to be vectorize()able.
Worksheet13.sm (5 KiB) downloaded 53 time(s).
Martin Kraska
Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 users liked this post
Oscar Campo 11/26/2023 6:21:00 PM
1 Pages (6 items)
-
New Posts
-
No New Posts