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

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Simple beam analysis - moment equation...?

justhumm
10-Marble

Simple beam analysis - moment equation...?

I was looking at the sample worksheet (PDF) posted on the PTC website and I created a (supposed to be) matching MathCAD Prime 7.0 worksheet.

 

https://community.ptc.com/t5/Mathcad/Building-Structural-Design-Single-Span-Beams-Shear-and-Moment/td-p/450598 

 

Almost everything matches the sample PDF results...the Shear values, shear graph, and maximum Moment.

 

BUT the moment function and graph points are way off.

 

I've skimmed over everything multiple times and I can't see any typos or errors.

Can anyone see where the error is? Thanks!

ACCEPTED SOLUTION

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

Again vectorization does the job

Werner_E_0-1703890609491.png

And again my question - why bother with the vectors when you simply want a plot of a function to be done? (Thats what Excel people have to do but its not necessary to do so in Mathcad or Prime).

Werner_E_1-1703890725798.png

 

You may also use Primes Quickplot feature which means that you don't have to define the variable (xm) for the abscissa at all (neither as a vector, nor as a range). You have to edit the axis ticks (first, second and last) to get the plot done for the desired range from 0 to 27. Prime will automatically use appropriate values for xxm even though its not defined. But Prime will only use simple scalars. So if you need unit, you will have to multiply xxm by the desired unit and that doesn't look really good.

Werner_E_0-1703957768141.png

I find that its easier and gives better control to define a range variable like xm to be used in the plot.

 

View solution in original post

4 REPLIES 4
Werner_E
25-Diamond I
(To:justhumm)

Again vectorization does the job

Werner_E_0-1703890609491.png

And again my question - why bother with the vectors when you simply want a plot of a function to be done? (Thats what Excel people have to do but its not necessary to do so in Mathcad or Prime).

Werner_E_1-1703890725798.png

 

You may also use Primes Quickplot feature which means that you don't have to define the variable (xm) for the abscissa at all (neither as a vector, nor as a range). You have to edit the axis ticks (first, second and last) to get the plot done for the desired range from 0 to 27. Prime will automatically use appropriate values for xxm even though its not defined. But Prime will only use simple scalars. So if you need unit, you will have to multiply xxm by the desired unit and that doesn't look really good.

Werner_E_0-1703957768141.png

I find that its easier and gives better control to define a range variable like xm to be used in the plot.

 

I tried putting the Shear and Moment calculations into standalone functions.

Similarly to what I was running into before, the shear calculation is correct (once someone pointed out my stupid mistakes), but the moment calculation is "incorrect" similar to 

I tried vectorizing the result and a few other locations. It either had no effect or it returned an error message that "the vectors must be the same size".

Can anyone see where the error is? Thanks!

 

error3.png

LucMeekes
23-Emerald III
(To:justhumm)

The error occurs because a and w are 3-element vectors, while p is a 2-elememnt vector. For vectorisation, all vectors need to be the same size (length). The other parameters to the function are scalars, that's OK.

 

Success!
Luc

Werner_E
25-Diamond I
(To:justhumm)

Why would you like to call this function vectorized? The function obviously is written to expect a, w and p to be vectors.
Even if p would be a vector of three element, I guess you won't get the result you expect.

Vectorization means that the elements of the vectors (ALL vectors, thats the reason the have to be of same length) are singly fed into the function. That means that L <- sum a would throw an error because is then would not be a vector, etc.

 

If your goal is to  feed a vector for the first argument x and only vectorize for this vector, you would have to resort to a trick like the one shown below:

Werner_E_1-1704329113797.png

The redefined function BAM uses a local auxiliary function with just the first argument as its argument which calls your original BAM function and then calls this function vectorized. You may consider renaming your original function to avoid confusion.

The first argument (x) of the function BAM( ) now can be either a scalar or a vector of values.

Announcements

Top Tags