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

The PTC Community email address has changed to community-mailer@ptc.com. Learn more.

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, 

1 ACCEPTED SOLUTION

Accepted Solutions

Try the attached ...

View solution in original post

5 REPLIES 5


@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

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,