How to do big if statement, and iterative calculations?
How to do big if statement, and iterative calculations?
(OP)
I would appreciate any help in providing me with the method to solve my 2 problems. I would like to do a whole bunch of calculations inside an "if" statement but I can't figure out how to do it in MathCAD. An example, written in basic,is as follows,
if A = true then
D = pi*r^2/4
Beta = Gamma * D/k
C = 8*k*roh^2
etc...
else
D = pi*ro^2/4
Beta = W*H^4/2
K = .....
etc...
end if
How would you write this if statement in MathCAD? Can I handle this in one big if function?
Second question is, how do you handle a iterative set of calculations where you first take a guess at one number and then do a whole bunch of calcs. Then at the end of the calc you check for an approach tolerance and if not acceptable then send a calculated improved guess back to the beginning. I hope I'm clear on this.
Thanks in advance.
if A = true then
D = pi*r^2/4
Beta = Gamma * D/k
C = 8*k*roh^2
etc...
else
D = pi*ro^2/4
Beta = W*H^4/2
K = .....
etc...
end if
How would you write this if statement in MathCAD? Can I handle this in one big if function?
Second question is, how do you handle a iterative set of calculations where you first take a guess at one number and then do a whole bunch of calcs. Then at the end of the calc you check for an approach tolerance and if not acceptable then send a calculated improved guess back to the beginning. I hope I'm clear on this.
Thanks in advance.





RE: How to do big if statement, and iterative calculations?
> Second question. You'd use Given-Find. Generally, it looks like
a:guess value b:value
Given
blah <CRTL>= blah
etc.
find(a)=
TTFN
FAQ731-376: Eng-Tips.com Forum Policies