Calton板的数值模拟

王朝other·作者佚名  2006-05-02
窄屏简体版  字體: |||超大  

Calton板的数值模拟

EmilMatthew(EmilMatthew@126.com)

摘要:

本文基于Matlab,实现了Calton板的数值模拟。

关键词: Calton板,二项分布

Numerical Simulation of Calton Board

EmilMatthew(EmilMatthew@126.com)

Abstract:

In this article , I implemented the numerical simulation of Calton Board based on the tool of matlab.

Key Words: Calton Board

1前言:

Calton板是一个常用来在物理的热力学中说明粒子分布现象的实验。

对于N个粒子分布在ε1~εM上共M个能级上会有多种分布,其中热力学概率最大的分布称为最概然分布。

又对于热力学系统N≥1024,N,V,E确定的系统达平衡时(即系统的热力学态),粒子的分布方式几乎将不随时间而变化,这种分布称为平衡分布。可以证明,平衡分布即为最概然分布所能代表的那些分布。

而最终Calton板最概然分布的极限分布接近于二项分布[1],这就为数值仿真带来了方便。

2实现原理:

由于Calton的极限分布接近于一个二项分布,所以,在小球即到每个钉子时,可以根据概率p来选择是向左转还是向右转。(这里,采用以概率p向左转)。假设有n排钉子,则最终小球可以落入的位置为n+1列(见图1)。有了以上认识后,进行相应的数值模拟是方便的。

图1

3实验代码:

%----simulate of calton board----

%--global variable--

% the possibility of left drop direction.

p=0.7;

% the level that the ball should pass

level=7;

% the number of the ball generated which in one trial.

n_balls=10000;

% array to store the num in each tunnel.

a=zeros(1,level+1);

aStatics=zeros(1,n_balls);

% the tunnel looks from left.

leftPos=1;

% iter val

i=0;

iBallCount=0;

tmpRnd=0;

%--core simulatioin--

%total ball simulate

while iBallCount<n_balls

%--each ball selection--

i=0;leftPos=1;

%drop levels selection

while i<level

tmpRnd=rand(1,1);

%select forward direction.

if(tmpRnd>=p)

leftPos=leftPos+1;

end

i=i+1;

end

%note each simulation ball's last pos.

a(leftPos)=a(leftPos)+1;

aStatics(iBallCount+1)=leftPos;

iBallCount=iBallCount+1;

end

hist(aStatics,level+1)

4实验结果:

图2及图3展示了测试粒子为10000粒子时,左转概率p分别为0.5及0.7的分布情况,可以看出,结果很好的验证了Calton板的极限分布服从二项分布这一推论。

图2

图3

参考文献:

[1]基于Matlab的Calton板实验仿真设计及实现,计算机仿真,2006.3

程序完成日:06/04/30

文章完成日:06/05/01

附录:

1测试程序下载:

http://emilmatthew.51.net/EmilPapers/06_15Calton/code.rar

若直接点击无法下载(或浏览),请将下载(或浏览)的超链接粘接至浏览器地址栏后按回车.若不出意外,此时应能下载。

若下载中出现了问题,请参考:

http://blog.csdn.net/emilmatthew/archive/2006/04/08/655612.aspx

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航