24小时热门版块排行榜    

查看: 607  |  回复: 3
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖

524633857

木虫 (小有名气)

[求助] 多元函数求最大值

这个不属于前沿,属于研究方法,注意发贴分类,已经帮你修改了
方程y=94.011+3.886*x(1)+1.842*x(2)+3.052*x(3)+3.063*x(4)-2.255*x(1)^2-0.773*x(2)^2-0.748*x(3)^2-3.079*x(4)^2-1.802*x(1)*x(2)-1.526*x(1)*x(3)+1.180*x(1)*x(4)-2.246*x(2)*x(3)-1.102*x(2)*x(4)-1.146*x(3)*x(4)  在区间【2,2】,y<100 条件下的最大值是多少,高手能不能帮忙求一下,直接给出x和y的值分别是多少?(

[ Last edited by dbb627 on 2011-10-16 at 00:01 ]
回复此楼

» 猜你喜欢

» 本主题相关价值贴推荐,对您同样有帮助:

已阅   关注TA 给TA发消息 送TA红花 TA的回帖

524633857

木虫 (小有名气)

送鲜花一朵
引用回帖:
2楼: Originally posted by dbb627 at 2011-10-13 14:50:07:
[code] function aa
y=@(x)94.011+3.886*x(1)+1.842*x(2)+3.052*x(3)+3.063*x(4)...
    -2.255*x(1)^2-0.773*x(2)^2-0.748*x(3)^2-3.079*x(4)^2-...
    1.802*x(1)*x(2)-1.526*x(1)*x(3)+1.180*x(1)*x(4)-2. ...

谢谢[X,FVAL,EXITFLAG] =fmincon(y1,[1 1 0.5 1],[],[],[],[],[-2 -2 -2 -2],[2 2 2 2],@(x)con(x))
请问,[1 1 0.5 1]的作用是什么
3楼2011-10-13 16:01:33
已阅   关注TA 给TA发消息 送TA红花 TA的回帖
查看全部 4 个回答

dbb627

荣誉版主 (著名写手)

【答案】应助回帖

524633857(金币+20): 2011-10-13 15:58:56
cenwanglai(计算强帖-1): 2011-10-13 17:09:05
cenwanglai(计算强帖+1): 2011-10-13 17:09:26
CODE:
function aa
y=@(x)94.011+3.886*x(1)+1.842*x(2)+3.052*x(3)+3.063*x(4)...
    -2.255*x(1)^2-0.773*x(2)^2-0.748*x(3)^2-3.079*x(4)^2-...
    1.802*x(1)*x(2)-1.526*x(1)*x(3)+1.180*x(1)*x(4)-2.246*x(2)*x(3)-1.102*x(2)*x(4)-1.146*x(3)*x(4);
y1=@(x)(-(94.011+3.886*x(1)+1.842*x(2)+3.052*x(3)+3.063*x(4)...
    -2.255*x(1).^2-0.773*x(2).^2-0.748*x(3).^2-3.079*x(4).^2-...
    1.802*x(1).*x(2)-1.526*x(1).*x(3)+1.180*x(1).*x(4)-2.246*x(2).*x(3)-1.102*x(2).*x(4)-1.146*x(3).*x(4))+100).^2;
[X,FVAL,EXITFLAG] =fmincon(y1,[1 1 0.5 1],[],[],[],[],[-2 -2 -2 -2],[2 2 2 2],@(x)con(x))
feval(y,X)

function [c,cq]=con(x)
c=94.011+3.886*x(1)+1.842*x(2)+3.052*x(3)+3.063*x(4)...
    -2.255*x(1)^2-0.773*x(2)^2-0.748*x(3)^2-3.079*x(4)^2-...
    1.802*x(1)*x(2)-1.526*x(1)*x(3)+1.180*x(1)*x(4)-2.246*x(2)*x(3)-1.102*x(2)*x(4)-1.146*x(3)*x(4)-100;
cq=[];

结果
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
  In AAAA at 8

Local minimum possible. Constraints satisfied.

fmincon stopped because the predicted change in the objective function
is less than the default value of the function tolerance and constraints
were satisfied to within the default value of the constraint tolerance.



Active inequalities (to within options.TolCon = 1e-006):
  lower      upper     ineqlin   ineqnonlin
    2                                 

X =

    1.5853   -2.0000    0.7306    0.9674


FVAL =

  2.7821e-009


EXITFLAG =

     5


ans =

   99.9999

» 本帖已获得的红花(最新10朵)

The more you learn, the more you know, the more you know, and the more you forget. The more you forget, the less you know. So why bother to learn.
2楼2011-10-13 14:50:07
已阅   关注TA 给TA发消息 送TA红花 TA的回帖
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[基金申请] FileCode能看出啥? +8 要乐观耀哥 2026-08-10 21/1050 2026-08-12 16:08 by 云上清扬
[基金申请] 长年满屏的广告,版主太不责任了。基金也等的急 +4 gltch 2026-08-12 4/200 2026-08-12 16:08 by eulota
[基金申请] 应该是93bebmhtak前后十一个字符比较关键 +22 Lanmanbaby 2026-08-09 35/1750 2026-08-12 14:38 by sdfapple719
[基金申请] 奇怪,两个人的filecode固定段从头到尾一模一样 +7 布布和一二 2026-08-10 10/500 2026-08-12 09:12 by 布布和一二
[基金申请] 综述论文作为代表作会不会影响评审专家的印象分? +11 yufeiwaner 2026-08-09 13/650 2026-08-12 08:17 by yufeiwaner
[基金申请] 小木虫上这么多卖论文的,真有人买论文么?感觉没必要啊 +8 Tide man 2026-08-10 9/450 2026-08-11 20:39 by beefly
[基金申请] 听说今天filecode变了 +26 布布和一二 2026-08-06 49/2450 2026-08-11 13:18 by WH3796
[基金申请] 关于代码变化问题,想知道的进来 +17 且听虎啸 2026-08-07 24/1200 2026-08-10 18:35 by zhangduo2008
[基金申请] 静等基金结果 +5 gjjjzhong 2026-08-10 16/800 2026-08-10 17:19 by Tide man
[基金申请] 2026国自然放榜时间 +9 布布和一二 2026-08-08 9/450 2026-08-10 11:22 by xxxx2020
[基金申请] 这样的filecode谁见过 +11 布布和一二 2026-08-08 22/1100 2026-08-10 11:10 by wmfsnow
[基金申请] 面上项目filecode邪修 +5 西山十月 2026-08-09 7/350 2026-08-10 07:32 by 仁砚薪传
[基金申请] fileCode有新解读? +10 Tide man 2026-08-08 18/900 2026-08-09 12:55 by 仁砚薪传
[基金申请] 关于filecode,很负责任的告诉大家 +6 爱看书的可乐 2026-08-08 7/350 2026-08-08 22:13 by a_niu
[基金申请] 关于豆爷回答的JTJC与%2F数量 +5 yang182083 2026-08-06 7/350 2026-08-08 18:29 by zhanghaozhu
[基金申请] 国基金的申报应该改成非等额制,评价高的钱多评价低的钱少,但是增加资助率 +7 a089 2026-08-07 7/350 2026-08-08 18:05 by gltch
[基金申请] 化学口download_prp&amp;fileCode的固定段好像这几天一直没变,有变的大神么? +3 Tide man 2026-08-07 4/200 2026-08-07 22:39 by Tide man
[基金申请] 固定端突然变了,今天 +6 archvillain 2026-08-06 10/500 2026-08-07 16:03 by 医学老男孩
[基金申请] filecode变化情况 +6 布布和一二 2026-08-07 22/1100 2026-08-07 14:45 by 且听虎啸
[基金申请] 大家散了吧,后缀研究没有意义,别浪费时间了,过好目前的每一天,不要焦虑 +5 Tide man 2026-08-06 7/350 2026-08-07 13:11 by 医学老男孩
信息提示
请填处理意见