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

which of the solutions is right?

EN_9902818
6-Contributor

which of the solutions is right?

Hi,

 

I'm trying to find a variable and I've tried three ways of doing this. Please see attached.

I used an If statement and then put it in a program. Unfortunately, I can't see what is the difference among these 3 but I get different results. My preferred option is the program but I can't find why it is wrong..

 

Could you please check:)

 

thanks, 

ACCEPTED SOLUTION

Accepted Solutions
StuartBruff
23-Emerald III
(To:EN_9902818)

Try the attached ...

View solution in original post

5 REPLIES 5
StuartBruff
23-Emerald III
(To:EN_9902818)


@EN_9902818 wrote:

Hi,

 

I'm trying to find a variable and I've tried three ways of doing this. Please see attached.

I used an If statement and then put it in a program. Unfortunately, I can't see what is the difference among these 3 but I get different results. My preferred option is the program but I can't find why it is wrong..

 

Could you please check:)

 

thanks, 


Your last option doesn't work because it returns the error message, and you've pre-added kPa in the evaluation operator units placeholder ... and strings don't take units.  I suggest that in cases such as Option 3, you put the units in the return expression.

 

Stuart

StuartBruff
23-Emerald III
(To:EN_9902818)

Try the attached ...

Thank you very much!!!

Attached is a file that demonstrates the power and usefulness of vectorizing.

 

Method 1 is correct.

 

Method 2 is wrong because it carries the index (i) inside the program while it's still on V_Ed.red.  If you eliminate the index on that I believe Method 2 should work.  (With only Express, I an't try.)

 

Method 3 fails because the units on the text message don't match the units of the calculation.  (Texts don't have units.)

Hi,

 

Thank you very much. This is very helpful.

 

Cheers,

Announcements

Top Tags