t3,t4即total就是所求的目标函数。连续用两个subs运算我也不明白。将x付给k是因为要用k表示捕捞强度,而这个函数是y和x的函数“function y=buyu(x)” 。求目标值y和捕捞强度k的函数,必须让x和k的意义相同。因为fminbnd只能求取最小值,将最大值问题化为最小值问题加个负号就行,即“y=subs(-total) ”
总之,第一个文件为函数文件,而第二个m函数为真正求解问题的脚本文件。fminbnd函数是求上面定义的函数目标值y在x取值为[16,18]范围内的最优值。最后就是画出目标值total随自变量捕获强度的关系,以及显示最优值时各个量的取值。
把b4=fmin(M11,0,100)改为x=0:0.01:100
b4=min(M11)
即可
运行结果:
M10 =
3098054652370562300055450439453125/137438953472*x/(4/5+21/50*x)*(1-exp(-8/15-7/25*x))*exp(-12/5-7/25*x)*(2487502290053097/34359738368+8941654617830195/137438953472*exp(-2/3*x)/(1-exp(-4/5-2/3*x)))/(122000000000+122000000000*exp(-12/5-7/25*x)*(2487502290053097/34359738368+8941654617830195/137438953472*exp(-2/3*x)/(1-exp(-4/5-2/3*x))))+342183160000000000000000*x/(4/5+x)*(1-exp(-8/15-2/3*x))*exp(-12/5-7/25*x)^2*(2487502290053097/34359738368+8941654617830195/137438953472*exp(-2/3*x)/(1-exp(-4/5-2/3*x)))/(122000000000+122000000000*exp(-12/5-7/25*x)*(2487502290053097/34359738368+8941654617830195/137438953472*exp(-2/3*x)/(1-exp(-4/5-2/3*x))))/(1-exp(-4/5-2/3*x))
M11 =
-3098054652370562300055450439453125/137438953472*x/(4/5+21/50*x)*(1-exp(-8/15-7/25*x))*exp(-12/5-7/25*x)*(2487502290053097/34359738368+8941654617830195/137438953472*exp(-2/3*x)/(1-exp(-4/5-2/3*x)))/(122000000000+122000000000*exp(-12/5-7/25*x)*(2487502290053097/34359738368+8941654617830195/137438953472*exp(-2/3*x)/(1-exp(-4/5-2/3*x))))-342183160000000000000000*x/(4/5+x)*(1-exp(-8/15-2/3*x))*exp(-12/5-7/25*x)^2*(2487502290053097/34359738368+8941654617830195/137438953472*exp(-2/3*x)/(1-exp(-4/5-2/3*x)))/(122000000000+122000000000*exp(-12/5-7/25*x)*(2487502290053097/34359738368+8941654617830195/137438953472*exp(-2/3*x)/(1-exp(-4/5-2/3*x))))/(1-exp(-4/5-2/3*x))
b3 =
16.8000
b4 =
40
Max =
3.4604e+010
N1 =
1.0054e+010
N2 =
4.5173e+009
N3 =
2.0298e+009
N4 =
1.2471e+004
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)