打开matlab2014a程序,在主工具栏找到应用程序一栏,打开optimization选项。
问题输入
在optimization程序中,首先根据不同的问题类型选择不同的模型,同时输入约束等。
选择优化程序运行的条件
在最中间的一栏中添加优化程序运行的条件,如优化截止的标准,画图的要求等等。
开始运算
点击start即可实现优化程序的运行,在图示的框中即可出现运行结果。
5
查看帮助文件
在程序的最右边,是一个帮助文件,如果你有什么疑问,可以直接在帮助文件中查找。
%约束条件
function[c,ceq]=nonlcon(x)
c(1)=(8634x(1))/x(2)-x(3)^3;
c(2)=x(2)+x(2)/x(1)-120;
ceq=[];
---------------
>> funn=@(x)x(2)x(3)+(x(2)x(3))/x(1);
>> vlb=[025;18;15];%x1,x2,x3的下限值
vub=[1;100;6];%x1,x2,x3的上限值
x0=[09;50;25];%x1,x2,x3的初始值
[x,fval,exitflagn] = fmincon(funn,x0,[],[],[],[],vlb,vub,@nonlcon)
Warning: Trust-region-reflective algorithm does not solve this type of problem,
using active-set algorithm You could also try the interior-point or sqp
algorithms: set the Algorithm option to 'interior-point' or 'sqp' and rerun
For more help, see Choosing the Algorithm in the documentation
> In fmincon at 472
Local minimum found that satisfies the constraints
Optimization completed because the objective function is non-decreasing in
feasible directions, to within the default value of the function tolerance,
and constraints were satisfied to within the default value of the constraint tolerance
<stopping criteria details>
Active inequalities (to within optionsTolCon = 1e-006):
lower upper ineqlin ineqnonlin
2 1 1
x =
10000
180000
36334
fval =
1308024
exitflagn =
1
>>
以上就是关于怎样运用matlab解决最优化问题全部的内容,包括:怎样运用matlab解决最优化问题、matlab的非线性优化问题,我自己编了一下,有问题,我把我的程序发上来,希望大虾帮我看下,谢了、等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)