Optimization nonlinear function with several variable
조회 수: 12 (최근 30일)
이전 댓글 표시
i have nonlinear function
and the constraint
have lower and upper boundary.
f(x,y,z)
0<=x<=2 , 0<=y<=1, -1<=z<=1
i want to optimize this function to find the max value. define g(x,y,z)=-f(x,y,z) since we want to find the max. How to use the fminsearch/fmincon on this fucntion in MATLAB?
댓글 수: 0
채택된 답변
Walter Roberson
2022년 3월 14일
A = []; b = [];
Aeq = []; beq = [];
lb = [0 0 -1];
ub = [2 1 1];
nonlcon = [];
g = @(xyz) -f(xyz(1), xyz(2), xyz(3));
[bestxyz, fval] = fmincon(g, A, b, Aeq, beq, lb, ub, nonlcon);
댓글 수: 3
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Nonlinear Optimization에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!