正在加载图片...
fval 和其它信息 5.非线性规划有约束极小问题 minf(x),x∈Rn 用命令x= constr(f,x0)。 Examples Find values of x that minimize fx)=xlx2x3, starting at the point x=[10: 10, 10] and subject to the constraints0≤xl+2x2+2x3≤72 x1-2x2-2x3≤0,x1+2x2+2x3≤72, 第一步:编写M文件 function [f, g=myfun(x) f=x(1)*x(2)*x(3) g(1)=x(1)-2*x(2)-2*x(3) g(2)=x(1)+2*x(2)+2*x(3)-72 第二步:求解 在 MATLAB工作窗中键入 xO=[10,10,10] x= - constr( myfun,x0)即可fval = -78.0000 和其它信息。 5.非线性规划有约束极小问题 用命令 x=constr('f ',x0)。 Examples Find values of x that minimize f(x)=-x1x2x3, starting at the point x = [10; 10; 10] and subject to the constraints 0≤x1+2x2+2x3≤72. -x1-2x2-2x3≤0,x1+2x2+2x3≤72, 第一步:编写 M 文件 function [f,g]=myfun(x) f=-x(1)*x(2)*x(3); g(1)=-x(1)-2*x(2)-2*x(3); g(2)=x(1)+2*x(2)+2*x(3)-72; 第二步:求解 在 MATLAB 工作窗中键入 x0=[10,10,10]; x=constr('myfun',x0)即可 g x  0  . . ( ) min ( ), st f x x R n
<<向上翻页
©2008-现在 cucdc.com 高等教育资讯网 版权所有