Which condition must be satisfied so that three real numbers are all positive or negative? (fmincon related)
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello all,
let me go straight to the question: I have three values, which are the eigenvalues of a 3 x 3 matrix (calculated symbolically, so these are pretty large expressions) and I can't find a numerical relation between the three to ensure they are all positive or negative. Once I have this expression I intend to use as a nonlinear constrain to an optimisation problem.
0 Kommentare
Antworten (1)
John D'Errico
am 25 Apr. 2018
For real vector X (of any length)
all(X<0) || all(X>0)
Having said that, this is NOT a valid constraint for fmincon. It will result in a search space that is split into two discontiguous sub-domains.
4 Kommentare
John D'Errico
am 27 Apr. 2018
Bearbeitet: John D'Errico
am 27 Apr. 2018
If you constrain a system, then IF the constraints are active, the solver cannot find as good a solution as it would have had there been no constraints. So your goodness of fit must generally decrease by some amount IF the constraints were active.
How can this surprise you in the very least amount? Effectively, you just told fmincon, "DON'T GO THERE!", even though fmincon sniffled, replying "But I want to go there. If you want the best solution in terms of the objective being smaller, I need to go there." Highly anthropomorphized of course.
There are circumstances where this is not the case of course, if there are multiple solutions, or if the constraint is active, but the solution found would have been at the same spot even without a constraint. (That would be a rare case.) fmincon does not assure you that it will always find the globally optimal solution. And when you introduce constraints into the problem, it is no longer the same problem.
So is fmincon "messing" with the solution? Sigh, no, YOU are messing with the solution. You were the one who changed the problem by introducing constraints. If you disallow fmincon from going into certain regions of the search space, preventing solutions from being found that would have otherwise been allowed, then the result will often be less "good". At the same time, if that part of the search space creates non-meaningful solutions, then the bad solution was already not "good".
Siehe auch
Kategorien
Mehr zu Systems of Nonlinear Equations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!