Writing a Monte Carlo Simulation for Diffusion?

조회 수: 6 (최근 30일)
Seana Catherman
Seana Catherman 2015년 11월 19일
편집: Walter Roberson 2015년 11월 20일
I'm not sure where to start on this problem, how to input the boundary conditions, or how to get a reasonable answer.
Construct a Monte Carlo routine to model a one-dimensional diffusion problem and calculate a distribution of particles from a given starting distribution after a defined number of time steps. Use this routine to model the diffusion of particles over time for the following cases.
A. Fix the concentration at one boundary to be 1.0, and at time zero, let the concentration within your space be zero. Propagate the diffusion of particles into the space. Compare your distributions to the closed form solution for this problem:
c(x,t) = 1erf (x/sqrt(4Dt))
In this equation, c is the concentration normalized to the concentration fixed at the boundary, erf is the error function, x is the distance from the boundary, D is the diffusion coefficient and t is time. The boundary conditions leading to this solution are:
c = 1.0 at x = 0 for all t
c = 0.0 for x > 0 at t = 0
c = 0.0 at x → ∞ for all t
Under what conditions does the Monte Carlo model start to diverge from the closed form solution? Why?

답변 (0개)

카테고리

Help CenterFile Exchange에서 Particle & Nuclear Physics에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by