fminsearch, problem with option specification

Hello,
I have a vector V. I have an error depending on the components. I want the error to be as lower as possible so I though of using fminsearch.
V = fminsearch(@(V) myerror(V,par_1,par_2,par_3),Vo)
The problem is that I need V1<V2<...<Vn and Vi∈[1,1000](for all i). By the moment, I think there is not possibility to include such conditions with "optimset"
I would appreciate any advice.
Thanks a lot

 채택된 답변

Alan Weiss
Alan Weiss 2014년 5월 14일

0 개 추천

This type of constraint (V1 < V2 < ...) is called a linear constraint. Generally, Optimization Toolbox solvers can include linear constraints by using a constraint matrix of the form
A*x <= b
where
A = [1,-1,0,0,0...
0,1,-1,0,0,...
...
0,0,...,1,-1]
and b is a vector of zeros. The fmincon function can handle this kind of nonlinear problem with linear constraints.
The bounds on the V(i) can be handled by passing lb = ones(size(x0)) and ub = 1000*lb .
Alan Weiss
MATLAB mathematical toolbox documentation

추가 답변 (1개)

질문:

2014년 5월 14일

답변:

2014년 5월 15일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by