Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

A few questions 2

Status
Not open for further replies.

GalileoG

Structural
Feb 17, 2007
467
0
0
CA
I have a variable defined in Mathcad EX: C.e = 5m, I would like to input "C.e" into an excel table in the Mathcad file, how can I do that? Please see attached screenshot.

My second question would be:

There are four different conditions for calculating one variable, each with its own equation. For example: The equation for the exposure factor is different if the building is in "Open Terrain, Rough Terrain, etc.."

What's the cleanest way of setting this spread sheet up to deal with all four level terrains? How can I specify which one applies? I'm creating this spreadsheet in a format that will be used by other people for other projects.

Much thanks
 
Replies continue below

Recommended for you

Choose Component from the Insert menu. If you don't want to display the table in your worksheet, select the "Display as Icon" button. Then, select your input and output cells in your excel sheet. Finally, enter your input variable at the bottom left of the sheet display, and your output variable at the upper left.

I think the cleanest setup is to have the user input the Exposure Catagory. Then, deal with the exposure factors using "if statements" within Mathcad. But first, assign A=1, B=2, C=3 and D=4. Makes the if statements easier to write. In this way, you don't need the excel component at all.

 
I handled wind load inputs with a list box, and used the results from that as an index to an array that store the proper values. "If" statements also work with this. I find it to be pretty neat and clean, but the list boxes don't print very neatly (Mathcad 2001 pro).

I like the list box, or other components, because you limit the available user input to only those values you want to be used and don't have to account for someone choosing a value of "5" when the correct input range is 1-4. Plus you can just click on what you want.
 
 http://files.engineering.com/getfile.aspx?folder=90f47eb5-06fb-4118-8667-8e1496046676&file=untitled.bmp
You are missing your "otherwise" statement, to tell it what to do and complete the function. I find the IF's easier to use by pressing "add a line" initially and placing the if-otherwise there, as shown. If you don't use your otherwise then you get exactly the problem you're noticing. See the attached example.

In the attached picture, the [β][sub]1[/sub] factor for concrete design is calculated using an IF statement.
 
 http://files.engineering.com/getfile.aspx?folder=02fc34e0-5779-4231-9f60-1e82324ee795&file=untitled.JPG
I forgot to note, you have to use the "if" and the "otherwise" from the programming toolbar or keyboard shortcut; you can't just type them.
 
Thanks for the response. My otherwise statement is included (as can be seen by the screenshot.) Perhaps I'm understanding you wrong?
 
I understood you wrong. You need an "and" as mentioned above if the logical test is true only if both test 1 and test 2 are true.
 
Great every thing is working now!

You were right UcfSE about the list boxes, they don't print neatly (the options in the boxes don't show) and I'm using MathCAD 14
 
Yeah, I don't understand why they don't print nicely. When I need the calcs to be legible also, I usually include an extra line that repeats the value of the variable tied to the list box. At least then you can follow your numbers on paper.
 
Clansman,

For the exposure category, I set up a global variable as follows:

(B C D) = (1 2 3)

Set up a 1 X 3 matrix, then ~ (keystroke for global definition,the one that is the 3 line equal sign), another 3 X 1 matrix on the right side of the equal. Now type in the B C D no quotes, and the 1 2 3 in the other matrix.

Now you can input: Exposure := B (without quotes) and it is aready equal to 2. Now you have an index to use in a vlookup to pick the correct value for exposure B.

It looks good on the sheeet because you don't need the quote marks for a text variable, you can just use the letters when you input.


regards,


chichuck

 
Status
Not open for further replies.
Back
Top