×
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

Programming an iterative loop

Programming an iterative loop

Programming an iterative loop

(OP)
Hello everyone,
I am new in programming with Mathcad, as up to now I have only used it for simple calculations. I now want to solve an energy balance which needs to be solved iteratively. The error I get is not enough memory for this peration but I am guessing I am doing something wrong with arrays. Apart from that, I am also wondering whether my way of thinking is the wrong one for Mathcad, since I am trying to solve it in the same way I do it in Matlab.
I would really appreciate any help.
El.

RE: Programming an iterative loop

Your getting a memory because your loop hasn't ended after 23 iterations.

Your "while loop" counter needs to be inside the "while loop" syntax

i.e : t <-- t + 1

However from looking at your program I don't think it will work as intended.

Dave, Msc(Eng), AMIMechE
Graduate Mechanical Engineer
(3 Years left for Chartership!)

RE: Programming an iterative loop

Apologies for the typos, i really should proof read more, it was indeed in my last appraisal.

*You're getting a memory error...

Dave, Msc(Eng), AMIMechE
Graduate Mechanical Engineer
(3 Years left for Chartership!)

RE: Programming an iterative loop

Not to discourage you from programming, but the problem doesn't really need a program loop. It looks to be solvable with Given-Find or Minerr, which are described in the Help entries. They will do the iterative solution on their own; you simply need to provide guess values and all the constraints.

TTFN
FAQ731-376: Eng-Tips.com Forum Policies

Need help writing a question or understanding a reply? forum1529: Translation Assistance for Engineers

RE: Programming an iterative loop

I agree with IRstuff, read up on the "Find" capability and try to re-write it. Once I learned to use it, it has come in very handy.

RE: Programming an iterative loop

(OP)
Dear all,
Thank you very much for taking the time to have a look at my problem. I had tried to use the given/find way, however I couldn't make it work and I thought it could be because I am looking to find the solution as a function of time. I will try it again and see how it goes.
Thanks again,
El

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