×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Contact US

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!

*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

"augment" in a for-loop

"augment" in a for-loop

"augment" in a for-loop

(OP)
Good morning everybody,
I started working with Mathcad about 2 weeks ago and it's working out pretty good so far. But yesterday I ran into a problem I could not solve:

I have an array "NAME" which consist of n (with current data n=9) subarrays, each with the dimension {1,5}. These subarrays contain all x-coordinates of a modell, so I have two more arrays that need to be handled the exact same way.

The subarrays of each array need to be writen into one array which: Doing this manually works with:

KOORDX:=augment(NAME0,NAME1,...........,NAME8)

As you can see, this becomes rather intricate (3x9 subarrays...) to handle, especially since the preceding calculations (11 pages in total) are fully parametric and so the number of subarrays varies with the input.

I tried implementing "augment" into a for-loop but I can't get it to work.

SORTING=FOR i element 0..(n-1)
Xi <- augment(NAMEi)
same with Y
same with Z
VECTOR <- (X,Y,Z)T

But doesnt return what I need.

I added a mathcad-file with my syntax and the problem...

RE: "augment" in a for-loop

(OP)
I can't upload my file for some reason, so here's a screenshot:

RE: "augment" in a for-loop

You've used an illegal reference. You've defined TEST to be a function, and therefore, you cannot reference it as a variable. You can, however, use TEST(XCOORD)[0, TEST(XCOORD)[1, TEST(XCOORD)[2 to extract the nested arrays.

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

RE: "augment" in a for-loop

(OP)
Thank you, I see my mistake regarding the variable / functions name.

But your suggestion regarding the extraction doesnt help me. I know how to do it manually, but I when using the tool I'll have an unpredictable number of arrays which is previously calculated and named "nAxZaehne". With the current inputs this equals 9, but is going to change as soon as I change the input-data (which will happen as soon as we start using the tool). Therefore I need to programm a function with a for-loop, with automatically updating limits (0;nAxZaehne) so that every time the subarrays are automatically augmented.

Writing all subarrays manually into the "augment"-function works as I've shown in the screenshot's fourth line. But any construction using a loop does not work.

Here are some further things I tried but could not make them work:

variablename:=augment (for i € 0;(nAxZaehne-1))
subarray[i

This returns only the very last subarray with the index nAxZaehne but none of the previous ones...

for i € 0;(nAxZaehne-1)
augment(subarray[i)

Same problem here...it doesn't seem to matter wether I put the augment-function into the augment-function's argument or write it beforehand...Logically speaking this is strange...The first example does not repeat the augment-function but rather counts through the subarrays and the second one uses the augment-function according to the limits. But both return the exact same output...

Does anybody know how I can use the for-loop with "augment", so all subarrays are returned?

RE: "augment" in a for-loop

you are not making sense now. AUGMENT is a method for combining smaller arrays into a single large array, so what do you mean by, "so all subarrays are returned" In any case, your programmatic approach is nothing like what you did with the in-line AUGMENT, wherein you essentially concatenated three arrays into one.

In a programmed approach, you would augment the first and second, and then augment that result with the third, and so on.

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! 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:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close