Skip to main content
1-Visitor
February 14, 2013
Solved

Having problem with constrained minimization

  • February 14, 2013
  • 2 replies
  • 1792 views

I am trying to solve a constrained minimization problem here. I traced values of constraints and objective function during iterations and found that the values are not changing at all. Even if I supply the correct solution as an initial guess, MathCAD keeps iterating. Please help.

Best answer by RichardJ

You have a couple of problems. As Werner notes, one is that the eta function is implemented as a solve block, so that solve block has to be executed for every iteration of the minimize solve block. To make matters worse, you call the eta function inside summations in the Q function, and those are loops. You then call the Q function inside a summation, i.e. another loop, in the Err function. So you have an iterative solve block inside a loop, wihch is inside another loop, which is called by an iterative solve block. Fortunately, it is possible to rewrite the Q and Err functions to massively reduce the number of times the eta function has to be called.

Your other problem is that your problem looks like it's very badly conditioned. I think your objective function is very flat, so the solver wanders around a lot trying to find the minimum. This means a lot of iterations, but worse is that it makes it very sensitive to the guess values.

The attached worksheet converges to a solution in a reasonable time (although it's not fast!). To get a better solution you will have to play with the guess values and convergence tolerance though.

2 replies

25-Diamond I
February 15, 2013

Sanjay Joshi schrieb:

I am trying to solve a constrained minimization problem here. I traced values of constraints and objective function during iterations and found that the values are not changing at all. Even if I supply the correct solution as an initial guess, MathCAD keeps iterating. Please help.

I guess the problem is, that Mathcad runs out of memory after a rather long time, right?.

I am not sure, but i could imagine that this is due to the fact, that in your last Minimize solve block the constraint fuctions C and the errorfunction err makes use of the function Eta, which itself is implemented as a solve block. That way the first solve block gets called very, very often which could be the cause for that over consumption of time and memory.

I guess it would help If you would find a way to define Eta differently (which would be hard as you cannot symbolically solve for it).

Sorry, no solution.

RichardJ19-TanzaniteAnswer
19-Tanzanite
February 15, 2013

You have a couple of problems. As Werner notes, one is that the eta function is implemented as a solve block, so that solve block has to be executed for every iteration of the minimize solve block. To make matters worse, you call the eta function inside summations in the Q function, and those are loops. You then call the Q function inside a summation, i.e. another loop, in the Err function. So you have an iterative solve block inside a loop, wihch is inside another loop, which is called by an iterative solve block. Fortunately, it is possible to rewrite the Q and Err functions to massively reduce the number of times the eta function has to be called.

Your other problem is that your problem looks like it's very badly conditioned. I think your objective function is very flat, so the solver wanders around a lot trying to find the minimum. This means a lot of iterations, but worse is that it makes it very sensitive to the guess values.

The attached worksheet converges to a solution in a reasonable time (although it's not fast!). To get a better solution you will have to play with the guess values and convergence tolerance though.

1-Visitor
February 18, 2013

Thanks a lot, Richard. Your reorganization of the calculations does bring down solution time significantly. However the main issue is, as you mentioned, the flatness of the objective function and the resulting sensitivity. I am implementing the procedure given in an old paper; I am trying to do it exactly the way the author proposed it.

Thanks again for your help.

Regards,

Sanjay