Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Particle tracking in MATLAB and COMSOL 3.5.0.603

Please login with a confirmed email address before reporting spam

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~


0 Replies Last Post Mar 8, 2010, 8:10 a.m. EST
COMSOL Moderator

Hello Rich Messeder

Your Discussion has gone 30 days without a reply. If you still need help with COMSOL and have an on-subscription license, please visit our Support Center for help.

If you do not hold an on-subscription license, you may find an answer in another Discussion or in the Knowledge Base.

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.