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

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

what to Use instead of Otherwise in this Example?

IU_10174762
2-Guest

what to Use instead of Otherwise in this Example?

I am working on a solved problem of Piping Network that uses hardy cross method to solve using Mathcad. The book has used some old conditional statements that are now available in Mathcad Prime now. i.e "Otherwise" with If conditions. I want to know how to correctly write the same in new Mathcad prime. I have the screenshot of the problem shown here in old version. I can attach the sheet if u like.
3 REPLIES 3

Please upload your worksheet.

We would have to see the program you try to convert from real Mathcad to Prime.

If its a series of if-statements one after the other followed by an "otherwise", you would replace all if's but the first by "also if"" and the otherwise by an else statement.

Maybe this thread can be of help, too https://community.ptc.com/t5/PTC-Mathcad/Question-about-programming-with-quot-if-quot-and-quot-else-if/m-p/772364/highlight/true#M199277

When using IF statements in Prime, start by typing "if" in a math field, then ctrl+J to activate it. On the next line, type elseif then ctrl+J, then as many more elseifs as you want, and end by typing "else" then ctrl+J. I believe that your "otherwise" would be called "else".

 

Similarly, you can use a vector of logical statements to choose your outcome. This is great if you're using Express, but otherwise the if statements are more readable and give you the option of error proofing your inputs. Best practice is to include all logical options in your if and elsifs, then save the "else" for the condition that your logical condition may be something you don't expect. See below for an example. I hope this helps!

 

KevinFinity_3-1642180577965.png

 

 

 

 

Top Tags