SQP algorithm and always honoring constraints
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Does the 'AlwaysHonorConstraints' option for fmincon apply to the inequality constraints in lb and ub, or to all the constraints supplied to fmincon?
I'm trying to estimate the parameters of a nonlinear filtering problem constraining the magnitude of the eigenvalues of a matrix to be less than 1, and on the first iteration it tries a point with unstable eigenvalues. This causes the program to crash.
The first constraint in the function 'c' in the code below is the one that is being violated. It occurs with either the 'sqp' or the 'active-set' algorithms, whether I specify 'AlwaysHonorConstraints' or not. Thanks!
c = @(x) [ max(abs(eig(reshape(x(8:16), 3, 3)))); ...
max(abs(eig([x(2:4)'; 1 0 0; 0 1 0])))] - [1; max(abs(eig(phiStar)))];
ceq = @(x) [];
nonlcon = @(x) deal(c(x), ceq(x));
fminconOptions = optimset('Display', 'iter-detailed', 'Algorithm', 'sqp', ...
'TolX', errTol, 'UseParallel', 'always', 'AlwaysHonorConstraints', 'bounds');
[estAllTheta, ~, ~, ~, lambdaOpt, gradient, hessian] = ...
fmincon(obj, allParams, [], [], [], [], [], [], nonlcon, fminconOptions);
0 commentaires
Réponse acceptée
Matt J
le 27 Août 2013
Modifié(e) : Matt J
le 27 Août 2013
'AlwaysHonorConstraints' only applies to lb and ub. Also, you cannot have max(abs(eig(...))) operations in your constraints, because they render c(x) non-differentiable.
3 commentaires
Matt J
le 28 Août 2013
Modifié(e) : Matt J
le 28 Août 2013
It seems sort of misleading to have an option called 'AlwaysHonorConstraints' that really only applies to some constraints.
I agree. It should be renamed 'AlwaysHonorBoxConstraints'.
Is there any way to enforce nonlinear constraints at each iteration?
The SQP algorithm might abide by nonlinear constraints if you specify a feasible initial point and if you set c(x)=Inf whenever the constraint is violated. SQP has the ability to retry an iteration if it encounters NaN or Inf. However, I think doing this could spoil convergence, especially if the region c(x)=Inf is an open set.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Solver Outputs and Iterative Display dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!