필터 지우기
필터 지우기

Proper implementation and use of fmincon

조회 수: 1 (최근 30일)
Mitesh Farsodia
Mitesh Farsodia 2012년 7월 12일
I need some guidance for this following problem. Where function f is defined as
f= x(1)*x(2)
x(1)= [1 2 3 4]
x(2)= [6 7 8]
Function f needs to be optimized using fmincon such as
fmin < f > fmax
My concern is how should I set or define constraint for given range of inputs {x(1) & x(2)}
I appreciate your time and help on this.
Thanks

답변 (2개)

Matt Kindig
Matt Kindig 2012년 7월 12일
Hi Mitesh,
I'm confused as to your problem formulation. The x(1)=[1 2 3 4] and x(2)=[6 7 8] are not valid MATLAB. What does this values indicate? Also, what are fmin and fmax?
When you save you have a given range of inputs {x(1) & x(2)}, what does that mean? Do you mean that x(1) and x(2) have upper and/or lower bounds?
Please clarify for us.
Thanks
  댓글 수: 1
Mitesh Farsodia
Mitesh Farsodia 2012년 7월 12일
Hi Matt,
Thanks for the follow up and sorry for creating the confusions;
x(1) and x(2) are the two input variables which are predefined.
- When I say x(1)=[1 2 3 4], it means range of first variable is limited or in another way I have limited number of input variables. Instead of x(1)= [1 2 3 4] it could be x(1)= [10 22 14 56]
- fmin and fmax just the lower and upper bounds on final result of function f. for example 4 < f > 20, where fmin =4 and fmax =20
Regards Mitesh

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


Richard Brown
Richard Brown 2012년 7월 13일
I presume [1 2 3 4] and [6 7 8] are sets of possible values for x1 and x2. If your problem is only small, then you can use brute force
[X1, X2] = meshgrid([1 2 3 4], [6 7 8]);
F = X1 .* X2;
I = find(F > fmin & F < fmax);
[minval, j] = min(F(I));
minidx = I(j);
  댓글 수: 1
Mitesh Farsodia
Mitesh Farsodia 2012년 7월 13일
Hi Richard,
Actually there are multiple inputs and my objective is to optimize the function for given sets of inputs. Final value of function is constrained to some fix value. Is it possible to frame this problem in optimtool or in fmincon?
Regards Mitesh

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

카테고리

Help CenterFile Exchange에서 Get Started with Optimization Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by