Skip to main content
14-Alexandrite
February 6, 2019
Solved

Optimization problem using minimize function

  • February 6, 2019
  • 2 replies
  • 21689 views

Hello everyone!

This is my first post, I'm glad to be here. Let's cut to the chase. 

 

I have created  an objective function  which has 5 variables. I gave 5 constraints. Probably a typical problem. But when i try to optimize it with the minimize function mathcad spent all night calculating it and it did not come up with anything. I am new to this, so probably missing the point 🙂 I will be thankful for any piece of advice.opt.png

Best answer by Werner_E

OK, as promised here is my speeded up version.

Hope the my first interpretation of the function Y is the one you need - otherwise we would have to invest some more work to make the solve block respect ALL constraints (if possible at all).

I also include a pdf-print of the sheet.

As you see your original Y-function evaluates in about 12 seconds. The 51 sec of what I wrote earlier came about the fact that my machine was busy with some video recoding which eat up nearly all my CPU power 😉

So your reduction from 583 points to somewhat over 400 seems not to be necessary at all.

Note that because of the various use of the time() function the sheet will recalculate every time before printing or saving which is annoying. You might want to get rid of tall the unnecessary regions as soon as possible.

 

2 replies

24-Ruby IV
February 6, 2019

Attach please Mathcad-sheet!

Ans second!

Call please your objective function OF after the giving guess values of aa, ab etc!

Use please the Minimize function without constrains and than in put constrains step-by-step!

Good luck!

Murarz14-AlexandriteAuthor
14-Alexandrite
February 6, 2019

Thanks for the reply! I have enclosed the mathcad sheet with excel files, since it reads directly from them. I switched OF function with exact values as you said, but still it doesn't wish to calculate 😄

25-Diamond I
February 6, 2019

Have you ever tried to call your function OF just ONE TIME?

I did, using your initial values, and after e few minutes it was still calculating and I cancelled the operation.

When trying to minimize, Mathcads algorithm would change your five arguments very often ever so slightly and will then call OF every time. If even one single call of OF takes that long, you can't expect the solve block to finish within a reasonable time.

The first thing to do is to look closer at the objective function if you can find a way to avoid that many nested loops which cost that many time in calculation.

Debugging of your sheet (if someone would be willing to take the time) is made more difficult and hindered by the fact, that the definition of some vital variables (Vol11, T0,..) is not visible as its hidden in a locked area.

 

Werner_E25-Diamond IAnswer
25-Diamond I
February 6, 2019

OK, as promised here is my speeded up version.

Hope the my first interpretation of the function Y is the one you need - otherwise we would have to invest some more work to make the solve block respect ALL constraints (if possible at all).

I also include a pdf-print of the sheet.

As you see your original Y-function evaluates in about 12 seconds. The 51 sec of what I wrote earlier came about the fact that my machine was busy with some video recoding which eat up nearly all my CPU power 😉

So your reduction from 583 points to somewhat over 400 seems not to be necessary at all.

Note that because of the various use of the time() function the sheet will recalculate every time before printing or saving which is annoying. You might want to get rid of tall the unnecessary regions as soon as possible.

 

Murarz14-AlexandriteAuthor
14-Alexandrite
February 6, 2019

I don't know what to say, thank you very much 🙂

This the relation I had in mind

25-Diamond I
February 6, 2019

This does not help as its bad math. "t" is used in three different meanings (two different variables of integration in nested integrals and then as limit of integration).

Its not clear which of the two expressions shown in the attached picture you mean. I guess the first one, but I can't be sure.