Skip to main content
1-Visitor
January 13, 2022
Question

what to Use instead of Otherwise in this Example?

  • January 13, 2022
  • 3 replies
  • 1563 views
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

24-Ruby III
January 14, 2022

Please upload your worksheet.

25-Diamond I
January 14, 2022

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

12-Amethyst
January 14, 2022

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