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

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Mathcad Prime Maximize function

MarcTurcotte
1-Visitor

Mathcad Prime Maximize function

Hi,

I want to use the maximize function on a programmed function list, but I am starting to think it might not be possible to do it..

i want to find the max value (either X so that i will enter it back in the formula, or the max value on the graph).

See the bottom of page two of the script for further explanations.

Thank you very much.

PS: i would also like to know why does the graph acts as steps instead of curves? isn't the M graph supposed to be parabolic?

Thanks

ACCEPTED SOLUTION

Accepted Solutions
wayne
12-Amethyst
(To:MarcTurcotte)

I have added the exact solution to the problem for compairson, and it agrees with numerical calculation of Prime.

You must have something different in the input between Prime and Beam2D

Note that you are using P/c, (force/unit lenght, is that what you are using in Beam 2D?)

View solution in original post

13 REPLIES 13

You need to use the maximize function within a solve block.

Mike

Thanks for the tip.

But it seems that the maximise function gives me some random number instead of the maximum value...

if you change the guess value, the answer will change... ie: x:=100 mm will give 25 mm as being the max value (and M(25) = 0 which is not a maximum), x:=60 mm gives 15 mm... it seems it just divides by four..

Also, the M plot should be parabolic, why isn't it parabolic?

Thanks for your time,

But it seems that the maximise function gives me some random number instead of the maximum value...

if you change the guess value, the answer will change... ie: x:=100 mm will give 25 mm as being the max value (and M(25) = 0 which is not a maximum), x:=60 mm gives 15 mm... it seems it just divides by four..

Like all numeric non-linear solvers, maximize is iterative. It starts at the guess value, and heads "uphill" until it can't get any higher, then stops. Such solvers so not like piecewise functions, or functions with flat areas in them. If you give it a guess of 100mm it takes a few steps, decides it can't find anything higher, and stops. If you give it a guess of 60mm, it takes a few steps and happens to end up at 15, where if it takes more steps it can't find anything higher, so it stops.

Also, the M plot should be parabolic, why isn't it parabolic?

Why would it be parabolic? M1(x), M2(x), and M3(x) are definite integrals with defined limits. As such they return a constant. You do not even need to define them as functions, just M1, M2, and M3 would work.

As an additional note, it's not likely that any function you define in terms of the function V1 will be purely parabolic, because V1 is a piecewise function.

wayne
12-Amethyst
(To:RichardJ)

Adding to Richard's comments

The limits on M(x), the upper limit should be x, not a constent, you program deals with the upper limit.

The moment is the area under the shear, so it is not constent over over the partial uniform load area; but in this area, it will be parabolic segment, out side this area, the shear is constent, so the moment will be linear.

For the correct shape, the maxamize function will work fine. But also note that the maximum occurs when V=0, so you could use this to check, or even just use the roof funciton to find V=0.

I still do not understand why the plot isnt parabolic. You will always get a parabolic moment when doing the analysis graph on a uniformly distributed force.

i have tried it with both Matlab and Beam2d (attached) and i get parabolic moment.

And for the little step just before 11, it should be a slope not a step.

V1(x) = -Ra

then M1(x) = Ra*x+ cte.

it is a x-dependent formula, why does it steps?

then,

V2(x) = P*(x-(a+b) - Ra

it is a function of X, therefore the integral of V2(x), M2(x) should be function of x^2

And as for the maximum function, what i understand is : mathcad is stupid when having constant step values when it comes to finding maximum.

Thanks for your time and help on this.

I still do not understand why the plot isnt parabolic. You will always get a parabolic moment when doing the analysis graph on a uniformly distributed force.

Yes, you will. Since you don't have a parabola that should tell you that you implemented it wrong. Wayne even told you what the error is.

V2(x) = P*(x-(a+b) - Ra

it is a function of X, therefore the integral of V2(x), M2(x) should be function of x^2

The indefinite integral will be a function of x^2. The definite integral is the indefinite integral evaluated between limits. If those limits are constant, then so is the value of the definite integral.

And as for the maximum function, what i understand is : mathcad is stupid when having constant step values when it comes to finding maximum.

The initial step size depends on the scale of the data. As it converges to the maximum the step size changes. In this case it never does more than one or two iterations before stopping though, so all you get is an indication the initial step size.

wayne
12-Amethyst
(To:MarcTurcotte)

You are incorrect!

The moment diagram in you png is correct, but it is only parabolic under the partial lenght uniform load, and linear on either side as it should be and as I indicated.

Mathcad's maxamize function is not stupid, if you have a hoirzontal line, what value of x should it choose, there are an infinite number of correct values? The problem is with your M(x)'s.

As Richard indicated, and I followed up on, your equations for M(x) are constent, because you incorrectly use fixed limits.

Wayne Reid wrote:

The moment diagram in you png is correct, but it is only parabolic under the partial lenght uniform load, and linear on either side as it should be and as I indicated.

Thats what i said. it is constant, then linear slope, and then parabolic, then slope, then constant.

i get what you are saying, but now how do i set the integral to be symbolic instead of defined integral ? Mathcad doesnt allow me to leave the limits undefined.

Thanks for your help

wayne
12-Amethyst
(To:MarcTurcotte)

See attached,

All you need to do is integrate V(x), don't need M1, M2, M3 or the program

RichardJ
19-Tanzanite
(To:wayne)

One additional comment. It's bad practice to use the same variable name for the variable of integration and the variable in the limits. It's confusing, because they are not the same variable even if they look identical. I changed one of them to x'

Thanks to you both.

Why are the units of M(x) 1/N * N * m instead of N * m?

and also,

Beam2D gives me 7.144 N*m , vs mathcad : 2.977 N*m ?

That's gonna be the last question i promise haha

Thanks again for all your help, very appreciate.

wayne
12-Amethyst
(To:MarcTurcotte)

I have added the exact solution to the problem for compairson, and it agrees with numerical calculation of Prime.

You must have something different in the input between Prime and Beam2D

Note that you are using P/c, (force/unit lenght, is that what you are using in Beam 2D?)

wayne
12-Amethyst
(To:RichardJ)

Thanks Richard,

Actually I know that, but Mathcad allows my sloppness, but I agree that it is not good practice.

Wayne

Announcements

Top Tags