Help with IF statements
Help with IF statements
(OP)
How to I write the following in MathCAD?
If Pr >= 0.51 and Pr <= 0.7 then Scf = 2.4 + ((Pr-0.51)^3 * (3.82))
If Pr ? 0.70 then Scf = 3.125 + ((Pr-0.7) * (8.25))
Thanks,
CadLady
If Pr >= 0.51 and Pr <= 0.7 then Scf = 2.4 + ((Pr-0.51)^3 * (3.82))
If Pr ? 0.70 then Scf = 3.125 + ((Pr-0.7) * (8.25))
Thanks,
CadLady





RE: Help with IF statements
If a is true then the returned value is b, else the returned value is c.
For example:
Scf:=If((Pr>=0.51)*(Pr<=0.7),((Pr-0.51)^3*(3.82)),(3.125+((Pr-0.7)*(8.25))))
For AND and OR operators mulriply or add boolean operators, the example abocve shows an AND operator
(Pr>=0.51)*(Pr<=0.7)= (Pr>=0.51) AND (Pr<=0.7)
where as
(Pr=0.51)+(Pr=0.7)= (Pr=0.51) OR (Pr=0.7)
Hope this helps.
Fawkes
RE: Help with IF statements
Write 'Scf:=' then press '}' (curly bracket) this will open a conditional object. Write the answer then press SHIFT+} to start the conditional statement (MatchCAD should automatically write ' if '). Use the arrow keys to move between different rows in the equation.
Any problems check out the help for Conditional Statements.
Fawkes
RE: Help with IF statements
What do you mean by "pr?0.7". Is the "?" supposed to be <,=, or >?
More help to follow when I know what this means...
Imagineer
RE: Help with IF statements
Quite right, sorry, press the square bracket first.
Fawkes