unitanneal.m
来自「lingjian.m-----蒙特卡罗方法 lingjian.m使用零」· M 代码 · 共 24 行
M
24 行
%function x=unitanneal(L,s,t,dt,x,lb,ub)
%x为标定值,lb为下界,ub为上界
function x=unitanneal(L,s,t,dt,x,lb,ub)
s0=0;
while 1
a=0;
for k=1:L
newx=generatenew(x,lb,ub);
df=accyouhua(newx)-accyouhua(x);
if accept(t,df)
x=newx,a=1;
end
end
t=t*dt
if a==0
s0=s0+1;
else
s0=0;
end
if s0==s
break;
end
end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?