二次规划求解问题。

1 次查看(过去 30 天)
kevag
kevag 2022-11-17
回答: kewovi 2022-11-17
function Q=fitness(u)
syms u1 u2
ti=[30 76 107 128 162 197 228 259 284 315 346 376 407 437 470 527 588 649 741 833 954 1046 1198 1928];
si=[1.8 3.8 3.84 3.85 6.44 7.53 8.36 8.97 10.25 11.12 13.06 13.46 12.85 13.15 14.06 15.84 16.5 16.75 17.57 21.48 21.39 22.86 22.46 26.41];
w=28.2-28.24.*exp(-0.002146.*ti.^0.9437);
g=25.29.*exp(-2.237.*exp(-0.002905.*ti));
Q=sum((u1.*w+u2.*g)-si)^2
以Q最小值为目标函数,求出参数u1. u2。。。使得u1. u2均大于0,且u1+ u2=1
该怎么进行编码 急用 帮帮忙 谢谢

采纳的回答

kewovi
kewovi 2022-11-17
function Q=fitness(u)
ti=[30 76 107 128 162 197 228 259 284 315 346 376 407 437 470 527 588 649 741 833 954 1046 1198 1928];
si=[1.8 3.8 3.84 3.85 6.44 7.53 8.36 8.97 10.25 11.12 13.06 13.46 12.85 13.15 14.06 15.84 16.5 16.75 17.57 21.48 21.39 22.86 22.46 26.41];
w=28.2-28.24.*exp(-0.002146.*ti.^0.9437);
g=25.29.*exp(-2.237.*exp(-0.002905.*ti));
Q=sum(u*w+(1-u)*g-si)^2;
end
[xopt,fopt]=fminsearch(@fitness,.5)
xopt = 0.7703
fopt = 6.8337e-09

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!