Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X
hello.
I want to use the simplified equation surrounded by the red line instead of the ( if function) , how i can make it work?
thanks.
Solved! Go to Solution.
Its not clear to me what you actually want and what you mean by "instead of the if-function".
What you has encircled in red is a boolean expression - its either 0 (=false) or 1 (=true). Do you really want your k.c to be 0 or 1 only?
Actually you already use the encircled expression in your calculation, but of course you have to tell Prime what to do if the expression is not in between the two values and this can be done with if statements or using the if-function, if you feel that the if statements take up to much space:
A tricky way to achieve the same effect is using the min and max functions:
Its not clear to me what you actually want and what you mean by "instead of the if-function".
What you has encircled in red is a boolean expression - its either 0 (=false) or 1 (=true). Do you really want your k.c to be 0 or 1 only?
Actually you already use the encircled expression in your calculation, but of course you have to tell Prime what to do if the expression is not in between the two values and this can be done with if statements or using the if-function, if you feel that the if statements take up to much space:
A tricky way to achieve the same effect is using the min and max functions:
I want kc to be equal to the equation but not less than 0.35 and not more than 0.76, but the result gives me zero, how I can make it give the same result as the (if function)?
See my suggestions above.
Again, what you encircled is a Boolean expression and so its value is either 0 or 1. You can use Boolean expression in if-functions, if-statements, while-loops, ... But the expression itself will always be either 0 or 1, depending on if its false or true.
Here are some other variants
And if you need it more than once to limit a variable in between two values, you may consider using a little utility function
Very thanks.