| ²é¿´: 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 |
» ²ÂÄãϲ»¶
µ÷¼Á
ÒѾÓÐ20È˻ظ´
0703»¯Ñ§
ÒѾÓÐ32È˻ظ´
286Çóµ÷¼Á
ÒѾÓÐ9È˻ظ´
Çóµ÷¼Á
ÒѾÓÐ7È˻ظ´
278Çóµ÷¼Á
ÒѾÓÐ24È˻ظ´
²ÄÁÏÀà284µ÷¼Á
ÒѾÓÐ19È˻ظ´
Ò»Ö¾Ô¸0703»¯Ñ§ÕÐ61×îÖÕÅÅÃû62»¯Ñ§Çóµ÷¼Á
ÒѾÓÐ14È˻ظ´
Çóµ÷¼Á
ÒѾÓÐ13È˻ظ´
299Çóµ÷¼Á
ÒѾÓÐ3È˻ظ´
»úеר˶273ÇëÇóµ÷¼Á
ÒѾÓÐ6È˻ظ´














»Ø¸´´ËÂ¥