24小时热门版块排行榜    

北京石油化工学院2026年研究生招生接收调剂公告
查看: 1849  |  回复: 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

铜虫 (小有名气)

引用回帖:
11楼: Originally posted by ldoop at 2012-04-12 00:24:35:
用mathematica 计算了下
结果
NMinimize
{0.0599968, {s -> 2.83, b -> 8.07, d -> 0.13, r -> 1.}}
最大值
NMaximize
{0.0852625, {s -> 2.79, b -> 7.97, d -> 0.18, r -> 0.6}}

thx
12楼2012-04-14 10:58:51
已阅   回复此楼   关注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的回帖
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 一志愿太原理工安全工程300分,求调剂 +3 0857求调剂. 2026-03-24 3/150 2026-03-27 01:18 by 求知若渴lz
[考研] 食品工程专硕求调剂 +3 小张zxy张 2026-03-26 3/150 2026-03-27 01:14 by dgnhs
[考研] 一志愿211院校 344分 东北农业大学生物学学硕,求调剂 +3 丶风雪夜归人丶 2026-03-26 3/150 2026-03-26 19:35 by 求调剂zz
[考研] 生物学 296 求调剂 +4 朵朵- 2026-03-26 6/300 2026-03-26 19:01 by 不吃魚的貓
[考研] 085602 289分求调剂 +8 WWW西西弗斯 2026-03-24 8/400 2026-03-26 16:33 by 不吃魚的貓
[考研] 考研调剂 +8 小蜡新笔 2026-03-26 8/400 2026-03-26 16:18 by dick_runner
[考研] 299求调剂 +4 15188958825 2026-03-25 4/200 2026-03-25 22:56 by 418490947
[考研] 07化学303求调剂 +5 睿08 2026-03-25 5/250 2026-03-25 22:46 by 418490947
[考研] 生物技术与工程 +3 1294608413 2026-03-25 4/200 2026-03-25 18:02 by 1294608413
[考研] 296求调剂 +4 汪!?! 2026-03-25 7/350 2026-03-25 16:41 by 汪!?!
[考研] 285求调剂 +3 AZMK 2026-03-24 3/150 2026-03-25 12:23 by userper
[考研] 材料调剂 +3 iwinso 2026-03-23 3/150 2026-03-25 11:29 by greychen00
[考研] 306求0703调剂一志愿华中师范 +10 纸鱼ly 2026-03-21 11/550 2026-03-24 17:22 by qingfeng258
[考研] 一志愿山东大学药学学硕求调剂 +3 开开心心没烦恼 2026-03-23 4/200 2026-03-24 00:06 by 开开心心没烦恼
[考研] 341求调剂(一志愿湖南大学070300) +5 番茄头--- 2026-03-22 6/300 2026-03-23 23:45 by Txy@872106
[考研] 生物学一志愿985,分数349求调剂 +6 zxts12 2026-03-21 9/450 2026-03-23 18:37 by macy2011
[考研] 291求调剂 +5 孅華 2026-03-22 5/250 2026-03-23 09:20 by haoshis
[考研] 求调剂 +4 要好好无聊 2026-03-21 4/200 2026-03-21 18:57 by 学员8dgXkO
[考研] 266求调剂 +3 哇呼哼呼哼 2026-03-20 3/150 2026-03-21 16:46 by barlinike
[考研] 求调剂 +3 @taotao 2026-03-20 3/150 2026-03-20 19:35 by JourneyLucky
信息提示
请填处理意见