一道优化的题,过早的退出,
function maxtrans = transmissibility_zk(zk)m1=260.8;
m2=14.5;
k1=334259;
z1 =0.03;
c1=2*sqrt(m1*k1)*z1;
z2=zk(1);
k2=zk(2);
c2=2*sqrt(k2*m2)*z2;
w1=0.5*2*pi;
w2=10*2*pi;
w = w1:(w2-w1)/500:w2;
T =( (c1*j*w + k1) .* (m2*(j*w).*2 + c2*j*w + k2) ) ./...
( (m1*(j*w).^2 +( c1 +c2 )*j*w +k1 + k2).*(m2*(j*w).^2 + c2*j*w +k2) - ( c2*j*w + k2).^2 );
% figure
% plot(w,abs(T))
% figure
% plot(w,angle(T)*180/pi)
maxtrans=max(abs(T));
这个是目标函数
以下是调用语句
=fmincon(@transmissibility_zk,,[ ],[ ],[ ],[ ],,)
结果没有得到要求的目标值,
只迭代了6次就退出了
Optimization terminated: magnitude of directional derivative in search
direction less than 2*options.TolFun and maximum constraint violation
is less than options.TolCon.
No active inequalities.
x =
1.0e+004 *
0.000036464769068 1.386498505477171
fval =
11.592576914326367
exitflag =
5
output =
iterations: 6
funcCount: 23
lssteplength: 1
stepsize: 0.001372954668234
algorithm: 'medium-scale: SQP, Quasi-Newton, line-search'
firstorderopt: 9.591579437255859e-004
message:
lambda =
lower:
upper:
eqlin:
eqnonlin:
ineqlin:
ineqnonlin:
grad =
1.0e-003 *
0.959157943725586
0.537485388391948
hessian =
18.401867691914799-0.004367311374674
-0.004367311374674 0.999885314836522 在现有的优化限制条件下没有解,改一下限制条件吧 如果用几个参数做fmincon优化,应该将这些优化求解的参数的数量级用新变量替换为一致,
在进行迭代的函数中还原计算。否则这个优化函数将得不到正确的优化解,你只会看到
一个变量有变化,另一个几乎不变。
用fminsearch优化函数就没有这个数量级的限制,但是不能提供上下界约束。
页:
[1]