clear all;
close all;
clc
N=16,
Te=[0:0.2:5];
imax=500000;
MT=zeros(1, length(Te) ) ;
Cv=zeros(1, length(Te) ) ;
xx=zeros(1, length(Te) ) ;
L=1k=1
forT=Te
Mt=zeros(1, imax)
step= 100000
spin=round(rand(N) ) .*2-1;
subplot(3.2.1)
gsp in=p color(spin) :
colormap(gray(2) )
title(自旋分布情况) ;
Mt=zeros(1, imax) ;
subplot(3, 2.2)
gMt=plot([1:imax] .Mt) :
22.a0.00
axis([O imax-1.11.1] )
title('固定温度下的磁矩) ;
%xlabel('时间) ;
%ylabel(‘Mt”) ;
%initial energy
idx=repmat((:) , ndims(spin) , 1) ;
idx(1) =[N1:N-1] ;
E total=spin(idx() )
伊辛(ising)模型MATLAB源程序
最新推荐文章于 2021-05-20 13:02:53 发布
这段MATLAB代码用于模拟伊辛模型,展示了不同温度下自旋分布、磁矩、能量随时间变化以及磁矩、热容、磁导率随温度变化的图形。通过变量N设定网格大小,Te设定温度范围,imax设定迭代次数,利用rand生成初始自旋状态,并进行Monte Carlo步骤更新。
摘要由CSDN通过智能技术生成