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

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

Translate the entire conversation x

Must be scalar problem

fahmed-2
14-Alexandrite

Must be scalar problem

Hello ,

 

How should I fix the following issue. Initially works fine but changing the units cause the following error.

fahmed2_0-1744225040913.png

 

ACCEPTED SOLUTION

Accepted Solutions

Hi,

Just get rid of the inline equals.

Capture.JPG

View solution in original post

7 REPLIES 7

Hi,

Just get rid of the inline equals.

Capture.JPG

fahmed-2
14-Alexandrite
(To:terryhendicott)

I am trying to icorporate the last range value from delta_z but not working @terryhendicott 

 

fahmed2_0-1744229029480.png

 

fahmed-2
14-Alexandrite
(To:fahmed-2)

Thank you so much @terryhendicott 

Werner_E
25-Diamond I
(To:fahmed-2)

It has often proven that inline evaluations (evaluating a value in the same region where you define it) is something which is better avoided in Mathcad/Prime and that you are better off to put definition and evaluation in two different regions.

Nonetheless I would call what you experience a bug in Prime (it works OK in real old Mathcad = Mathcad 15, 14,.. and also in older Prime versions - at least it works OK in P6) and so you may consider reporting it to official PTC support by opening a support case.

As far as I remember this bug popped up here in the forum already in the past now and then.

Solution/workaround is to avoid inline evaluation and evaluate the range variable in a separate region.

Werner_E_0-1744229335248.png

 

BTW, doing what you did - defining a range variable and using inline evaluation was an undocumented way to turn a range into a vector. 

This convenient option was deliberately made unfeasible by PTC in version 10 because it contradicts the logic that an evaluation changes the data type. Unfortunately, the built-in ‘vec’ function is only now being supplied as an alternative in version 11.
But this change should not be the reason for the bug, because it is already present in version 9, but not yet in version 6!

 

fahmed-2
14-Alexandrite
(To:Werner_E)

Thank you, how should i refer the last i-th number of the range then since "last()" is not working

Werner_E
25-Diamond I
(To:fahmed-2)


@fahmed-2 wrote:

Thank you, how should i refer the last i-th number of the range then since "last()" is not working


Why would you do so?

A range is not a collection of numbers like a vector but rather kind of an implicit loop.

last() is used to get the last index in a vector, a range not being a vector does not consist of numbered values.

 

It depends on what your final goal is but maybe you need to turn the range into a vector. In Prime 11 you may use the new built-in function "vec" to do so, in Prime 10 you may use one of the various "vec" function which were posted here in the forum by various people.

A simple version is shown in the picture below

Werner_E_0-1744236346920.png

 

 

fahmed-2
14-Alexandrite
(To:Werner_E)

this solution just went over my head but thanks much @Werner_E 

Announcements


Top Tags