Skip to main content
24-Ruby IV
October 13, 2013
Solved

One optimization problem

  • October 13, 2013
  • 4 replies
  • 12310 views

Do you know one symbolic solution of this problem?

See please one numerical solution in attach (M15):

Max-Box-Volume.png

PS At A=B x=A/6

Best answer by ValeryOchkov

Thanks, Alan.

To create one program for optimization (Minimize, Maximize etc) - it is one (a little) haft of problem. The second (main) haft is to find functions for the testing of this programs

I think/hope that my simple function is one good test for it!

4 replies

24-Ruby IV
October 13, 2013

First guess - x1=x2=x3=x4

Max-Box-Volume-2.png

24-Ruby IV
October 14, 2013

Sorry, I cannot correct solve this problem numerical

In M15 and P3 - see please the first picture, this picture and attach.

Max-Box-Volume-3.png

25-Diamond I
October 14, 2013

Set up four different variables to solve for: x ... the smallest of the four and you may say its at the side A - that way changing A and B could (not in this case) yield a different result. The other three variables are the differences Delta1 .. Delta3. So wie have V(A,B,x,delta1..delta3):=(A-2x-delta1)*(B-2x-delta2-delta3)*x

That way you get rid of the min() function which is the problem.

25-Diamond I
October 15, 2013

OK, sometimes I need a little longer to figure it out what is behind a problem.

In case of Valery's 4 variable extreme value problem (which in reality is only a one variable problem) the various objective function would represent a 4dimensional surface in 5-domensional space. This is a little bit difficult for the imagination, so I reduced the problem to just two parameters. I assume that the bent-over lateral surfaces of the box on opposite sides are equal. That way we can visualize the objective functions as 2D-surfaces in 3D space - a bit more comfortable.

The problems that have so far emerged in this thread are:

1) Why does Maximize fail with Valery's objective function using the min() function?

2) Why do the partial derivatives don't evaluate to zero at the solution point

3) Why do we not arrive at the solution by setting the partial derivatives to zero, neither with Valery's, nor with Alan's objective function.

I played around and the attached sheet emerged. As far as I am concerned the answers to the questions are:

1) because min() introduces a discontinuity in the derivation of the objective function, there would not be a unique derivative in the area of the solution and so the CG algorithm, which uses the gradients to approach the solutions, fails

2) & 3) because the solution is not a local maximum of a continous differentiable function.

Any suggestions?

Here the 2D/3D objective functions of Valery and Alan


of1.pngof2.png

24-Ruby IV
October 15, 2013

2D variant of this problem:

2D.png

24-Ruby IV
October 15, 2013

Fractal variant (A=B=1) of this problem - one, five and n boxes from one quadrate sheet:

http://twt.mpei.ac.ru/ochkov/Mathcad_12/3_09_5_Box.png

24-Ruby IV
October 15, 2013

This "quadrate" problem in a N-field - see the picture.

Do you have any solution for a "non quadrate" problem with the function v(x, A, B, n)?

boxN.png

25-Diamond I
October 15, 2013

If you think in n dimensions and want to go from the hypercube to a hypercuboid (? I am absolutely not sure about the wording here), we would not only have A and B but rather A1 ... An !

And as the discussion has shown here, we can not be sure that the solution would be a local maximum of the objective function.

Good luck!

BTW, you could try to constrain x<A/2 with assume to get rid of the unwanted "solutions".

15.10.png


25-Diamond I
October 16, 2013

As we just traced the built-in maximize() algorithm - a question for those who know:

Whats the best way way to trace an internal algorithm? I can think of three ways and have sucessfully implemented two of them (and am not that happy with). That is using Mathcad's trace and then copy and paste 😞 or let Mathcad write the data to a file in every single iteration step (which I did in the file above).

Third idea (and maybe best way?) would be the use of a scripted component which collects the data during iteration - not sure about the implementation, though.

Any other ideas?

PS: @Valery: How was it done in the file you posted the screenshot of?

24-Ruby IV
October 16, 2013

Werner Exinger wrote:

PS: @Valery: How was it done in the file you posted the screenshot of?

Copy and paste

25-Diamond I
October 16, 2013

PS: @Valery: How was it done in the file you posted the screenshot of?

Copy and paste

So that I am clear - you had second objective function f(x) in the collapsed area which had a trace-command or used a solve block with a dummy function inside there and then copied the data from the debug window?