Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

MathCad and Databases 1

Status
Not open for further replies.

courtnvm

Structural
Jun 28, 2003
81
Could someone please tell me what is the easiset way to use databases with MathCad. I would like to create a database of all the AISC steel shapes and their corresponding design values and be able to creata one variable in my MathCad program that would pull up all the design values. Is this possible? If so, could someone elaborate for me. Thank you.

Val
 
Replies continue below

Recommended for you

courtnvm,

I'm not certain if this is the best way, but I've made this work.

I had the shapes database in a spreadsheet, jost the H-shaped members (W, S, M, HP shapes). The channels, angles and others have a differenct list of properties, so I kept them separate. This might work with the whole list, but you'd get some zeros in your table when you're done. It has a line of text at the top, that includes the column headings, (like A, d, tw etc.) It also has a column at the left that has the shape neames (W12X26, W8X31 etc.) I made sure that spreadsheet table has all the X's in upper case to make matdhing easier. Blanks in the spreadsheet table willl shoow up as zeros. All the text will show up in quote marks.

Into your mathcad worksheet, go to the menus:
Insert/Data/Table. This will give you a table that looks like a spreadsheet right in yoru mathcad worksheet. This table will be on the "back side" of a variable definition with an empty placeholder in front.

Click on the place holdere and type in a variable name, something like beamtable. Then, open your spreadsheet in a different window. Go to your table and highlight the whole thing, including the column headings and the beam names on the lift. Type in Ctl-C to copy the wholwe thing to the clipboard.

Bo back to your mathcad, and click on the upper left cell in the spreadsheet, so the entry is highlighted (it shows up in reversee highlighting. Type Ctl-V to paste the clipboard at the highlighted location. This should give you a table full of numbers and some text. Now the variable beamtable has the value(s( in this table.


To use this table in calculations, do the following:

define a variable like Shape:= and give it a value like "W8X24", Make sure the X is in uppercase to get a match.

Then insert a small program:

sectionproperties(beamtable,Shape):=
for i= 1..351
for j= 1..32
if beamtable(i,1)==Shape then beamproperties(j <- beamtable (i,j)
beamproperties

I cannot maake this look exactly like the programming in Mathcad, but all subscripts are typed preceded by [, <- is the programming assignment arrow (see programming toolbar, if-then statements typed using the programming toolbar, and the == is the bold = on the boolean toolbar.

Shape is now a vriable (array) with the value = one line from beamtable, eg. "W8X24",7.08, 7.93, 0.245, etc etc)

To extract them, use the indexes from that variable, for example, A:= shapeproperties(2)*in^2, Ixx := shapeproperties(17), etc etc.

Now you have looked up all the section properteis for the variable Shape. You can use them in calculations.


regards,


chichuck



 
chichuck,

thanks for the reply. I am having a problem with the programming part. Should beamproperties variable in the program be sectionproperties. I apologize if I am misunderstanding how to write the program in MathCad. It has been a while since I have programmed.

Thank you,
Val
 
Courtnvm,


In my worksheet it is not. beamproperties is a local variable in the program. If I remember from my fortran class in school, a it should work the same way if your local variable is also shectionproperties.

I tried that change in my worksheet, and it works properly whether you call the local variable beamproperties or sectionproperties.

regards,


chichuck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor