×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Are you an
Engineering professional?
Join Eng-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*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.

# Programming an iterative loop

 Forum Search FAQs Links MVPs

## 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
(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
(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.

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

Click Here to join Eng-Tips and talk with other members! Already a Member? Login

#### Resources

Low-Volume Rapid Injection Molding With 3D Printed Molds
Learn methods and guidelines for using stereolithography (SLA) 3D printed molds in the injection molding process to lower costs and lead time. Discover how this hybrid manufacturing process enables on-demand mold fabrication to quickly produce small batches of thermoplastic parts. Download Now
Design for Additive Manufacturing (DfAM)
Examine how the principles of DfAM upend many of the long-standing rules around manufacturability - allowing engineers and designers to place a partâ€™s function at the center of their design considerations. Download Now
Taking Control of Engineering Documents
This ebook covers tips for creating and managing workflows, security best practices and protection of intellectual property, Cloud vs. on-premise software solutions, CAD file management, compliance, and more. Download Now

Close Box

# Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!