cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

How do I correlate (SQL style) two arrays, one small which contains data about the entities, and one very large which contains results data at each entity?

dridgley
1-Visitor

How do I correlate (SQL style) two arrays, one small which contains data about the entities, and one very large which contains results data at each entity?

Hi there,

I'm an engineer looking for a way to automate the report generation of calculations using data from finite element applications. I'm hoping Mathcad might provide a solution.

I've looked through the help files and performed various searches but to no avail. I am a novice Mathcad user.

For those who aren't familiar, all that really matters is that we have a structural model which contains many 'elements'. You can think of the elements as Lego bricks to aid visualisation.

Each element only has one set of properties, such as max shear, max tension etc. A table of the properties for, say, a two element model might look like this:

Element_ID     MaxForce(lbf)

     1                      2000

     2                      2400

But each element can have many results records for different loading scenarios. The results might look like this in a CSV file for three load cases:

Element_ID     Load_ID     Force(lbf)

     1                         1          500

     2                         1          600

     1                         2          45.6

     2                         2          200

     1                         3          123

     2                         3          2400

I can easily import the above into Mathcad as two seperate arrays from two CSV files.

What I need to do is create a third array within Mathcad which contains the following:

Element_ID     Load_ID     Force(lbf)     MaxForce(lbf)

     1                         1          500               2000

     2                         1          600               2400

     1                         2          45.6              2000

     2                         2          200               2400

     1                         3          123               2000

     2                         3          2400             2400

Of course in reality we have far more elements and results set than above.

I could do the above easily enough using a database and a bit of SQL, but as I said I'm really hoping to automate the writing of reports if at all possible.

Kind regards,

Damo

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:dridgley)

Are you looking for something like this:

View solution in original post

5 REPLIES 5
RichardJ
19-Tanzanite
(To:dridgley)

It's not clear what you want. You import three columns and want to add a fourth. Where does the fourth column come from? Is it calculated? Imported from a different file?

Werner_E
25-Diamond I
(To:dridgley)

Are you looking for something like this:

That worked beautifully Werner, thanks so much.

I'll try and figure out how exactly it works this evening

PS, I couldn't see how to open your zipped file in Prime 3.1. The .xmcdz extension didn't seem to be recognised.

Werner_E
25-Diamond I
(To:dridgley)

You did not state which version you are using so I created the file in the version I am using for my work and thats Mathcad 15.

You can't open a MC15 file directly in Prime - you have to convert is before. There is a menu item in Prime to do so but it requires a full installation of MC15 to do the conversion. As a user of Prime you are entitled to download MC15 and use it using the same license file as for Prime.

If you have not installed MC15 I guess you would rather work from the picture I added and if you experience problems come back and ask.

Please find Mathcad Prime worksheet in attachment.

Announcements

Top Tags