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.

Passing location and velocity of particle from external MATLAB function back to COMSOL

Please login with a confirmed email address before reporting spam

The below post is related to an archived discussion


[start here] Hello, I am using COMSOL version 5.5 on Windows 10.

I have an external MATLAB function to calculate the velocity of a particle after it hits a Wall. I have followed the instructions given in the "Introduction to Livelink for MATLAB" and the section on using external functions for MATLAB. I can create a MATLAB function which returns the new velocity of the particle. I can select as Wall condition "General reflection" and there I can provide the name of the MATLAB function (or functions) for the reflected particle velocity. So far so good. However, the particle that hit the wall from the vacuum (as calculated by COMSOL) and then enters the material (as calculated by MATLAB) does not return to the same point and so I need to pass not only the velocity, but also the position of the particle back to COMSOL. Is there a way I can do this ?

Thank you in advance Chris Walker


0 Replies Last Post Jul 7, 2020, 3:37 a.m. EDT
COMSOL Moderator

Hello Christopher Walker

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.