필터 지우기
필터 지우기

fmincon

조회 수: 8 (최근 30일)
Ashley
Ashley 2011년 7월 18일
If the matrix Aeq in linear constraint Aeq*x=beq have parameters,how can this kind of problem be solved using the function fmincon to obtain the optimized parameters in matrix A?

채택된 답변

Titus Edelhofer
Titus Edelhofer 2011년 7월 20일
Hi Ashley,
do I understand correctly: there are two entries in Aeq which you want to optimize as well? In this case Walter is right: you would need to put into the non linear constraint function (and add to the variables), i.e., your x will be in fact [x_1,...,x_n,A_1,A_2], where A_1 and A_2 do nothing in the objective function, but will be used in the constraint function (something like)
function [c,ceq] = mynonlin(xAll)
x = xAll(1:end-3);
Aeq = [1 xAll(end-1); 0 xAll(end)]; % example
beq = ...;
ceq = Aeq*x-beq;
Titus
  댓글 수: 2
Walter Roberson
Walter Roberson 2011년 7월 21일
Lower bound should be passed in as the 7th parameter of fmincon, lb. Use 0 for lb(K) if the K'th parameter is to have a lower bound of 0. Use -inf as a place holder for any parameter which is not to have a lower bound.
Upper bounds go in to the 8th parameter; use +inf as a placeholder for any parameter which is not to have an upper bound.
Use [] as the vector of bounds if none of the parameters have that kind of bound.
Ashley
Ashley 2011년 7월 21일
Thanks for the information.I have got the result and found an interesting phenomenon:the optimized object dependent on the lower bounds of the two parameters in the matrix.
I greatly appreciate your help!Thans so much!

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

Chirag Gupta
Chirag Gupta 2011년 7월 18일
I would start with typing doc fmincon for the documentation on the function.
It might be easier to use optimtool to get started.
  댓글 수: 1
Ashley
Ashley 2011년 7월 18일
I had checked the help and other materials on the subject but all are telling that the matri A should not be a function with parameters but a matrix with definite value.
And I don't have the optimtool in the start file and I don't know why.I have asked this question at other places but have no answers yet.
Thank you all the same for help!

댓글을 달려면 로그인하십시오.


Walter Roberson
Walter Roberson 2011년 7월 18일
If you need to provide parameters instead of definite matrices for Aeq, then fmincon() is not appropriate for your purposes.
What kind of parametrization are you hoping to do?
  댓글 수: 3
Walter Roberson
Walter Roberson 2011년 7월 19일
Is there a reason this could not be checked in the non-linear constraint function ?
Ashley
Ashley 2011년 7월 20일
What do you mean by saying that?I really can not understand you.
Maybe I didn't describ my problem clearly so you could not understand my problem fully.
My object function is min f(x)=∑(x(i)-x(i+1))^2,which is sum of a series of squares,and the object function only subject to linear constraints Aeq*x=beq,and the matrix Aeq has 2 parameters which I want to optimize.
If fmincon is not appropriate ,which function do you think is better then?
Your help is greatly appreciate!Thanks so much!

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by