matlab 非线性规划问题

来源:百度知道 编辑:UC知道 时间:2024/09/19 16:13:19
请大家帮帮忙,谢谢啊!

百度 HI 我
帮你解决

一看就是无解的题:
x1,x2,x3>=0
-x1+x2-x3>=20,x2最小是20
而3x1+2x2<=30,即使x1=0,40也不会小于30。

再检查一下方程吧。

fun=@(x) -5*x(1)^2-4*x(2)^3-6*x(3)
x0=[1 1 1]
A=[1 -1 1;3 2 4;3 2 0;-1 0 0;0 -1 0;0 0 -1];B=[-20;42;30;0;0;0];

[X,FVAL,EXITFLAG] = fmincon(fun,x0,A,B)

结果:
Warning: Trust-region-reflective method does not currently solve this type of problem,
using active-set (line search) instead.
> In fmincon at 422
In try29 at 5
Optimization terminated: no feasible solution found. Magnitude of search
direction less than 2*options.TolX but constraints are not satisfied.

X =

-0.7107 17.3474 -0.7107

FVAL =

-2.0880e+004

EXITFLAG =

-2