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

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

14-Alexandrite

## Symbolic evaluation of max and min

Hello!

How do I evaluate the statement (attached) symbolically?

I want to get a symbol as answer and not the assigned value of it.

Best regards,

Sergey

1 ACCEPTED SOLUTION

Accepted Solutions
24-Ruby V
(To:Sergey)

The symbolic does not know anything about units and treats them as unknown variables. Thats the reason why the symbolic can't decide, which variable is bigger. If MPa would be negative, the max would be sigma1, if MPa is positive, the max is sigma2 and if MPa is zero, both are equal (0).

You may tell the symbolic that MPa is positive with the "assume" modifier and also add the "simplify" modifier to get the correct numeric result.

But its easier to achieve using a simple numeric evaluation.

But in case you expect the symbolic answer "sigma2" instead of "300 MPa" - there is no way to achieve this answer.

You could use the if-function or an if-statement with a text result as a workaround:

In Prime use "else" instead of "otherwise".

3 REPLIES 3
24-Ruby V
(To:Sergey)

The symbolic does not know anything about units and treats them as unknown variables. Thats the reason why the symbolic can't decide, which variable is bigger. If MPa would be negative, the max would be sigma1, if MPa is positive, the max is sigma2 and if MPa is zero, both are equal (0).

You may tell the symbolic that MPa is positive with the "assume" modifier and also add the "simplify" modifier to get the correct numeric result.

But its easier to achieve using a simple numeric evaluation.

But in case you expect the symbolic answer "sigma2" instead of "300 MPa" - there is no way to achieve this answer.

You could use the if-function or an if-statement with a text result as a workaround:

In Prime use "else" instead of "otherwise".

14-Alexandrite
(To:Werner_E)

Hello.

I am writing one paper and want to show in context of the example that sigma_1 is the value to use. It is just more convenient in my particular case due the frequent use of sigma_1 and sigma_2 in the text that leads to the example.

14-Alexandrite
(To:Werner_E)

I think that "If statement" is the one to use here.

Thank you.

Announcements
Top Tags