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

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

3-Visitor

Hi all, I am new to MathCAD and i can just not figure out this bug.

I am trying to plot a chart for beam deflection on prime4. I am using an old mathcad15 sheet as a reference and the cad 15 sheet calculates it fin so this should work but I cannot figure out why it's giving me an error.

1 ACCEPTED SOLUTION

Accepted Solutions
23-Emerald I
(To:Werner_E)

I need to point out that both of you have run afoul of the "English Units" tribulation.

"lb" is a unit of mass.  We're dealing with forces (lbf)

Attached is Werner's sheet modified (sorry Werner) to correct unit issues (including degrees.)

I only have Express, if opened in full Mathcad it should calculate properly.

16 REPLIES 16
24-Ruby V
(To:PH_9740325)

Even though Prime would accept its its bad math to use the same variable as limit and variable of integration like in

But as Prime is unit aware, you must even add the unit to a value of zero. This is different to real Mathcad which uses static unit checking. So a correct approach would be something like

Doing this consequently gives you

BTW, you should Prime let do the conversion from radian to degree and vice versa for you. There is a predefined constant/unit factor "deg" which is pi/180.

3-Visitor
(To:Werner_E)

Thank you so much!! i will give this a go and report back! it looks like this will work!

24-Ruby V
(To:PH_9740325)

The only thing really necessary is to add a unit of length to the lower integral limit.

I also deleted the constant functions E and I because I see no reason for defining them. If you need them later you might re-add them, of course.

3-Visitor
(To:Werner_E)

yes, I did this and also deleted the constant functions. for some reason prime seems to think i have not defined 'x' 'y' and 'slope'. I'm baffled as to why.

3-Visitor
(To:PH_9740325)

It says to check that the label is set correctly.

23-Emerald I
(To:Werner_E)

"I also deleted the constant functions E and I because I see no reason for defining them. If you need them later you might re-add them, of course."

Just to clarify (since you're commenting in an area that I spent my career dealing with):

• "E" refers to Young's Modulus, the ratio of stress to strain.  This is a material property (this example is probably steel), and you're right--it will be a constant along the beam unless the beam is a composite of different materials that change along the span.
• "I" is the second area second moment (closely related to second mass moment of inertia) and depends on the dimensions and shape of the beam cross section.  If the shape or dimensions of the beam change along the span then I will have to be a function of position.

Okay!  Lecture over.  Werner, as always you very efficiently answered the question; I'm just in a lecturing mood this morning!  😉

24-Ruby V
(To:Fred_Kohlhepp)

Thanks for lecturing 😉

In fact, I hadn't thought for a moment about what the formulas might mean and analyzed them on a purely formal level. Admittedly, I have no competence in this area, so I'm always happy when someone with the relevant expertise looks over it again.

3-Visitor
(To:Werner_E)

Ok, so it is still telling me that the variables are undefined.

I don't see how this could be the case.

24-Ruby V
(To:PH_9740325)

This is probably because you still have defined E:=E(x) and so you overwrite the variable E (which is used in the integral) with the function of the same name.

Either delete the definition of E(x) as I did or use E(xi) in the integral.

If thats not the problem, you'll have to attach your modified worksheet

The problem was an error in Primes auto-labelling. Some x and xi were labelled differently (and so were seen as different variables) and also the name "slope" in the integral for y(x) had a different label and the y errenously was labelled as "function" and not as "variable". Wrong autolabelling often occurs in Prime and is very nasty and annoying - most often it occurs when expressions are edited and simply retyping them from scratch often is quicker then looking for which name is labelled wrong.

Another error was that you forgot to add the length unit to the lower limit of the integral for M(x).

Next error was that you typed numeric evaluations (=) after the definition of the functions "slope" and "y". You can't do that - what kind of result do you expect from f(x):=x^2=...? So those equal signs must be deleted.

I also modified the function V(x) (replaced x=l by x>=l in the last if-statement) - reason is that the function should return a value for every possible input x even though you later avoid to call it with valued higher than l.

I attach the working sheet (Prime 6 format).

23-Emerald I
(To:Werner_E)

I need to point out that both of you have run afoul of the "English Units" tribulation.

"lb" is a unit of mass.  We're dealing with forces (lbf)

Attached is Werner's sheet modified (sorry Werner) to correct unit issues (including degrees.)

I only have Express, if opened in full Mathcad it should calculate properly.

24-Ruby V
(To:Fred_Kohlhepp)

Absolutely no need or reason to be sorry, Fred.
Thanks for looking over the sheet and cleaning up the units.

Yes, sheet calculates properly (of course recalc is necessary after opening). Only changes which are left to do are the units in the ordinate placeholders in the plots for V and M.

23-Emerald I
(To:Werner_E)

One last note:  there are ways to avoid programing (so you can get by with Express!

24-Ruby V
(To:Fred_Kohlhepp)

A couple of nested if-functions should do the job in Express, too, but your version sure is more clear.

BTW, can it be that you introduced an error when you posted the last sheet with the fixed units.

I reads Maximize(M(x),x) but it should be just Maximize(M,x)

23-Emerald I
(To:Werner_E)

"

BTW, can it be that you introduced an error when you posted the last sheet with the fixed units.

I reads Maximize(M(x),x) but it should be just Maximize(M,x)"

"Maximize is a Premium function, . . . I was guessing since root requires the function arguments.

24-Ruby V
(To:Fred_Kohlhepp)

@Fred_Kohlhepp wrote:

"

BTW, can it be that you introduced an error when you posted the last sheet with the fixed units.

I reads Maximize(M(x),x) but it should be just Maximize(M,x)"

"Maximize is a Premium function, . . . I was guessing since root requires the function arguments.

Yes, that's right, the syntax in Mathcad isn't always very consistent.

3-Visitor
(To:Werner_E)

TO ALL