| 5 | 1/1 | 返回列表 |
| 查看: 1850 | 回復(fù): 12 | |||||
| 當(dāng)前只顯示滿足指定條件的回帖,點(diǎn)擊這里查看本話題的所有回帖 | |||||
[求助]
多元函數(shù)求最值
|
|||||
|
剛接觸matlab,我想用matlab求下面函數(shù)的最大、最小值以及取最值的時(shí)候自變量取值,是一個(gè)有4個(gè)自變量的函數(shù),自變量都有一定的變化范圍。具體函數(shù)是: 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.有木有大神幫幫忙知道一下啊 |
榮譽(yù)版主 (著名寫手)
![]() |
專家經(jīng)驗(yàn): +4 |
|
>> 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 |

| 百度你會(huì)不?http://www.google.com.hk/#hl=zh- ... rgbld.&bav=on.2,or.r_gc.r_pw.,cf.osb&fp=b7e86341b10bb823&biw=1366&bih=667 |
木蟲(chóng) (著名寫手)
云中仙
樓上正解![]() 給你貼個(gè)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); ====== 結(jié)果 ====== 迭代數(shù): 18 計(jì)算用時(shí)(時(shí):分:秒:毫秒): 00:00:00:94 計(jì)算中止原因: 達(dá)到收斂判定標(biāo)準(zhǔn) 優(yōu)化算法: 共扼梯度法 + 通用全局優(yōu)化法 函數(shù)表達(dá)式: (d*(s+b+d)+0.858*r*r-0.858*(r+d/2)*(r+d/2))/(s*b-0.858*r*r) 目標(biāo)函數(shù)值(最小): 0 s: 2.82999999999992 b: 8.06833196340274 d: 0 r: 0.830131999171392 ====== 計(jì)算結(jié)束 ====== |

| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 070305高分子化學(xué)與物理 304分求調(diào)劑 +7 | c297914 2026-03-28 | 7/350 |
|
|---|---|---|---|---|
|
[考研] 調(diào)劑求院校招收 +5 | 鶴鯨鴿 2026-03-28 | 5/250 |
|
|
[考研] 各位老師好,我的一志愿為北京科技大學(xué)085601材料專碩 +7 | Koxui 2026-03-28 | 7/350 |
|
|
[考研] 086000生物與醫(yī)藥調(diào)劑 +3 | Feisty。 2026-03-28 | 7/350 |
|
|
[考研] 356求調(diào)劑 +3 | gysy?s?a 2026-03-28 | 3/150 |
|
|
[考研] 332求調(diào)劑 +4 | @MZB382400 2026-03-28 | 4/200 |
|
|
[考研] 生物學(xué)學(xué)碩,一志愿湖南大學(xué),初試成績(jī)338 +6 | YYYYYNNNNN 2026-03-26 | 7/350 |
|
|
[考研] 083000學(xué)碩274求調(diào)劑 +8 | Li李魚(yú) 2026-03-26 | 8/400 |
|
|
[考研] 0856,材料與化工321分求調(diào)劑 +12 | 大饞小子 2026-03-27 | 13/650 |
|
|
[考研] 277跪求調(diào)劑 +5 | 1915668 2026-03-27 | 9/450 |
|
|
[考研] 一志愿211院校 344分 東北農(nóng)業(yè)大學(xué)生物學(xué)學(xué)碩,求調(diào)劑 +5 | 丶風(fēng)雪夜歸人丶 2026-03-26 | 8/400 |
|
|
[考研] 316求調(diào)劑 +5 | Pigcasso 2026-03-24 | 5/250 |
|
|
[考研] 一志愿211,335分,0856,求調(diào)劑院校和導(dǎo)師 +4 | 傾____蕭 2026-03-27 | 5/250 |
|
|
[考研] 求調(diào)劑323材料與化工 +7 | 1124361 2026-03-24 | 7/350 |
|
|
[考研]
|
鐘llll 2026-03-26 | 4/200 |
|
|
[考研] 材料科學(xué)與工程 317求調(diào)劑 +4 | JKSOIID 2026-03-26 | 4/200 |
|
|
[考研] 一志愿上海交大生物與醫(yī)藥專碩324分,求調(diào)劑 +6 | jiajunX 2026-03-22 | 6/300 |
|
|
[考博] 26申博自薦 +3 | whh869393 2026-03-24 | 3/150 |
|
|
[考研] 一志愿國(guó)科過(guò)程所081700,274求調(diào)劑 +3 | 三水研0水立方 2026-03-23 | 3/150 |
|
|
[考研] 284求調(diào)劑 +3 | yanzhixue111 2026-03-23 | 6/300 |
|