bwzong的个人博客分享 http://blog.sciencenet.cn/u/bwzong

博文

布朗运动的简单模拟

已有 4807 次阅读 2014-12-15 20:11 |个人分类:成长日记.matlab|系统分类:教学心得

布朗运动做为一种随机过程,出现的场合有些多呀。

下面是简单的模拟二维三维布朗运动

先上图

代码如下:

%布朗运动:二维、三维

clear all;close all;clc

t0=0;

tf=50;

delta=0.5;

t=t0:delta:tf; %时间范围,步长


x=randn(size(t))*sqrt(delta);

y=randn(size(t))*sqrt(delta);

z=randn(size(t))*sqrt(delta);%三维,下同


U(1)=0;

V(1)=0;

W(1)=0;


for i=1:length(t)

   U(i+1)=U(i)+x(i);

   V(i+1)=V(i)+y(i);

   W(i+1)=W(i)+z(i);

end


plot(U,V);

%plot3(U,V,W);

grid on

box on

%axis off

%鸣谢panhaidongphd



https://blog.sciencenet.cn/blog-1120694-851285.html

上一篇:VideoWriter制作AVI视频实例
下一篇:望远镜的性能简介
收藏 IP: 61.167.60.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-9-27 13:19

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部