Minimize a function with 2 variables and 2 inequality constraints.

조회 수: 5 (최근 30일)
Imanitxka imane
Imanitxka imane 2020년 11월 26일
편집: Stephan 2020년 11월 26일
Hello community,
i have a function with 2 variables to minimize.
f(x,y)= 0.5*(a*x+b*y)+0.5*((x+y)-P)) ^2
0.2 <=x<= 0.6
0<=y<= 0.2
i have to find the values of x, and y
thank you for helping me.

채택된 답변

Stephan
Stephan 2020년 11월 26일
편집: Stephan 2020년 11월 26일
fmincon appears to be the right choice for this. Note that you in fact have 4 constraints. You find examples how to write the code for this under the provided link.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Nonlinear Optimization에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by