Znn3bq.jpeg
±±¾©Ê¯ÓÍ»¯¹¤Ñ§Ôº2026ÄêÑо¿ÉúÕÐÉú½ÓÊÕµ÷¼Á¹«¸æ
²é¿´: 185  |  »Ø¸´: 0

chrislan625

гæ (СÓÐÃûÆø)

[ÇóÖú] Çë½ÌÒ»¸öÓÃÃÅÌØ¿¨ÂÞ¼ÆËãºÏ½ð¶þÎ¬ÃæÉÏÔ­×ÓÅÅÁÐËæ»ú¶ÈµÄÎÊÌâ

Óдó¸ÅµÄ¿ò¼Ü ¿ÉÊÇ6¸öµØ·½µÄ´úÂ벻̫»áд


function [ config ] = alloy( nBox, fAlloy, nSweeps, T, Eam )
%ALLOY Performs Metropolis Monte Carlo of a lattice gas model of an alloy
%   A random alloy is represented as a 2 dimensional lattice gas in which
%   alloying atoms can exchange position with matrix atoms using the
%   Metropolis alogorithm. The purpose is to show how alloys become more
%   random as the temperature increases.
%
%   Input arguments
%       nBox    The size of the 2-D grid
%       fAlloy  The fraction of sites occupied by alloying atoms
%       nSweeps The number of Monte Carlo moves
%       T       The temperature (K)
%       Eam     Alloy-matrix interaction energy (eV)
%
%   Output arguments
%       config  The final configuration
%
% Set interactions between like atoms to zero
% Eaa     Alloy-alloy interaction energy (eV)
% Emm     Matrix-matrix interaction energy (eV)
%
Emm = 0.0;
Eaa = 0.0;
%
% Compute kT in eV
%
kB = 8.617332e-5;
kT = kB*T;
%
% Initialize the configuartion
%   1   Matrix atoms
%   2   Alloy atoms
%

%%% PUT CODE HERE

%
% Set up energy matrix
%
Ematrix(1,1) = Emm;
Ematrix(1,2) = Eam;
Ematrix(2,1) = Eam;
Ematrix(2,2) = Eaa;
%
% Carry out the random swaps
%

%%% PUT CODE HERE

%
% Plot the configuration. Put extra zeros around border so pcolor works
% properly.
%
config_plot = zeros(nBox+1);
config_plot(1:nBox, 1:nBox) = config;
pcolor(config_plot);
end

function [ixb iyb dE] = swapInfo(ixa, iya, dab, nBox, config, Ematrix)
%SWAPINFO Returns the position of the neighbour and the energy change
%   following a swap
%
%   Input arguments
%       ixa         X coordinate of first atom
%       iya         Y coordinate of first atom
%       dab         Direction of second atom relative to first. There are four
%                   possible directions, so this takes values between 1 and
%                   4. Together with ixa and ixb, this allows the position
%                   of the second atom to be computed. This calculation is
%                   done by getNeighbour
%       config      The configuration of alloy atoms
%       nBox        System size
%       Ematrix     The 2x2 matrix of bond energies
%   Output arguments
%       ixb         X coordinate of second atom
%       iyb         Y coordinate of second atom
%       dE          Energy change following swap
%
% Find neighbour atom
%

%%% PUT CODE HERE

%
% Find energy change
%

%%% PUT CODE HERE

%
    function [ix2 iy2] = getNeighbour (ix1, iy1, d12)
        %GETNEIGHBOUR returns the position of a neighbouring atom
        %
        % Input arguments
        %   ix1     X coordinate of first atom
        %   iy1     Y coordinate of first atom
        %   d12     Direction of second atom relative to first
        % Output arguments
        %   ix2     X coordinate of second atom
        %   iy2     Y coordinate of second atom
        %
        % Find new x coordinate
        %

%%% PUT CODE HERE

        %
        % Find new y coordinate
        %

%%% PUT CODE HERE

    end
end
»Ø¸´´ËÂ¥

» ²ÂÄãϲ»¶

ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû
Ïà¹Ø°æ¿éÌø×ª ÎÒÒª¶©ÔÄÂ¥Ö÷ chrislan625 µÄÖ÷Ìâ¸üÐÂ
×î¾ßÈËÆøÈÈÌûÍÆ¼ö [²é¿´È«²¿] ×÷Õß »Ø/¿´ ×îºó·¢±í
[¿¼ÑÐ] µ÷¼Á +9 ÔÂ@163.com 2026-04-08 9/450 2026-04-08 21:44 by ZMQAHPU
[¿¼ÑÐ] ²ÄÁϵ÷¼Á +13 Ò»ÑùYWY 2026-04-06 13/650 2026-04-08 20:44 by LiuXingYuÐÇÐÇ
[¿¼ÑÐ] Çóµ÷¼Á£¬ÏÖÔÚ»¹ÄÜÌîµÄ +3 Éϰ¶Ð¡Ó¨¼ÓÓÍ 2026-04-08 3/150 2026-04-08 14:30 by zhq0425
[¿¼ÑÐ] µ÷¼Á +4 mcbbc 2026-04-06 5/250 2026-04-07 12:33 by upczlm1989
[¿¼ÑÐ] Èí¹¤Ñ§Ë¶299Çóµ÷¼Á +6 useryy 2026-04-07 6/300 2026-04-07 09:50 by vgtyfty
[¿¼ÑÐ] Ò»Ö¾Ô¸ËÕÖÝ´óѧ²ÄÁϹ¤³Ì£¨085601£©×¨Ë¶ÓпÆÑо­ÀúÈýÏî¹ú½±Á½¸öʵÓÃÐÍרÀûÒ»ÏîÊ¡¼¶Á¢Ïî +11 ´ó»ðɽС»ðɽ 2026-04-05 11/550 2026-04-06 22:55 by yunlongyang
[¿¼ÑÐ] 22408 331·ÖÇóµ÷¼Á +4 y__1 2026-04-06 4/200 2026-04-06 17:26 by ÍÁľ˶ʿÕÐÉú
[¿¼ÑÐ] 348Çóµ÷¼Á +3 ³µÀå×Ózzz 2026-04-05 3/150 2026-04-05 20:30 by à£à£à£0119
[¿¼ÑÐ] ÉúÎïѧ308·ÖÇóµ÷¼Á£¨Ò»Ö¾Ô¸»ª¶«Ê¦´ó£© +8 ÏàÐűػá¹ââÍòÕ 2026-04-05 10/500 2026-04-05 12:19 by Hdyxbekcb
[¿¼ÑÐ] ²ÄÁϵ÷¼Á +7 dxyµ÷¼Á 2026-04-04 7/350 2026-04-05 09:15 by İÇï26
[¿¼ÑÐ] 0854Çóµ÷¼Á +4 assdll 2026-04-03 4/200 2026-04-04 22:17 by hemengdong
[¿¼ÑÐ] Ò»Ö¾Ô¸»ª±±µçÁ¦´óѧ£¨±±¾©£©£¬²ÄÁÏ¿ÆÑ§Ó빤³Ìѧ˶265£¬Çóµ÷¼Á +11 yelck 2026-04-03 12/600 2026-04-04 19:52 by dongzh2009
[¿¼ÑÐ] 309Çóµ÷¼Á +4 ¿ìÀÖµÄС°×¸ë 2026-04-04 5/250 2026-04-04 15:55 by cql1109
[¿¼ÑÐ] 085701Çóµ÷¼Á +7 ¹¨ÓíÃú 2026-04-04 8/400 2026-04-04 13:49 by ССÊ÷2024
[¿¼ÑÐ] µ÷¼Á0855-288 +5 xÐܶþa 2026-04-03 5/250 2026-04-04 00:19 by Öí»á·É
[¿¼ÑÐ] 085601Ò»Ö¾Ô¸±±Àí325·ÖÇóµ÷¼Á +6 ÕÒµ÷¼Á£¬£¬ 2026-04-02 6/300 2026-04-03 22:20 by –¹Æ?
[¿¼ÑÐ] 338Çóµ÷¼Á +4 zzz£¬£¬r 2026-04-03 4/200 2026-04-03 16:39 by lijunpoly
[¿¼ÑÐ] ÍÁľˮÀû328·ÖÇóµ÷¼Á +6 ¼²·çÖª¾¢²Ý666 2026-04-02 6/300 2026-04-03 11:38 by znian
[¿¼ÑÐ] Ò»Ö¾Ô¸°²»Õ´óѧ0817»¯Ñ§¹¤³ÌÓë¼¼Êõ£¬Çóµ÷¼Á +14 ÎÒ²»ÊÇÖ»Òò 2026-04-02 15/750 2026-04-03 09:49 by À¶ÔÆË¼Óê
[¿¼ÑÐ] 312Çóµ÷¼Á +4 ÉÞÔÂÉ« 2026-04-02 5/250 2026-04-03 08:21 by fangshan711
ÐÅÏ¢Ìáʾ
ÇëÌî´¦ÀíÒâ¼û