二次规划求解问题。

1 Ansicht (letzte 30 Tage)
kevag
kevag am 17 Nov. 2022
Beantwortet: kewovi am 17 Nov. 2022
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
该怎么进行编码 急用 帮帮忙 谢谢

Akzeptierte Antwort

kewovi
kewovi am 17 Nov. 2022
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

Weitere Antworten (0)

Kategorien

Mehr zu MATLAB finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!