Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Minimize function

Status
Not open for further replies.

mohammed43

Civil/Environmental
May 5, 2012
49
Hello,

Can someone please help me in using the minimize function. In the attached file (Mathcad 15), iam getting variable undefined while using the minimize function.
Please see the bottom of the attached worksheet for the minimize function(Highlighted in Green). Also, I have a very long equation with the "OR" operators and I want to split the equation in to next line.(shown in attached worksheet).I know that "Ctrl+" works with the "+" operator.


Thanks for your help!!
 
 http://files.engineering.com/getfile.aspx?folder=01af5465-db40-4b7c-9447-a5324219df1c&file=PlateGirderDesignr.xmcd
Replies continue below

Recommended for you

I can't open Matcad 15, save it in 11 and re-post it and I'll try.
 
ad Minimize: You have to provide units in your fours constraints to make it work --> 12in<d<48in, etc.

ad Case determination: You sure have to check your syntax! You can't write if (x="one" OR "two" OR "five") but you must write if (x="one" OR x="two" OR x="five")
Furthermore you must check your logic. It seems you used some superfluous constraints (Web.Type can't be "Compact" anymore after the second otherwise in the "CaseF4.0" line. Do you expect any of the two variables to hold any other string but the three mentioned in the routine? If no, CaseF5 sure would never be possible, so omit it. If yes, is it just to cope with the case of typo made by the user? Then the chack for a valid input should be made right at the top of the page. It may also be a good idea to use a drop down menu for the user to chose Web.type and Flan.type, that way avoiding invalid assignments.
You cannot split the logical constraints like you can do with Ctrl-+ for a sum, but I am pretty sure you can make those expressions much shorter as soon as you get it straight what you really want. Maybe it helps if you paint a small 3x3 matrix with all combinations of your two type variables, writing in the case the respective combination should yield.

 
Thanks rmixzz!
If I change the constrains to "in" as suggested the minimum function works but when I change the constarin URatio to lower than the initially calculated value before optimization, the minimum function doesnt work..
Please see the attached worksheet.
Iam trying to write a minimum function to minimize the weight with Unity ratio as one of the constarins as defined by the user..

Thanks
 
 http://files.engineering.com/getfile.aspx?folder=7dcadc81-452b-4c7e-b8bb-719c00fb317e&file=plategirder1.xmcd
The effect is easily explained. Thats because your Uratio never changes. You made it a function of the four variables, but those arguments never are used in the calculation. Give it a try - call Uratio with different arguments and you will always get the same result. That way you can't demand Minimize to make it any smaller and so the solve block fails (with the usual wrong error message).
You have to turn ALL variables M???, etc., which are used in the calculation of Uratio and which should depend on one or more of those 4 arguments into functions to make it work.

Ad your routine to get "Case". I am not sure if your routine really does what you want it to do, but find attached a much smaller, equivalent routine.
 
 http://files.engineering.com/getfile.aspx?folder=6375cfa4-ad5d-4fe8-867d-5bd1f0b5f804&file=getCase.xmcdz
Thanks!
The routine you used is very intersting.. Iam abeginer in MathCad. Infact I started MathCad 2 months back.
also, can you tell me how to round of my minimize function variable to 1/8inch. Is that doeable?

Thanks for your time!

 
can you tell me how to round of my minimize function variable to 1/8inch. Is that doeable?
I guess the Round() function (note the capital R) will do the job.

Round(length_in_any_unit, 1/8 in)=

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor