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.

to extract particle coordinates from particle tracing plot..

Please login with a confirmed email address before reporting spam

Hi..

I am using comsol 3.4 with matlab.
I want to know, if it is possible to extract the coordinates of a particle after tracing its path using particle tracing.

i am using postplot to obtain the trace. i want to know the x and y coordinates for a given z. any help will be highly appreciated.
its urgent.

thanx

5 Replies Last Post Mar 3, 2011, 12:11 p.m. EST

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Nov 10, 2010, 6:55 a.m. EST
I use 3.5a and my script sounds like this one:

h = postplot(fem,...
'partstart',A,...
'partmasstype','massless',...
'parttvar','partt',...
'partdata',{'u','v'},...
'partedgetol',0.001,...
'outtype','postdata');

position{d,1}(1,:) = h{1,1}.p(1,:);
% r-coordinate of the points along the pathline
position{d,1}(2,:) = h{1,1}.p(2,:);
% z-coordinate of the points along the pathline

J
I use 3.5a and my script sounds like this one: h = postplot(fem,... 'partstart',A,... 'partmasstype','massless',... 'parttvar','partt',... 'partdata',{'u','v'},... 'partedgetol',0.001,... 'outtype','postdata'); position{d,1}(1,:) = h{1,1}.p(1,:); % r-coordinate of the points along the pathline position{d,1}(2,:) = h{1,1}.p(2,:); % z-coordinate of the points along the pathline J

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Mar 1, 2011, 8:48 p.m. EST
Jacopo,

would you please specify more clearly the meaning of the parameters you have inside the script? I tried, but the parameter 'h' is unknown. Don't know where it came from.

Thanks a lot.

Pete.
Jacopo, would you please specify more clearly the meaning of the parameters you have inside the script? I tried, but the parameter 'h' is unknown. Don't know where it came from. Thanks a lot. Pete.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Mar 1, 2011, 9:10 p.m. EST
Nevermind, I found a different piece of discussion where I found the rest :)

Thank for info anyway :)

Kind regards,

Peter.
Nevermind, I found a different piece of discussion where I found the rest :) Thank for info anyway :) Kind regards, Peter.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Mar 1, 2011, 10:35 p.m. EST
Hello Jacopo,

at last, I encountered a problem with your script and still cannot find a suitable solution. I have also found the more detailed version of your script you prepared for Marie 'marie_comsol.doc' but in the line where:

'partdata',{'u','v'},...

seems to be a mistake, because this parameter is for a particle movement equation and MATLAB also prints an error.

Furthermore, when using e.g. 'partdata',{'partq*Ex_emdc','partq*Ey_emdc'},... the variable h = postplot(....) does not contain any usefull numbers, it's just a vector 148x1.

Would you explain this in more detail to me please ?

Thank you for your help.

Peter.
Hello Jacopo, at last, I encountered a problem with your script and still cannot find a suitable solution. I have also found the more detailed version of your script you prepared for Marie 'marie_comsol.doc' but in the line where: 'partdata',{'u','v'},... seems to be a mistake, because this parameter is for a particle movement equation and MATLAB also prints an error. Furthermore, when using e.g. 'partdata',{'partq*Ex_emdc','partq*Ey_emdc'},... the variable h = postplot(....) does not contain any usefull numbers, it's just a vector 148x1. Would you explain this in more detail to me please ? Thank you for your help. Peter.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Mar 3, 2011, 12:11 p.m. EST
Here I am,

sorry for the late reply.

Can we do it step by step? Is quite some time I'm not using that script and I have to recall the different pieces.

But first: the command h = postplot... means that I'm performing a postplot action and all the data are going to be inside h. In my particular case the action was a particle tracing, and in the location h.p the positions of the particle were stored.

Now... tell me what you need :)

J
Here I am, sorry for the late reply. Can we do it step by step? Is quite some time I'm not using that script and I have to recall the different pieces. But first: the command h = postplot... means that I'm performing a postplot action and all the data are going to be inside h. In my particular case the action was a particle tracing, and in the location h.p the positions of the particle were stored. Now... tell me what you need :) J

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.