×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

How to do big if statement, and iterative calculations?

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.



RE: How to do big if statement, and iterative calculations?

>  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: Eng-Tips.com Forum Policies

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources