楼主: T-back
10102 3

[问答] 请教如何用Matlab求解一个约束优化问题 [推广有奖]

  • 1关注
  • 0粉丝

大专生

65%

还不是VIP/贵宾

-

威望
0
论坛币
209 个
通用积分
0
学术水平
5 点
热心指数
5 点
信用等级
5 点
经验
583 点
帖子
34
精华
0
在线时间
66 小时
注册时间
2010-4-10
最后登录
2014-6-27

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
min f(x1,x2,x3)=x1^2+x2^2+x3^2+x1*x2+x1*x3+x2*x3
s.t.: x1+x2+x3=1 , x1>=0,x2>=0,x3>=0
请问各位,此约束问题如何用Matlab编程实现,谢谢帮助!
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:MATLAB atlab matla Mat Lab 请教 MATLAB 求解

沙发
qibbxxt 发表于 2011-4-12 11:04:46 |只看作者 |坛友微信交流群
  1. >> f=@(x1,x2,x3)x1.^2+x2.^2+x3.^2+x1.*x2+x1.*x3+x2.*x3;
  2. >> Aeq =[1,1,1];beq = 1;
  3. >> x = fmincon(@(x)f(x(1),x(2),x(3)),[0.4,0.3,0.3],[],[],Aeq,beq,[0 0 0 ],[])
  4. Warning: Trust-region-reflective algorithm does not solve this type of problem, using active-set
  5. algorithm. You could also try the interior-point or sqp algorithms: set the Algorithm option to
  6. 'interior-point' or 'sqp' and rerun. For more help, see Choosing the Algorithm in the documentation.
  7. > In fmincon at 472

  8. Local minimum found that satisfies the constraints.

  9. Optimization completed because the objective function is non-decreasing in
  10. feasible directions, to within the default value of the function tolerance,
  11. and constraints were satisfied to within the default value of the constraint tolerance.

  12. <stopping criteria details>

  13. No active inequalities.

  14. x =

  15.     0.3333    0.3333    0.3333
复制代码
已有 1 人评分学术水平 收起 理由
liuxin9023 + 1 分析的有道理

总评分: 学术水平 + 1   查看全部评分

使用道具

藤椅
T-back 发表于 2011-4-12 23:03:30 |只看作者 |坛友微信交流群
2# qibbxxt
谢谢!

使用道具

板凳
liyyjlz 发表于 2017-9-27 22:40:23 |只看作者 |坛友微信交流群
请问楼主这个问题如何解决的啊?我也遇到类似的问题

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-28 20:54