Using fmincon with multiple inequality constraints

8 次查看(过去 30 天)
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