SMath Studio 0.98.5908 (05 March 2016) - Сообщения
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!
[albumimg]1433[/albumimg]
[albumimg]1432[/albumimg]
[albumimg]1431[/albumimg]
example.zip (428 КиБ) скачан 49 раз(а).
Your example that works elements wise, check for other issue:
vectorise as you did ... SQRT(

the attached work sheet in light red.
Jean
Utilities Matrix Vectorise EXPRESS.sm (56 КиБ) скачан 69 раз(а).
... read more as well.
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
WroteI 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
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
WroteWroteI 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
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
WroteHello, Sergio.
Wrote[albumimg]1430[/albumimg]
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
WroteMy 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?

Wrote
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).

WroteThe 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...

Wrote
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.
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?
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.
WroteIt 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
Though when I read things like that:
Wrote... 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 (232 КиБ) скачан 61 раз(а).
WroteI'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 (292 КиБ) скачан 63 раз(а).

foo.sm (20 КиБ) скачан 68 раз(а).
Any further improvement on vectorize is welcome from my side

-
Новые сообщения
-
Нет новых сообщений