24小时热门版块排行榜    

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

iwill1k

铜虫 (小有名气)

[求助] 多元函数求最值

刚接触matlab,我想用matlab求下面函数的最大、最小值以及取最值的时候自变量取值,是一个有4个自变量的函数,自变量都有一定的变化范围。具体函数是:
f=[d*(s+b+d)+0.858*r*r-0.858*(r+d/2)*(r+d/2)]/[s*b-0.858*r*r];其中,2.79≤s≤2.83;7.97≤b≤8.07;0.13≤d≤0.18;0.6≤r≤1.有木有大神帮帮忙知道一下啊
回复此楼

» 猜你喜欢

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

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

iwill1k

铜虫 (小有名气)

引用回帖:
4楼: Originally posted by yqx1985 at 2012-04-09 13:43:37:
楼上正解
给你贴个1stOpt的
Parameters s, b,d,r;
Minimum =f;
Function f=(d*(s+b+d)+0.858*r*r-0.858*(r+d/2)*(r+d/2))/(s*b-0.858*r*r);
====== 结果 ======

迭代数: 18
计算用时(时:分:秒:毫秒):  ...

输出结果里面d=0,但是d没有0这个取值啊。。
5楼2012-04-09 13:55:18
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
查看全部 13 个回答

lijie169

铜虫 (著名写手)

【答案】应助回帖

感谢参与,应助指数 +1
百度你会不?http://www.google.com.hk/#hl=zh- ... rgbld.&bav=on.2,or.r_gc.r_pw.,cf.osb&fp=b7e86341b10bb823&biw=1366&bih=667
2楼2012-04-09 11:43:42
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

dbb627

荣誉版主 (著名写手)

【答案】应助回帖

感谢参与,应助指数 +1
>> f=@(x)(x(3).*(x(1)+x(2)+x(3))+0.858*x(4).*x(4)-0.858*(x(4)+x(3)/2).*(x(4)+x(3)/2))./(x(1).*x(2)-0.858*x(4).*x(4));
  opt=optimset('Algorithm','interior-point');
[X,FVAL,EXITFLAG]= fmincon(f,[2.8 8 0.15 0.8],[],[],[],[],[2.79 7.97 0.13 0.6],[2.83 8.07 0.18 1],[],opt)

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.




X =

    2.8300    8.0700    0.1300    0.9998


FVAL =

    0.0600


EXITFLAG =

     1

>> f1=@(x)-(x(3).*(x(1)+x(2)+x(3))+0.858*x(4).*x(4)-0.858*(x(4)+x(3)/2).*(x(4)+x(3)/2))./(x(1).*x(2)-0.858*x(4).*x(4));
>> [X,FVAL,EXITFLAG]= fmincon(f1,[2.8 8 0.15 0.8],[],[],[],[],[2.79 7.97 0.13 0.6],[2.83 8.07 0.18 1],[],opt)

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.




X =

    2.7900    7.9700    0.1800    0.6000


FVAL =

   -0.0853


EXITFLAG =

     1
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.
3楼2012-04-09 12:35:37
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

yqx1985

木虫 (著名写手)

云中仙

楼上正解
给你贴个1stOpt的
Parameters s[2.79,2.83], b[7.97,8.07],d[0.13,0.18],r[0.6,1];
Minimum =f;
Function f=(d*(s+b+d)+0.858*r*r-0.858*(r+d/2)*(r+d/2))/(s*b-0.858*r*r);
====== 结果 ======

迭代数: 18
计算用时(时:分:秒:毫秒): 00:00:00:94
计算中止原因: 达到收敛判定标准
优化算法: 共扼梯度法 + 通用全局优化法
函数表达式: (d*(s+b+d)+0.858*r*r-0.858*(r+d/2)*(r+d/2))/(s*b-0.858*r*r)
目标函数值(最小): 0
s: 2.82999999999992
b: 8.06833196340274
d: 0
r: 0.830131999171392

====== 计算结束 ======
人面不知何时去,桃花依旧笑春风
4楼2012-04-09 13:43:37
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 347求调剂 +3 mhyqyy 2026-04-06 3/150 2026-04-11 12:19 by zhq0425
[考研] 0854调剂 +11 长弓傲 2026-04-09 12/600 2026-04-11 11:16 by zhq0425
[考研] 0854求调剂 +7 assdll 2026-04-05 7/350 2026-04-11 10:34 by Delta2012
[考研] 22408 352分求调剂0854类 +4 努力的夏末 2026-04-09 4/200 2026-04-11 09:57 by zhq0425
[考研] 机械专368 有去处吗 +4 种大树 2026-04-10 4/200 2026-04-10 15:31 by jiajinhpu
[考研] 求调剂 +16 熊二想上岸 2026-04-04 16/800 2026-04-10 11:24 by may_新宇
[考研] 考研二轮调剂 +8 故人?? 2026-04-09 8/400 2026-04-10 09:44 by 青梅duoduo
[考研] 本科西工大 0856 324求调剂 +10 wysyjs25 2026-04-09 11/550 2026-04-10 08:37 by 5268321
[考研] 生物与医药273求调剂 +18 荔题南墙 2026-04-05 19/950 2026-04-10 08:14 by kangsm
[考研] 初试分332,一志愿报考西北工业大学, +11 故人?? 2026-04-09 11/550 2026-04-09 21:54 by JineShine
[考研] 化学工程与技术专业一志愿哈工程 291分B区 国家级大创负责人 有一作论文 +13 Emmy~ 2026-04-09 13/650 2026-04-09 14:47 by only周
[考研] 086000生物与医药调剂 +7 awwwwwooooo 2026-04-09 7/350 2026-04-09 13:31 by 北极159263
[考研] 材料专硕322 +14 哈哈哈吼吼吼哈 2026-04-05 14/700 2026-04-09 13:25 by 5268321
[考研] 一志愿西南大学生物学学硕344 求生物学相关调剂/生物与医药 +7 超人不会飞@ 2026-04-08 7/350 2026-04-09 09:35 by gong120082
[考研] 考研求调剂 +4 雯??? 2026-04-08 4/200 2026-04-08 21:44 by 土木硕士招生
[考研] 264求调剂 +11 麦小叮当 2026-04-07 11/550 2026-04-08 16:05 by 一只好果子?
[考研] 331求调剂 +5 张元一 2026-04-07 6/300 2026-04-07 22:13 by hemengdong
[考研] 22408 调剂材料 +7 我叫ez 2026-04-06 8/400 2026-04-07 17:12 by 蓝云思雨
[考研] 材料求调剂 +18 一样YWY 2026-04-05 18/900 2026-04-07 15:49 by dxlg
[考研] 313求调剂 +3 海日海日 2026-04-04 3/150 2026-04-05 07:48 by 544594351
信息提示
请填处理意见