Discussion Forum

Particle tracking in MATLAB and COMSOL 3.5.0.603

Topics: no topics

Thread index  |  Previous thread  |  Next thread  |  Start a new discussion

RSS FeedRSS feed   |   Email notificationsTurn on email notifications   |   0 Replies   Last post: March 8, 2010 1:10pm UTC
Rich Messeder

Rich Messeder

March 8, 2010 1:10pm UTC

Particle tracking in MATLAB and COMSOL 3.5.0.603

Win XP Pro / COMSOL 3.5.0.603 / MATLAB 2007a

Attached: MP_EM_Potential_2_1_0_track_electrons.b.zip

I am fairly inexperienced with COMSOL, but learning...

In the attached files, I have a new project that I created based on the COMSOL tutorial with 2 potential cylinders. I want to track 1e5 particles, so I am trying to use MATLAB.

The particles must originate in a confined area with random starting points in that area, random velocities in a particular range, and random directions within a certain range. I must track them until specific conditions are met. I have accomplished much of this already, but my work shows slight deviation from COMSOL, and I'd like to know why. I also don't understand exactly what I can/should keep when I make the call to "postplot(fem, ...". I have "guessed" what to keep.

In the attached zip file there is an image that show the deviation of my track from COMSOL. For the first phase of my project, I need to track particles for 10m or so, and see if they hit a target 1 cm in diameter and 0.5m long. The next phase will require tracking particles for 50m.

Q1: Why does my track differ from COMSOL? Am I using an incorrect approach to using COMSOL variables? Not the correct variables? Is it just a difference in error due to calculations?

Q2: In my call to "postplot (fem, ...", can I / should I reduce the number of variables that I pass to postplot ()? The MATLAB source code has quite a bit of extra debug code in it, but most of it is commented out, and I think that whay remains is clear enough. I'll be happy to answer any questions on or off the forum...

Thanks much,
~Rich~

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse


Rules and guidelines