cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Scalar or vector bug in Mathcad prime 8

KAL_1625
10-Marble

Scalar or vector bug in Mathcad prime 8

Mathcad prime 8 is having trouble understanding Vector quantity. When I open the worksheet, It automatically calculates and throws the error " This value must be scalar or vector".

KAL_1625_0-1664830579681.png

When the equals sign is deleted and replaced, the worksheet works fine.

KAL_1625_1-1664830621949.png

But then if I change the units from "m" to "mm", the worksheet looses the vector values again and throws the same error. Can someone confirm if there is permanent solution to this.

P.S: I created this worksheet in Mathcad prime 7.0, recently got prime 8 installed. Could that be reason? Or just this version has the bug.

 

 

ACCEPTED SOLUTION

Accepted Solutions
LucMeekes
23-Emerald III
(To:KAL_1625)

In Prime 8 you can create a range with units:

LucMeekes_0-1664876729383.png

It will display as a range (which is not discernable from the display of a vector):

LucMeekes_1-1664876786379.png

And you can change the unit, from m to mm:

LucMeekes_2-1664876828883.png

But it stays a range, you cannot index it:

LucMeekes_3-1664876863443.png

When you define a range and immediately evaluate the definition, you get a vector:

LucMeekes_4-1664876930104.png

(You can index it:

LucMeekes_5-1664876965457.png)

BUT, if you change the result unit, (e.g. from m to mm), you get:

LucMeekes_6-1664877010413.png

With error: "This value must be a scalar or a matrix", and then of course the variable is undefined:

LucMeekes_7-1664877085371.png

let alone that you can index it.

To repair, you have to remove the evaluation from the range definition, so remove the =.

After that you can (if you want) re-add the evaluation the arrive (again) at:

LucMeekes_8-1664877228245.png

It appears that Prime 7 is immune to changing the unit of the evaluation of the definition of a range with units:

LucMeekes_0-1664877694520.png

 

Defining a vector through immediate evaluation of a range definition is an undocumented feature/bug. It should not be used, or else with extreme care and realising that this feature/bug can be broken/fixed at any Prime revision.

 

Success!
Luc

View solution in original post

6 REPLIES 6
ttokoro
20-Turquoise
(To:KAL_1625)

image.pngimage.pngimage.png

Delete = after the definition of function. Then You can do what you want.

Werner_E
25-Diamond I
(To:KAL_1625)

I can confirm that what you tried works OK in Prime 6.

Werner_E_0-1664850925148.png

So obviously they broke something in Prime 8.

 

But you must be aware that the convenient feature of turning a range into a vector by following the definition immediately by an evaluation always has been an undocumented feature  and as such always was a candidate subject to be changed without notice. I guess that for some reason they broke that feature at least when using it with units.

I guess that, even though you cannot change the unit from m to mm in the evaluation after the definition you may be able to do so in a separate region as the conversion from a range into a vector still seems to work (can't test myself as of lack of P8):

Werner_E_1-1664851549405.png

 

The "normal"/"official" ways to create a vector should not been affected, too, I suppose. For instance

Werner_E_2-1664851616179.png

 

 

LucMeekes
23-Emerald III
(To:KAL_1625)

In Prime 8 you can create a range with units:

LucMeekes_0-1664876729383.png

It will display as a range (which is not discernable from the display of a vector):

LucMeekes_1-1664876786379.png

And you can change the unit, from m to mm:

LucMeekes_2-1664876828883.png

But it stays a range, you cannot index it:

LucMeekes_3-1664876863443.png

When you define a range and immediately evaluate the definition, you get a vector:

LucMeekes_4-1664876930104.png

(You can index it:

LucMeekes_5-1664876965457.png)

BUT, if you change the result unit, (e.g. from m to mm), you get:

LucMeekes_6-1664877010413.png

With error: "This value must be a scalar or a matrix", and then of course the variable is undefined:

LucMeekes_7-1664877085371.png

let alone that you can index it.

To repair, you have to remove the evaluation from the range definition, so remove the =.

After that you can (if you want) re-add the evaluation the arrive (again) at:

LucMeekes_8-1664877228245.png

It appears that Prime 7 is immune to changing the unit of the evaluation of the definition of a range with units:

LucMeekes_0-1664877694520.png

 

Defining a vector through immediate evaluation of a range definition is an undocumented feature/bug. It should not be used, or else with extreme care and realising that this feature/bug can be broken/fixed at any Prime revision.

 

Success!
Luc

Yeah I Agree, with your approach. That is what I have been doing to avoid the error. AS you said maybe prime 7 is immune to such kind of error, I would have expected the newer version to be immune too. Seems like its going backwards in development. If it is bug, is there a place to report bugs as such directly to PTC MathCAD?

Thanks 

Werner_E
25-Diamond I
(To:KAL_1625)

It probably can't be called a bug as it concerns an undocumented feature.

The only way to officially report a bug is to open a support call/ticket.

Announcements

Top Tags