Rank: Newbie
Groups: Registered
Joined: 04/03/2016(UTC) Posts: 3 Location: Berlin
|
Hello Andrey! recently i found out about an issue with the Viewer, might it be possible to fix the update proces while using plugins like the comboboxList? Please see the example pictures and you see the posibilities of the second list don't change with the selection made in the first one, wich is non of a problem using the file with SMath Studio... only with the Viewer it fails. Thanks a lot for concerning! I'd appreciate your help very much! example.zip (429kb) downloaded 37 time(s).
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 983 time(s) in 811 post(s)
|
Sergio, Your example that works elements wise, check for other issue: vectorise as you did ... SQRT( ... result at the bottom of the attached work sheet in light red. Jean Utilities Matrix Vectorise EXPRESS.sm (57kb) downloaded 56 time(s).... read more as well.
|
1 user thanked Jean Giraud for this useful post.
|
|
|
Rank: Administration Groups: Registered, Advanced Member Joined: 23/06/2009(UTC) Posts: 1,740 Was thanked: 318 time(s) in 268 post(s)
|
What do you think Andrey to put then invert() function as well in the exception? Function transpose() will get into the operator but invert() will not. Therefore, there is quite a difference between rising a matrix to a negative power inside vectorize() and having invert() inside vectorize(). For example, we have abs() and det() but inside vectorize() there is visually no difference. I also hope this will not open some other issues regarding the vectorize() function. Regards, Rdovabn Edited by user 09 March 2016 09:18:21(UTC)
| Reason: Not specified |
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!" |
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 983 time(s) in 811 post(s)
|
Originally Posted by: omorr I also hope this will not open some other issues regarding the vectorize() function. Quite right Radovan, That will require a "task force" checking wrt Mathcad. The collection of vectorise is huge ! and would be partial wrt functions not implemented in Smath. In the mean time, the options in the previously attached work sheets are VISIBLE. The risk of conflict between "conventions" and "inventions" is silent/present. Remember the Smath missing col operator <,> ... +++ Jean
|
1 user thanked Jean Giraud for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 01/08/2010(UTC) Posts: 115 Location: Rome Was thanked: 13 time(s) in 13 post(s)
|
Jean, thanks a lot for sharing ...your approach with the algo technique of passing a function ..to a function is very interesting . It is something I had never thought that was possible to do, it is very elegant and concise.
Thanks again and best regards
Franco
|
|
|
|
Rank: Administration Groups: Registered, Advanced Member Joined: 23/06/2009(UTC) Posts: 1,740 Was thanked: 318 time(s) in 268 post(s)
|
Originally Posted by: Jean Giraud Originally Posted by: omorr I also hope this will not open some other issues regarding the vectorize() function. Quite right Radovan, That will require a "task force" checking wrt Mathcad. The collection of vectorise is huge ! and would be partial wrt functions not implemented in Smath. In the mean time, the options in the previously attached work sheets are VISIBLE. The risk of conflict between "conventions" and "inventions" is silent/present. Remember the Smath missing col operator <,> ... +++ Jean Thank you Jean, You are right. Although very useful vectorization() might be sometimes quite a headache if used carelessly. As you pointed out, that means from the users and developers point of view. I suppose that Andrey therefore avoided using it for such a long time. It might have been like opening Pandora's box. Regards, Radovan Edited by user 09 March 2016 11:14:32(UTC)
| Reason: Not specified |
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!" |
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 23/12/2011(UTC) Posts: 321 Location: italy Was thanked: 110 time(s) in 94 post(s)
|
thanks Andrey, Your explanation convinced me. And now I think it is not appropriate to satisfy the misuse that I had indicated: only a shortcut. Reading the posts received later we understand that the introduction of function vectorize() has created a bit of movement And this is very interesting.
sergio
|
2 users thanked PompelmoTell for this useful post.
|
on 09/03/2016(UTC), on 09/03/2016(UTC)
|
|
Rank: Advanced Member Groups: Registered
Joined: 03/03/2014(UTC) Posts: 418 Was thanked: 125 time(s) in 96 post(s)
|
Originally Posted by: Andrey Ivashov Hello, Sergio. Originally Posted by: PompelmoTell Thank you for pointing it out. From programmers point of view everything goes correctly here. You tries to transpose every single element of matrix, which is not allowed by the program (as transpose operation can be applied for matrices and vectors only). But on other side I see it will be very handy to have transpose operation in some exceptions list for vectorization. Will check what I can do... Best regards, Andrey Ivashov. First of all - thank you, Andrey, vectorize() can be EXTREMELY useful. My vote goes for creating no exceptions. Its way easier for end user to understand why vectorize() throws an error (inverse of zero for example), rather than understanding why one "exception" works but not another. A logically valid workaround is use of eval() inside vectorize - it just makes sense, easy to document and achieves the end goal. If anything we could use a symbolic alternative of eval() (or does it already exist)? Cheers All Edited by user 09 March 2016 18:55:14(UTC)
| Reason: Not specified
|
1 user thanked Alex M. for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 13/01/2012(UTC) Posts: 2,690 Location: Italy Was thanked: 1368 time(s) in 895 post(s)
|
Originally Posted by: Alex.M My vote goes for creating no exceptions. Its way easier for end user to understand why vectorize() throws an error (inverse of zero for example), rather than understanding why one "exception" works but not another.
A logically valid workaround is use of eval() inside vectorize - it just makes sense, easy to document and achieves the end goal.
If anything we could use a symbolic alternative of eval() (or does it already exist)? That's an interesting and clean approach Since eval() force evaluation in place, maybe a novectorize() [like noparse in bbcode] may be an alternative to keep the symbolic data P.S. Still no ideas about this error? Edited by user 09 March 2016 23:28:24(UTC)
| Reason: link fixed |
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects |
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 03/03/2014(UTC) Posts: 418 Was thanked: 125 time(s) in 96 post(s)
|
Originally Posted by: Davide Carpi Since eval() force evaluation in place, maybe a novectorize() [like noparse in bbcode] may be an alternative to keep the symbolic data .. It might be easier for an unfamiliar person to find the function if it is similar in name to eval(), say eval.sym(); in this case eval.sym() will evaluate the expression symbolically. The function can be usefull beyound vectorize() (say in passing input to plugins).
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 13/01/2012(UTC) Posts: 2,690 Location: Italy Was thanked: 1368 time(s) in 895 post(s)
|
maybe simply symb() ... Originally Posted by: Alex.M The function can be usefull beyound vectorize() (say in passing input to plugins). I miss the point here, you can pass almost whatever you want to the plugins... |
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects |
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 03/03/2014(UTC) Posts: 418 Was thanked: 125 time(s) in 96 post(s)
|
Originally Posted by: Davide Carpi I miss the point here, you can pass almost whatever you want to the plugins... It might be me and my lack of programming skills, but unless I use an eval() on the expression passed to my excel_IN function, it will not cancel out all the units before pasting the value into the EXCEL cell. End result - MESS. Instead of cell value 3138.0096 i get 2.82646777304901*10^19/9007199254741*'kg*'m^2/'s^2*1/10^3*'kg*'m/'s^2*'m (which is actually 3138.0096). I figured our proposed symb() function can be used in similar way to cancel out units, but preserve symbolic notation. P.S.: I'm sure I could do it somehow inside the plugin code, I just do not know how... And would not want to get off topic here. Edited by user 10 March 2016 02:49:24(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 17/01/2013(UTC) Posts: 296 Location: Khabarovsk, Russia Was thanked: 151 time(s) in 107 post(s)
|
I'm not sure if this had been asked: Currently, it's impossible to create a function like f(M)=sum(M) because sum takes only matrices, and M here is unknown type. Using, say, augment(), which return type is known to be a matrix, I can do this: f(M)=sum(augment(M)) I cannot use vectorize(), because its return type may be scalar like in vectorize(1), or system. Though I can use it with eval(). The question is, is it possible to make vectorize always return matrix? When argument is a operation on system, for example, the result type differs from input. Having this could allow for such constructs without evals. Or maybe allow sum to accept any type of input, making it return input itself if it's scalar/system/string? Edited by user 22 March 2016 06:13:58(UTC)
| Reason: Not specified |
Best regards, Mike Kaganski |
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 17/01/2013(UTC) Posts: 296 Location: Khabarovsk, Russia Was thanked: 151 time(s) in 107 post(s)
|
It is unfortunate that eval() prevents vectorize() from evaluating its arguments one-by-one. For example:
f(x):=(1/x)^2 vectorize(mat(1,2,3,4,2,2))=mat(1,0.25,0.1111,0.0625,2,2)
f(x):eval((1/x)^2) vectorize(mat(1,2,3,4,2,2))=mat(5.5,-2.5,-3.75,1.75,2,2)
If the expression of vectorize is optimized before by-element evaluation, then it's impossible to use, say, linterp() in such functions, and eval doesn't help. |
Best regards, Mike Kaganski |
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 983 time(s) in 811 post(s)
|
Vectorise is specific to Mathcad, then new to Smath. A risky new bugger that does not speak, won't match Mathcad either ... and almost impossible to exhaust. We can expect more and more of that in the Forum. Jean
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 983 time(s) in 811 post(s)
|
Originally Posted by: mikekaganski It is unfortunate that eval() prevents vectorize() from evaluating its arguments one-by-one. For example:
f(x):=(1/x)^2 vectorize(mat(1,2,3,4,2,2))=mat(1,0.25,0.1111,0.0625,2,2)
f(x):eval((1/x)^2) vectorize(mat(1,2,3,4,2,2))=mat(5.5,-2.5,-3.75,1.75,2,2)
If the expression of vectorize is optimized before by-element evaluation, then it's impossible to use, say, linterp() in such functions, and eval doesn't help. ... and you have it wrong both ways. Solution is: return Smath to the last working version [5346], litle simples step of more maths and more conviviality... issue patch. linterp what ? you just have the Y vector ! Jean
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 17/01/2013(UTC) Posts: 296 Location: Khabarovsk, Russia Was thanked: 151 time(s) in 107 post(s)
|
Thank you Jean for attention. Though when I read things like that: Originally Posted by: Jean Giraud ... and you have it wrong both ways. Solution is: return Smath to the last working version [5346], litle simples step of more maths and more conviviality... issue patch. linterp what ? you just have the Y vector ! I start to think that you want to be rude. I have it wrong both ways? What do you mean by that? Have you read that carefully? First way I get absolutely correct matrix of original numbers raised to power (-2). How is that incorrect? Or do you think that you know my requirements better? Your method works, and fine. I have mine, working too. But what I write about isn't call for help "Hey! I'm lost in two trees! How do I calculate them?", but a proposal to enable more powerful use of new shiny feature. "linterp what ? you just have the Y vector !" - I wrote that if some of my function internally uses linterp for some reason, it currently automatically isn't fit for use inside vectorise. I'm trying to replace a number of loops in my files that are used to fill matrices, with a cleaner syntax of vectorise. And I meet with some limitation that MAY be curable if Andrey decides that it's possible (and that's not too difficult taking into account his code). Specifically, I attach a file that I tried to cleanup today. One of loops is marked by magenta. It's impossible to rephrase it like is shown to the right of it on margin (highlighted by red), though both Q and t are vectors that I want to be used one-by-one, to get resulting vector of formula results. The problem is that the functions that are used in my top-most function use *interp() on some other matrices, and that makes this syntax illegal. I dream of a proposed here "novectorize" or suchlike... Regulirujushchijj klapan.sm (233kb) downloaded 45 time(s). |
Best regards, Mike Kaganski |
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 983 time(s) in 811 post(s)
|
Originally Posted by: mikekaganski I'm trying to replace a number of loops in my files that are used to fill matrices, with a cleaner syntax of vectorise. And I meet with some limitation that MAY be curable if Andrey decides that it's possible (and that's not too difficult taking into account his code).
Specifically, I attach a file that I tried to cleanup today. One of loops is marked by magenta. It's impossible to rephrase it like is shown to the right of it on margin (highlighted by red), though both Q and t are vectors that I want to be used one-by-one, to get resulting vector of formula results. The problem is that the functions that are used in my top-most function use *interp() on some other matrices, and that makes this syntax illegal. I dream of a proposed here "novectorize" or suchlike...
In the attached, your clean creation of dual vector is suggested. You could probably work a long route by creating the model of T, P data set. By inspection it looks simple polynomial fit. Seeing ΔP make me think your are trying to compute some MassFlow in association with m^3. You may not have the appropriate formulation ... which is in construction in my design board, maybe a day or two. On the other hand ΔP.доЦТП:vectorize(Δp(Q,D,L,Δ.э,t)) is not a function definition. If I'm correct assuming you try to compute MassFlow, better start working unitless to ease reading. Regulirujushchijj klapan Notes.sm (293kb) downloaded 44 time(s).
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 13/01/2012(UTC) Posts: 2,690 Location: Italy Was thanked: 1368 time(s) in 895 post(s)
|
About foo1 and foo2 you can avoid the evaluation on assignment using a programming function (line()); no ways to use vectorize on linterp foo.sm (21kb) downloaded 52 time(s).Any further improvement on vectorize is welcome from my side Edited by user 23 March 2016 01:47:59(UTC)
| Reason: Not specified |
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects |
1 user thanked Davide Carpi for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 05/03/2009(UTC) Posts: 433 Location: USA Was thanked: 17 time(s) in 15 post(s)
|
The problem is that "vectorize" is not passed through with the function definition You will notice that the vectorization "arrow" is missing in the definition of f
|
|
|
|
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.