cluster_perturb.m

来自「一个模拟退火matlab程序」· M 代码 · 共 31 行

M
31
字号
function Wnew = cluster_perturb(X,W,Ea,T)
% Wnew = cluster_perturb(X,W)
% Method for chemcluster example supplied with SA Tools.
% See http://www.frostconcepts.com/software for information on SA Tools.
%
%   Wnew = cluster_perturb(X,W,Ea,T) ;
%
%   X = [N,a,b,g,rho]
%       N = number of molecules
%       a = Lennard-Jones coefficient
%       b = Lennard-Jones coefficient
%       g = compression factor used in perturb
%       rho = (b/a)^(1/6) two-particle 1d solution
%   W = N 3D points.
%   Wnew = perturbed copy of W
%   Ea = (not used) average energy.
%   T = (not used) current temperature.
%
%   Perturbs a cluster either (random choice) by 
%       compression or expansion.  The latter is
%       acheived by the satools method "stillinger3Dpoints".
%   
N = X(1) ;
g = X(4) ;
rho = X(5) ;
if rand < 0.5       % to compress or expand, that is the question!
    Wnew = g*W ;
else
    Wnew = stillinger3Dpoints(W,N,rho) ;
end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?