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

Units undefined inside ( if function).

KB_10612849
5-Regular Member

Units undefined inside ( if function).

Hello.

I had an issue using the function (if) as shown below picture, can you help me to solve it?

thank.

KB_10612849_1-1678968296359.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

The comparison of sigma.c and sigma.t returns either 0 (false) or 1 (true) which of course can't be compared to 485 MPa.

You have to write it that way

Werner_E_0-1678969185330.png

BTW, you don't have to write the parentheses but I usually add them in such expressions for clarity

But you may also simply write

Werner_E_1-1678969276273.png

You may also consider using the if-function instead of the programmed if-statement

Werner_E_0-1678970013795.png

And here is yet another way to achieve the same result

Werner_E_1-1678970039760.png

 

 

View solution in original post

3 REPLIES 3

Because the (σc V σt) boolean comparison returns a 0 or 1 depending on if it's true or not, and that's a unitless thing that won't be compatible with MPa.

 

You'll want to do if (σc > σmin V σt > σmin) instead.

I manage the Creo and PTC Mathcad YouTube channels for PTC, as well as all PTC Mathcad marketing in general.

The comparison of sigma.c and sigma.t returns either 0 (false) or 1 (true) which of course can't be compared to 485 MPa.

You have to write it that way

Werner_E_0-1678969185330.png

BTW, you don't have to write the parentheses but I usually add them in such expressions for clarity

But you may also simply write

Werner_E_1-1678969276273.png

You may also consider using the if-function instead of the programmed if-statement

Werner_E_0-1678970013795.png

And here is yet another way to achieve the same result

Werner_E_1-1678970039760.png

 

 

KB_10612849
5-Regular Member
(To:Werner_E)

Thanks.

Top Tags