Monte Carlo method for Smoluchowski equation

  • Context: Graduate 
  • Thread starter Thread starter Feynman
  • Start date Start date
  • Tags Tags
    Method Monte carlo
Click For Summary
SUMMARY

The forum discussion centers on the implementation of the Monte Carlo method for solving the Smoluchowski equation using Maple. The user reports an issue where the positions of particles, represented by the variable z[l], do not change as expected during the simulation. The provided code includes functions for generating random numbers and updating particle positions, but the condition r[i] > 1/(20*z[i]) is consistently true, preventing any updates to z. The user seeks assistance in identifying the problem within their code.

PREREQUISITES
  • Understanding of the Monte Carlo method
  • Familiarity with the Smoluchowski equation
  • Proficiency in Maple programming language
  • Knowledge of random number generation techniques
NEXT STEPS
  • Investigate the behavior of random number generation in Maple
  • Learn about conditional statements in Maple and their impact on loop execution
  • Explore debugging techniques in Maple to identify logical errors
  • Research alternative methods for simulating particle dynamics
USEFUL FOR

Researchers, physicists, and programmers working on simulations involving stochastic processes, particularly those interested in the Monte Carlo method and the Smoluchowski equation.

Feynman
Messages
152
Reaction score
0
Hi every body,
i've a simple question in the programation for a certain methode called Monte Carlo method for Smoluchowski equation:
i programe this method in maple but the problem is that the positions of particules z[l]is not changing ( it most be changed ): can anyone tell me where is the problem?
this is the method:

//calculate natural random numbers
test:=proc(N)
local a,i,L;
L:=[];
a:=rand(1..N):
for i from 1 to N do L:=[op(L),a()] od;
L;
end:
\\z is the position of particules
z:=test(10);

pi:=test(10);
\\ calculate uniform random numbers U[0,1]

r:=stats[random, uniform](10):for i from 1 to 10
do
printf("r[%d]=%f\n",i,r);
od;

\\ position of particules at time t+dt=t+1/20

for i from 1 to 10
do
if
r>1/(20*z) or r=1/(20*z)
then
z(t+dt)=z:
end if;
if
r<1/(20*z)
then
z(t+dt)=z+z[pi]:
end if;
od:
thankx verry much
 
Physics news on Phys.org
I guess that r>1/(20*z) is "always" true. Then you have z[t+dt](i)=z[t] explicitly in your code.
 

Similar threads

  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 15 ·
Replies
15
Views
8K