Using fmincon with multiple inequality constraints

8 ビュー (過去 30 日間)
Garetty
Garetty 2020 年 11 月 2 日
編集済み: Matt J 2020 年 11 月 4 日
I'm not really sure if I'm asking this correctly, but I'm trying to minimize this function given the constraints using fmincon:
  1 件のコメント
Michael
Michael 2020 年 11 月 2 日
Something to note is that your function seems to be a function of both x and y. Because fmincon is designed for functions of x, you will need to write these as a function of x, and solve for variable values of y. This means you can iterate through different guesses of y, and try to plot outputs to get a good approximation, and then look more carefully at a local optimum.
Hope that helps, but fmincon is limited to functions of x exclusively,
Michael

サインインしてコメントする。

採用された回答

Alan Weiss
Alan Weiss 2020 年 11 月 3 日
You can easily formulate these constraint for fmincon using the recipes in Write Constraints. Your first two constraints, and , can be written as Nonlinear Constraints. The third, , is a Linear Constraint. The constraints and are best expressed as Bound Constraints.
And you need to keep in mind that fmincon insists that you formulate all of your functions in terms of one variable, x, so you would have x = x(1) and y = x(2). See Writing Scalar Objective Functions.
Alan Weiss
MATLAB mathematical toolbox documentation
  1 件のコメント
Matt J
Matt J 2020 年 11 月 3 日
編集済み: Matt J 2020 年 11 月 4 日
Your first two constraints, g1 and g2, can be written as Nonlinear Constraints. The third, g3, is a Linear Constraint.
However, I recommend making the change of variables s=1e5*x*y, t=y so that the problem can be re-written in terms of a convex objective and convex constraints as below. This transforms g3 into a non-linear constraint, while g2 becomes a simple lower bound.
f(s,t)=s
g1 = 240/s - t <= 0
g2 = s>=1.125
g3 = t^2 - 2*s <=0
s>=0
t>=0

サインインしてコメントする。

その他の回答 (0 件)

タグ

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by