Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to do big if statement, and iterative calculations?

Status
Not open for further replies.

vesselguy

Petroleum
Feb 25, 2002
386
CA
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.



 
Replies continue below

Recommended for you

> First question. You'd use the programming constructs in Mathcad

> 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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top