SQP algorithm and always honoring constraints
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuesta aceptada
Matt J
el 27 de Ag. de 2013
Editada: Matt J
el 27 de Ag. de 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 comentarios
Matt J
el 28 de Ag. de 2013
Editada: Matt J
el 28 de Ag. de 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.
Más respuestas (0)
Ver también
Categorías
Más información sobre Solver Outputs and Iterative Display en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!