Montecarlo method for particle simulation
조회 수: 10 (최근 30일)
이전 댓글 표시
Hi all,
I have to simulate a number of particle with a initial random velocity along z axis emitted by a point source and distributed inside a solid angle passing through a pinhole. I would like to "kill" particles that cannot pass through the pinhole becuase of the angular spread and mantain those that can pass.
Is there any example I can use to write this simulation?
댓글 수: 0
채택된 답변
Image Analyst
2012년 2월 8일
It's really not that hard. Have a for loop over a bunch of particles. For each particle, set its velocity (speed and angle) vector using the rand() function. Then use an "if" statement to decide whether the particle passed through or not and count those that do. It's like 7-10 lines or so.
댓글 수: 0
추가 답변 (3개)
Francesco
2012년 2월 9일
댓글 수: 1
Image Analyst
2012년 2월 9일
You need to figure out what the distance is from the start, and where that particular particle would hit laterally the blocking screen/aperture plane, and decide if that location is within the pinhole locations or not.
Francesco
2012년 2월 10일
댓글 수: 2
Image Analyst
2012년 2월 10일
I don't know. It's hard for me to follow since I don't understand Italian.
참고 항목
카테고리
Help Center 및 File Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!