Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X
Hi
I recently updated Mathcad Prime 7 to version Prime 11. I'm experiencing issues with previous worksheets when running them in the new version. It seems like I get error messages when performing the vectorization. Example below. Any suggestions on what could solve this problem?
U is a range not a vector !
use v=vec(r)
best of luck
Owe
Regardless of whether it's a range or a vector, this has never been a problem in version 7.0. Why doesn't it work now?
@ksk_10594232 wrote:
Regardless of whether it's a range or a vector, this has never been a problem in version 7.0. Why doesn't it work now?
Hi,
... because PTC declared it an unsupported side effect.
Hi @ksk_10594232,
I wanted to see if you got the help you needed.
If so, please mark the appropriate reply as the Accepted Solution. It will help other members who may have the same question.
Of course, if you have more to share on your issue, please pursue the conversation.
Thanks,
Anurag
... after applying vec function, vectorization is not necessary.
What you did worked OK in old Mathcad and also in Prime, but only up to version Prime 9!
Starting with Prime 10 the undocumented trick that an inline evaluation in a range definition turns a range (= an implicit loop, not a data structure consisting of various values) into a vector of values does not work anymore.
It was a very convenient way but also illogic that an evaluation is changing the datatype and this seems to be the reason why PTC had decided to close this backdoor. Unfortunately they did not provide an alternate solution in Prime 10 so we had to develop our own range_to_vector functions.
In Prime 11, they added the new "vec" function, which allows you to convert an existing range into a vector, but also to create a vector directly. See Functions for Creating Vectors
So, as you are already using Prime 11, replace your first region with the definition of U by
and it should work OK.
Or as an alternative you could let the first region unchanged (you may delete the evaluation = at the end as it has no effect now anymore) and add U:=vec(U) to turn the range into the appropriate vector.
Side note: Once U is a vector it would not be necessary to vectorise the expression D*U because the product of a scalar D and a vector U is again a vector anyway. But of course using vectorisation does not do any harm here and it may be considered good habit to use it.